X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fweird-files2-test;h=8e3b6eaa50cdb0826394d2b18a2097199d88fc29;hb=414ee85d83197d4f61499f9542455695fa7da276;hp=35d03a4cb4db3250e4c96b5f3a73dd1d32c1edeb;hpb=0035cb51a290dea154c7b19324fa8aa8a0044150;p=bacula%2Fbacula diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test index 35d03a4cb4..8e3b6eaa50 100755 --- a/regress/tests/weird-files2-test +++ b/regress/tests/weird-files2-test @@ -3,43 +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 -bin/bacula stop 2>&1 >/dev/null -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null +echo "${cwd}/weird-files2" >${cwd}/tmp/file-list +cd weird-files2 +#perl socket.pl # we no longer restore sockets cd .. -echo " " -echo " " -echo " === Starting weird filenames2 test ===" -echo " === Starting weird filenames2 test ===" >>working/log -echo " " +change_jobname NightlySave $JobName +start_test -bin/testls weird-files2 >${cwd}/tmp/original -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <${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 + +run_bacula +check_for_zombie_jobs storage=File # # Now mess up the a hard link, and a soft link # @@ -49,39 +50,34 @@ ln hard-file3 hard-file2 rm -f soft-file2 ln -s soft-file3 soft-file2 cd ${cwd} -bin/bconsole -c bin/bconsole.conf <tmp/bconcmds +@$out /dev/null messages @# @# now do a restore @# -@output tmp/log2.out -restore where= +@$out tmp/log2.out +restore where= storage=File 5 +unmark * +mark * done yes wait messages -@output +@$out quit END_OF_DATA -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=$? + +check_two_logs 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 - echo " " -else - echo " ===== Weird files2 test OK ===== " - echo " ===== Weird files2 test OK ===== " >>test.out - cd ${cwd} - scripts/cleanup - rm -rf weird-files2 -fi +#diff -u ${cwd}/tmp/original ${cwd}/tmp/restored +dstat=$? + +end_test