X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fetc-test-root;h=50a45f2cbf719fccbeb5e5b73b76118204add51a;hb=86e786f4fb2faf7c9487a0bf4633371cbb57b759;hp=e3a4495b88cf033391ac2171d2127b4b4b86f80c;hpb=00b2e2f4e4580254fdcd9a4f746faedd2c955386;p=bacula%2Fbacula diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root index e3a4495b88..50a45f2cbf 100755 --- a/regress/tests/etc-test-root +++ b/regress/tests/etc-test-root @@ -3,30 +3,19 @@ # 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 " ===== !!!! etc-test-root not run !!!! ===== " - echo " ===== !!!! etc-test-root not run !!!! ===== " >>test.out - echo " " - exit 1 -fi -echo " " -echo " " -echo " === Starting /etc save/restore test ===" -echo " " -echo " " -cwd=`pwd` +TestName="etc-test-root" +. scripts/functions + scripts/cleanup scripts/copy-test-confs -echo "/etc" >/tmp/file-list +echo "/etc" >${cwd}/tmp/file-list -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 @@ -36,7 +25,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@output ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select unmark * mark * @@ -47,7 +36,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 etc >${cwd}/tmp/1 cd ${cwd}/tmp/bacula-restores @@ -56,7 +51,7 @@ sort <${cwd}/tmp/1 >${cwd}/tmp/original sort <${cwd}/tmp/2 >${cwd}/tmp/restored rm -f ${cwd}/tmp/1 ${cwd}/tmp/2 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 " "