X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fetc-test-root;h=50a45f2cbf719fccbeb5e5b73b76118204add51a;hb=07daebd6aa15d60d16f8ce0ce00b2ecc63da8836;hp=b8ab1ac2ff84ca0e35f8e43c9dc2294395e4ca79;hpb=4ee91493e376603836ad60ae78da1a0e603c9755;p=bacula%2Fbacula diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root index b8ab1ac2ff..50a45f2cbf 100755 --- a/regress/tests/etc-test-root +++ b/regress/tests/etc-test-root @@ -3,31 +3,20 @@ # Run a simple backup of the Bacula build directory # then restore it. # -echo " " -echo " " -echo " === /etc save/restore test ===" -echo " " -echo " " -if [ $UID != 0 ] ; then - echo " " - echo "You must be root to run this test." - echo " ===== Test4 failed!!! ===== " - echo " ===== Test4 failed!!! ===== " >>test.out - echo " " - exit 1 -fi -cwd=`pwd` +TestName="etc-test-root" +. scripts/functions + +scripts/cleanup scripts/copy-test-confs -echo "/etc" >/tmp/file-list -rm -rf /tmp/TestVolume001 /tmp/bacula-restores -bin/bacula stop -bin/drop_sqlite_tables -bin/make_sqlite_tables -bin/bacula start -bin/console -c bin/console.conf <${cwd}/tmp/file-list + +start_test + +cat <${cwd}/tmp/bconcmds @output /dev/null messages -label +@output ${cwd}/tmp/log1.out +label storage=File TestVolume001 run job=NightlySave yes @@ -36,31 +25,41 @@ messages @# @# now do a restore @# -restore -5 +@output ${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 + +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 >/tmp/original -cd /tmp/bacula-restores -${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >/tmp/restored -diff /tmp/original /tmp/restored +${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1 +cd ${cwd}/tmp/bacula-restores +${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2 +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 ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== Test4 /etc failed!!! ===== " - echo " ===== Test4 failed!!! ===== " >>test.out + echo " ===== !!!! etc-test-root failed !!!! ===== " + echo " ===== !!!! etc-test-root failed !!!! ===== " >>test.out echo " " else - echo " ===== Test4 /etc OK ===== " - echo " ===== Test4 OK ===== " >>test.out - rm -rf /tmp/bacula-restores /tmp/original /tmp/restored - rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001 + echo " ===== etc-test-root OK ===== " + echo " ===== etc-test-root OK ===== " >>test.out + scripts/cleanup fi