X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Flib-test-root;h=54da62c7d459c72119abcf6d8e2afbb9c562b47b;hb=7db9b96e131be6ca1537a142d6af9fcd20a87848;hp=8431672408a885dadce2aca36d41208e8481ba52;hpb=5e79f485eb63398a928786a6b1a9e2defa2f666b;p=bacula%2Fbacula diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root index 8431672408..54da62c7d4 100755 --- a/regress/tests/lib-test-root +++ b/regress/tests/lib-test-root @@ -3,31 +3,22 @@ # Run a simple backup of the Bacula build directory # then restore it. # -MUID=`/usr/bin/id | awk -F= '{print $2}' | awk -F\( '{print $1}'` -if [ $MUID != 0 ] ; then - echo " " - echo "You must be root to run this test." - echo " ===== !!!! lib-test-root not run !!!! ===== " - echo " ===== !!!! lib-test-root not run !!!! ===== " >>test.out - echo " " - exit 1 -fi -cwd=`pwd` +TestName="lib-test-root" +. scripts/functions + +require_root + + scripts/cleanup scripts/copy-test-confs -echo "/lib" >/tmp/file-list +echo "/lib" >${cwd}/tmp/file-list -echo " " -echo " " -echo " === Starting /lib save/restore test ===" -echo " " -echo " " +start_test -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out +@output ${cwd}/tmp/log1.out label storage=File TestVolume001 run job=NightlySave @@ -37,7 +28,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@output ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select unmark * mark * @@ -48,7 +39,13 @@ messages @output quit END_OF_DATA -bin/bacula stop 2>&1 >/dev/null + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +# more cleanup to be done below + cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores @@ -62,7 +59,7 @@ sort <1 >restored rm -f 1 # cd ${cwd} -diff tmp/original tmp/restored 2>&1 1>/dev/null +diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " "