X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fdev-test-root;h=838d5d1028b02323c2480e14d602f63ffb498b55;hb=8ee711f2e7b445b00de916f5712c59749afc2407;hp=99db4b6b4a7bda4674e01b9cb6060df1624f164b;hpb=4ee91493e376603836ad60ae78da1a0e603c9755;p=bacula%2Fbacula diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root index 99db4b6b4a..838d5d1028 100755 --- a/regress/tests/dev-test-root +++ b/regress/tests/dev-test-root @@ -3,64 +3,76 @@ # Run a simple backup of the Bacula build directory # then restore it. # -echo " " -echo " " -echo " === /dev save/restore test ===" -echo " " -echo " " -if [ $UID != 0 ] ; then - echo " " - echo "You must be root to run this test." - echo " ===== dev test failed!!! ===== " - echo " ===== dev test failed!!! ===== " >>test.out - echo " " - exit 1 -fi -cwd=`pwd` + +TestName="dev-test-root" +. scripts/functions + +require_root + +scripts/cleanup scripts/copy-test-confs -echo "/dev" >/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 +@$out /dev/null messages -label -TestVolume001 -run job=NightlySave -yes +@$out ${cwd}/tmp/log1.out +label storage=File volume=TestVolume001 +run job=NightlySave yes wait messages @# @# now do a restore @# -restore -5 -done +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all 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 dev >/tmp/original -cd /tmp/bacula-restores -${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >/tmp/restored -diff /tmp/original /tmp/restored +${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original +cd ${cwd}/tmp/bacula-restores +${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored +cd ${cwd}/tmp +# +# Use sed to cut out parts that *always* change +# +cat >sed.scr <1 +sed -f sed.scr 1 | sort >original +# +mv -f restored 1 +sed -f sed.scr 1 | sort >restored +rm -f sed.scr +# +cd ${cwd} +diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== dev test failed!!! ===== " - echo " ===== dev test failed!!! ===== " >>test.out + echo " ===== !!!! dev-test-root failed !!!! ===== " + echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out echo " " else - echo " ===== dev test OK ===== " - echo " ===== dev test OK ===== " >>test.out - rm -rf /tmp/bacula-restores /tmp/original /tmp/restored - rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001 + echo " ===== dev-test-root OK ===== " + echo " ===== dev-test-root OK ===== " >>test.out + scripts/cleanup fi