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

@ -194,7 +194,7 @@ guess_test_configuration() {
log_error "Not check_process file found." log_error "Not check_process file found."
log_warning "Package check will attempt to automatically guess what tests to run." log_warning "Package check will attempt to automatically guess what tests to run."
local test_id=100 local test_id=100
add_test() { add_test() {
@ -262,7 +262,7 @@ run_all_tests() {
# Launch all tests successively # Launch all tests successively
cat $TEST_CONTEXT/tests/*.json >> /proc/self/fd/3 cat $TEST_CONTEXT/tests/*.json >> /proc/self/fd/3
# Reset and create a fresh container to work with # Reset and create a fresh container to work with
check_lxd_setup check_lxd_setup
LXC_RESET LXC_RESET
@ -290,7 +290,7 @@ run_all_tests() {
# Print the final results of the tests # Print the final results of the tests
log_title "Tests summary" log_title "Tests summary"
python3 lib/analyze_test_results.py $TEST_CONTEXT 2>./results.json python3 lib/analyze_test_results.py $TEST_CONTEXT 2>./results.json
# Restore the started time for the timer # Restore the started time for the timer
@ -325,6 +325,13 @@ TEST_LAUNCHER () {
[ $? -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result [ $? -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 # 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) 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) # (we ignore this test for upgrade from older commits to avoid having to patch older commits for this)