X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Flib-test-root;h=48067b2557f151b423d03d234ae4963145ef381f;hb=ade07b7afd278f819fbef347bd643c3328de54cb;hp=43aeb12edafe5153601bea5c0ffc4598a41ce8ab;hpb=e0bdd8f0b9b7c7c33f146432e37f7aedbb3cb2b1;p=bacula%2Fbacula diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root index 43aeb12eda..48067b2557 100755 --- a/regress/tests/lib-test-root +++ b/regress/tests/lib-test-root @@ -3,30 +3,22 @@ # Run a simple backup of the Bacula build directory # then restore it. # -echo " " -echo " " -echo " === /lib save/restore test ===" -echo " " -echo " " -if [ $UID != 0 ] ; then - echo " " - echo "You must be root to run this test." - echo " ===== Test5 failed!!! ===== " - echo " ===== Test5 failed!!! ===== " >>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 -rm -rf /tmp/TestVolume001 /tmp/bacula-restores -bin/bacula stop 2>&1 >/dev/null -bin/drop_sqlite_tables -bin/make_sqlite_tables -bin/bacula start 2>&1 >/dev/null -bin/console -c bin/console.conf <${cwd}/tmp/file-list + +start_test + +cat <${cwd}/tmp/bconcmds +@$out /dev/null messages +@$out ${cwd}/tmp/log1.out label storage=File TestVolume001 run job=NightlySave @@ -36,31 +28,45 @@ messages @# @# now do a restore @# -restore -5 +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select +unmark * +mark * done yes -@sleep 1 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 /tmp/bacula-restores +cd ${cwd}/tmp/bacula-restores ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored -diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +cd ${cwd}/tmp +sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1 +sort <1 >original +# +sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1 +sort <1 >restored +rm -f 1 +# +cd ${cwd} +diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== Test5 /lib failed!!! ===== " - echo " ===== Test5 failed!!! ===== " >>test.out + echo " ===== !!!! lib-test-root failed !!!! ===== " + echo " ===== !!!! lib-test-root failed !!!! ===== " >>test.out echo " " else - echo " ===== Test5 /lib OK ===== " - echo " ===== Test5 OK ===== " >>test.out - cd ${cwd} + echo " ===== lib-test-root OK ===== " + echo " ===== lib-test-root OK ===== " >>test.out scripts/cleanup fi