X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Flib-test-root;h=54da62c7d459c72119abcf6d8e2afbb9c562b47b;hb=3222975c6bc9cb425a40ecabd2a866a4028cb3f9;hp=b44dd3c67d779b18c21526a633229345c976e196;hpb=b9bc1235ccf9addbe4587c6f3876556bb5507ef6;p=bacula%2Fbacula diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root index b44dd3c67d..54da62c7d4 100755 --- a/regress/tests/lib-test-root +++ b/regress/tests/lib-test-root @@ -3,32 +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 " ===== lib-test-root failed!!! ===== " - echo " ===== lib-test-root failed!!! ===== " >>test.out - echo " " - exit 1 -fi -cwd=`pwd` -scripts/copy-test-confs +TestName="lib-test-root" +. scripts/functions + +require_root + + scripts/cleanup -echo "/lib" >/tmp/file-list -bin/bacula stop 2>&1 >/dev/null -bin/drop_sqlite_tables -bin/make_sqlite_tables -echo " " -echo " " -echo " === Starting /lib save/restore test ===" -echo " " -echo " " -bin/bacula start 2>&1 >/dev/null -bin/console -c bin/console.conf <${cwd}/tmp/file-list + +start_test + +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out +@output ${cwd}/tmp/log1.out label storage=File TestVolume001 run job=NightlySave @@ -38,15 +28,24 @@ messages @# @# now do a restore @# -@output tmp/log2.out -restore where=${cwd}/tmp/bacula-restores current all +@output ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select +unmark * +mark * +done yes wait 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 @@ -60,12 +59,12 @@ sort <1 >restored rm -f 1 # cd ${cwd} -diff tmp/original tmp/restored 2>&1 1>/dev/nul +diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== lib-test-root failed!!! ===== " - echo " ===== lib-test-root failed!!! ===== " >>test.out + echo " ===== !!!! lib-test-root failed !!!! ===== " + echo " ===== !!!! lib-test-root failed !!!! ===== " >>test.out echo " " else echo " ===== lib-test-root OK ===== "