X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Ffour-jobs-test;h=b13a3ddd930e20ecbcdea2a35625640d1eb22ca3;hb=e5ef682130f94d5afa513a28cea931bf55220884;hp=0dcfd1b8807f42404df948213bb0b79bf8b15d2c;hpb=746d82a8a9073a8f8093fa611d02cddc192f8936;p=bacula%2Fbacula diff --git a/regress/tests/four-jobs-test b/regress/tests/four-jobs-test index 0dcfd1b880..b13a3ddd93 100755 --- a/regress/tests/four-jobs-test +++ b/regress/tests/four-jobs-test @@ -4,47 +4,33 @@ # then backup four times, each with incremental then finally restore. # It should require at least 4 different bsrs. # -debug=0 -if test "$debug" -eq 1 ; then - out="tee" -else - out="output" -fi +TestName="four-jobs-test" +JobName=SpanVol +. scripts/functions -cwd=`pwd` -scripts/copy-test-confs scripts/cleanup -echo "${cwd}/build" >/tmp/file-list +scripts/copy-test-confs +echo "${cwd}/build" >${cwd}/tmp/file-list -echo " " -echo " " -echo " === Starting four-jobs-test at `date +%R:%S` ===" -echo " === Starting four-jobs-test at `date +%R:%S` ===" >>working/log -echo " " +change_jobname CompressedTest $JobName +start_test -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null -estimate job=CompressedTest listing -estimate job=CompressedTest listing -estimate job=CompressedTest listing +estimate job=$JobName listing +estimate job=$JobName +estimate job=$JobName messages -@$out tmp/log1.out +@$out ${cwd}/tmp/log1.out label storage=File volume=TestVolume001 -run job=CompressedTest yes +run job=$JobName yes wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi - -scripts/check_for_zombie_jobs storage=File +run_bacula +check_for_zombie_jobs storage=File echo "Backup 1 done" # make some files for the incremental to pick up touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o @@ -53,77 +39,62 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a second job # -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@$out tmp/log1.out -run job=CompressedTest -yes +@$out ${cwd}/tmp/log1.out +run job=$JobName yes wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bconsole +check_for_zombie_jobs storage=File -scripts/check_for_zombie_jobs storage=File echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a third job # -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out -label storage=File volume=TestVolume001 -run job=CompressedTest yes +@output ${cwd}/tmp/log1.out +run job=$JobName yes wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bconsole +check_for_zombie_jobs storage=File -scripts/check_for_zombie_jobs storage=File echo "Backup 3 done" # make some files for the incremental to pick up touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out -label storage=File volume=TestVolume001 -run job=CompressedTest yes +@output ${cwd}/tmp/log1.out +run job=$JobName yes wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bconsole +check_for_zombie_jobs storage=File -scripts/check_for_zombie_jobs storage=File echo "Backup 4 done" # # now do several restores to ensure we cleanup between jobs # -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null restore where=${cwd}/tmp/bacula-restores select all storage=File done yes @@ -131,7 +102,7 @@ wait restore where=${cwd}/tmp/bacula-restores select all storage=File done yes wait -@$out tmp/log2.out +@$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=File unmark * mark * @@ -143,34 +114,10 @@ messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bconsole +check_for_zombie_jobs storage=File +stop_bacula -scripts/check_for_zombie_jobs storage=File -bin/bacula stop 2>&1 >/dev/null -grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null -bstat=$? -grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null -rstat=$? -diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! four-jobs-test Bacula source failed!!! !!!!! " - echo " !!!!! four-jobs-test failed!!! !!!!! " >>test.out - if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " !!!!! Bad Job termination status !!!!! " - echo " !!!!! Bad Job termination status !!!!! " >>test.out - else - echo " !!!!! Restored files differ !!!!! " - echo " !!!!! Restored files differ !!!!! " >>test.out - fi - echo " " -else - echo " ===== four-jobs-test Bacula source OK `date +%R:%S` ===== " - echo " ===== four-jobs-test OK `date +%R:%S` ===== " >>test.out - scripts/cleanup -fi +check_two_logs +check_restore_diff +end_test