]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/dev-test-root
Make wait longer for better recycling
[bacula/bacula] / regress / tests / dev-test-root
index 194748ce18b04f22648b1f5861a402cb316a7e5b..838d5d1028b02323c2480e14d602f63ffb498b55 100755 (executable)
@@ -3,76 +3,76 @@
 # 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 "  ===== dev test failed!!! ===== "
-   echo "  ===== dev test failed!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
+
+TestName="dev-test-root"
+. scripts/functions
+
+require_root
+
 scripts/cleanup
-echo "/dev" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-echo " "
-echo " "
-echo " === Starting /dev save/restore test ==="
-echo " "
-echo " "
-bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
+scripts/copy-test-confs
+echo "/dev" >${cwd}/tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
 messages
-@output tmp/log1.out
-label storage=File
-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
 @#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores current all
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all 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 needed below
+
 cd /
 ${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 <<END_OF_DATA
 s%.*dev$%dev%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
 END_OF_DATA
-sed -f sed.scr original | sort >original
+
+# strip file system change messages then sed and sort
+grep -v "Skip: File system change prohibited." original >1
+sed -f sed.scr 1 | sort >original
 #
-sed -f sed.scr restored | sort >restored
+mv -f restored 1
+sed -f sed.scr 1 | sort >restored
 rm -f sed.scr
 #
 cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/null 2>&1 1>/dev/null
+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
+   echo "  ===== dev-test-root OK ===== "
+   echo "  ===== dev-test-root OK ===== " >>test.out
    scripts/cleanup
 fi