Add an error message if there's some file being found as 'manually modified' during upgrade

This commit is contained in:
Alexandre Aubin 2021-03-20 13:45:25 +01:00
parent d885ce2308
commit d2777febbb

View file

@ -325,6 +325,13 @@ TEST_LAUNCHER () {
[ $? -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result
# Check that we don't have this message characteristic of a file that got manually modified,
# which should not happen during tests because no human modified the file ...
if grep -q --extended-regexp 'has been manually modified since the installation or last upgrade. So it has been duplicated' $current_test_log
then
log_error "Apparently the log is telling that 'some file got manually modified' ... which should not happen, considering that no human modified the file ... ! Maybe you need to check what's happening with ynh_store_file_checksum and ynh_backup_if_checksum_is_different between install and upgrade."
fi
# Check that the number of warning ain't higher than a treshold
local n_warnings=$(grep --extended-regexp '^[0-9]+\s+.{1,15}WARNING' $current_test_log | wc -l)
# (we ignore this test for upgrade from older commits to avoid having to patch older commits for this)