From: Alain Spineux Date: Fri, 25 Nov 2022 15:57:17 +0000 (+0100) Subject: regress: fix the 3 verify tests X-Git-Tag: Beta-15.0.0~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdd790899b06e019f147df626c787757867c3603;p=thirdparty%2Fbacula.git regress: fix the 3 verify tests - the estate was set before a stop_bacula/run_bacula, move the test at the end - the "!verified" was not set appropriately in the tests --- diff --git a/regress/tests/verify-cat-test b/regress/tests/verify-cat-test index 6adb6c3be..5c957f54a 100755 --- a/regress/tests/verify-cat-test +++ b/regress/tests/verify-cat-test @@ -22,6 +22,12 @@ echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName start_test +# enable the Verified message in the console +sed '/console =*/ s/, !verified//g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf +sed '/director =*/ s/, !verified//g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf + # Create list of files being backed up and verified to compare afterwards files_listing=${cwd}/tmp/files find ${cwd}/build -print > ${files_listing} @@ -46,37 +52,13 @@ quit END_OF_DATA run_bacula - sleep 2 check_for_zombie_jobs storage=File stop_bacula -while IFS= read -r line <&3; do - grep "Veryfying: ${line}" tmp/log1.out > /dev/null - if [ $? -ne 0 ]; then - estat=1 - print_debug "Did not found ${line} file in verified files log!" - print_debug "see: ${cwd}/tmp/log1.out" - fi - grep "Veryfying: ${line}" tmp/original > /dev/null - if [ $? -ne 0 ]; then - estat=1 - print_debug "Did not found ${line} file in verified files log!" - print_debug "see: ${cwd}/tmp/original" - fi -done 3< ${files_listing} - - -grep "^ Termination: *Verify OK" tmp/log1.out 2>&1 >/dev/null -bstat=$? -grep "^ Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null -rstat=$? -dstat=0 - # Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 mv $tmp/1 $conf/bacula-dir.conf - sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 mv $tmp/1 $conf/bacula-fd.conf @@ -99,19 +81,40 @@ run_bacula check_for_zombie_jobs storage=File stop_bacula +while IFS= read -r line <&3; do + grep "Veryfying: ${line}" tmp/log1.out > /dev/null + if [ $? -ne 0 ]; then + estat=1 + print_debug "Did not found ${line} file in verified files log!" + print_debug "see: ${cwd}/tmp/log1.out" + fi + grep "Veryfying: ${line}" tmp/original > /dev/null + if [ $? -ne 0 ]; then + estat=1 + print_debug "Did not found ${line} file in verified files log!" + print_debug "see: ${cwd}/tmp/original" + fi +done 3< ${files_listing} + + +grep "^ Termination: *Verify OK" tmp/log1.out 2>&1 >/dev/null +bstat=$? +grep "^ Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null +rstat=$? + while IFS= read -r line <&3; do grep "Veryfying: ${line}" tmp/log2.out > /dev/null if [ $? -eq 0 ]; then estat=1 print_debug "Found ${line} file in verified files log, no files should be listed now!" print_debug "see: ${cwd}/tmp/log2.out" + fi grep "Veryfying: ${line}" tmp/log3.out > /dev/null if [ $? -eq 0 ]; then estat=1 print_debug "Found ${line} file in verified files log, no files should be listed now!" print_debug "see: ${cwd}/tmp/log3.out" fi - fi done 3< ${files_listing} end_test diff --git a/regress/tests/verify-data-test b/regress/tests/verify-data-test index c37bb898b..2028d0b20 100755 --- a/regress/tests/verify-data-test +++ b/regress/tests/verify-data-test @@ -32,8 +32,14 @@ find ${cwd}/build/src/filed -print >> ${files_listing} change_jobname NightlySave $JobName start_test +# enable the Verified message in the console +sed '/console =*/ s/, !verified//g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf +sed '/director =*/ s/, !verified//g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf + if [ x$FORCE_VOLENC = xyes ]; then - # force the encryption to be NULL make the sed works + # force the encryption to be NULL to make the "sed" of the data work FORCE_CIPHER=NULL export FORCE_CIPHER fi @@ -89,15 +95,6 @@ run_bconsole stop_bacula -while IFS= read -r line <&3; do - grep "Veryfying: ${line}" tmp/log2.out > /dev/null - if [ $? -ne 0 ]; then - estat=1 - print_debug "Did not found ${line} file in verified files log!" - print_debug "see: ${cwd}/tmp/log2.out" - fi -done 3< ${files_listing} - $bperl -e 'add_attribute("$conf/bacula-sd.conf", "BlockChecksum", "no", "Device")' nbok=2 @@ -156,6 +153,14 @@ run_bacula check_for_zombie_jobs storage=File stop_bacula +while IFS= read -r line <&3; do + grep "Veryfying: ${line}" tmp/log2.out > /dev/null + if [ $? -ne 0 ]; then + estat=1 + print_debug "Did not found ${line} file in verified files log!" + print_debug "see: ${cwd}/tmp/log2.out" + fi +done 3< ${files_listing} while IFS= read -r line <&3; do grep "Veryfying: ${line}" tmp/log5.out > /dev/null diff --git a/regress/tests/verify-vol-test b/regress/tests/verify-vol-test index 19c5adfab..efaaa1437 100755 --- a/regress/tests/verify-vol-test +++ b/regress/tests/verify-vol-test @@ -30,8 +30,11 @@ start_test files_listing=${cwd}/tmp/files find ${cwd}/build -print > ${files_listing} -sed -i 's/, *!verified//g' bin/bacula-dir.conf -sed -i 's/, *!verified//g' bin/bacula-fd.conf +# enable the Verified message in the console +sed '/console =*/ s/, !verified//g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf +sed '/director =*/ s/, !verified//g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf cat <tmp/bconcmds @output /dev/null @@ -87,6 +90,39 @@ print_info() run_bacula + +check_for_zombie_jobs storage=File +stop_bacula + +# Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected +sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf +sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf + +cat <tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log5.out +reload +setdebug level=200 dir tags=sql trace=1 +run job=VerifyVolume yes +wait +messages +@$out ${cwd}/tmp/log6.out +run job=VerifyVolume level=DiskToCatalog jobid=1 +yes +wait +messages +@$out ${cwd}/tmp/log7.out +run job=VerifyDiskToCatalog yes +wait +messages +quit +END_OF_DATA + +run_bacula + while IFS= read -r line <&3; do grep "Veryfying: ${line}" tmp/log2.out > /dev/null if [ $? -ne 0 ]; then @@ -108,9 +144,6 @@ while IFS= read -r line <&3; do fi done 3< ${files_listing} -check_for_zombie_jobs storage=File -stop_bacula - grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null bstat=$? grep "^ Termination: *Verify OK" tmp/log2.out 2>&1 >/dev/null @@ -124,37 +157,6 @@ if [ $? != 0 ]; then print_info "ERROR: Verify job in error in $tmp/log4.out" rstat=1 fi -dstat=0 - -# Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected -sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 -mv $tmp/1 $conf/bacula-dir.conf - -sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 -mv $tmp/1 $conf/bacula-fd.conf - -cat <tmp/bconcmds -@output /dev/null -messages -@$out ${cwd}/tmp/log5.out -reload -setdebug level=200 dir tags=sql trace=1 -run job=VerifyVolume yes -wait -messages -@$out ${cwd}/tmp/log6.out -run job=VerifyVolume level=DiskToCatalog jobid=1 -yes -wait -messages -@$out ${cwd}/tmp/log7.out -run job=VerifyDiskToCatalog yes -wait -messages -quit -END_OF_DATA - -run_bacula while IFS= read -r line <&3; do grep "Veryfying: ${line}" tmp/log5.out > /dev/null