X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fdev-test-root;h=0d005e56b7f0a21d970504406586f00152e9288f;hb=8677704f2830dc4973ab0eaef0066f7f44f06ccb;hp=a03287550f5e7df7f04a90c54fff83d2996ea30a;hpb=d1d0f449330ee1cde911271b061ca6c7d2b507c4;p=bacula%2Fbacula diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root index a03287550f..0d005e56b7 100755 --- a/regress/tests/dev-test-root +++ b/regress/tests/dev-test-root @@ -3,34 +3,22 @@ # Run a simple backup of the Bacula build directory # then restore it. # -MUID=`/usr/bin/id -u` -if [ $MUID != 0 ] ; then - echo " " - echo "You must be root to run this test." - echo " ===== !!!! dev-test-root not run !!!! ===== " - echo " ===== !!!! dev-test-root not run !!!! ===== " >>test.out - echo " " - exit 1 -fi -cwd=`pwd` -scripts/copy-test-confs + +TestName="dev-test-root" +. scripts/functions + +require_root + scripts/cleanup -echo "/dev" >/tmp/file-list +scripts/copy-test-confs +echo "/dev" >${cwd}/tmp/file-list -echo " " -echo " " -echo " === Starting dev-test-root test ===" -echo " " -echo " === Note, this test can fail for trivial ===" -echo " === reasons on non-Linux systems. ===" -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 volume=TestVolume001 run job=NightlySave yes wait @@ -38,7 +26,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@output ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select all done yes wait @@ -46,7 +34,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 needed below + cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores @@ -71,7 +65,7 @@ sed -f sed.scr 1 | sort >restored rm -f sed.scr # 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 " "