X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=regress%2Ftests%2Fweird-files2-test;h=16f9120d579317454a7100d67e079baf5dbd0473;hb=2ac141d960d9ee16a8f4dd09b9f3555dae634904;hp=709f3e06f0b58e70f4c65a8052e77e04d59c5a61;hpb=4d7816150054b723901790b7023d7524eb0f8e13;p=bacula%2Fbacula diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test index 709f3e06f0..16f9120d57 100755 --- a/regress/tests/weird-files2-test +++ b/regress/tests/weird-files2-test @@ -3,39 +3,44 @@ # Run a simple backup of the Bacula build directory # then restore it. # +TestName="weird-files2-test" +JobName=weird-files2 +. scripts/functions + if test ! -d weird-files ; then echo " " echo "weird files not configured. Test not run." exit 0 fi cwd=`pwd` -scripts/copy-test-confs scripts/cleanup +scripts/copy-test-confs rm -rf weird-files2 cp -Rp weird-files weird-files2 echo "${cwd}/weird-files2" >/tmp/file-list +cd weird-files2 +perl socket.pl +cd .. -echo " " -echo " " -echo " === Starting weird filenames2 test at `date +%R:%S` ===" -echo " === Starting weird filenames2 test at `date +%R:%S` ===" >>working/log -echo " " +change_jobname NightlySave $JobName +start_test -bin/testls weird-files2 >${cwd}/tmp/original -bin/bacula start -# bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original + +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out label storage=File volume=TestVolume001 -run job=NightlySave yes +run job=$JobName yes wait messages -@output +@$out quit END_OF_DATA -scripts/check_for_zombie_jobs storage=File + +run_bacula +check_for_zombie_jobs storage=File # # Now mess up the a hard link, and a soft link # @@ -45,13 +50,13 @@ ln hard-file3 hard-file2 rm -f soft-file2 ln -s soft-file3 soft-file2 cd ${cwd} -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages @# @# now do a restore @# -@output tmp/log2.out +@$out tmp/log2.out restore where= storage=File 5 unmark * @@ -60,34 +65,19 @@ done yes wait messages -@output +@$out quit END_OF_DATA -scripts/check_for_zombie_jobs storage=File -bin/bacula stop 2>&1 >/dev/null + +run_bconsole +check_for_zombie_jobs storage=File +stop_bacula + bin/testls weird-files2 >${cwd}/tmp/restored -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 ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! Weird files2 test failed!!! !!!!! " - echo " !!!!! Weird files2 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 " ===== Weird files2 test OK ===== " - echo " ===== Weird files2 test OK ===== " >>test.out - cd ${cwd} - scripts/cleanup - rm -rf weird-files2 -fi + +check_two_logs +#diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +diff ${cwd}/tmp/original ${cwd}/tmp/restored +dstat=$? + +end_test