]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/weird-files2-test
Update
[bacula/bacula] / regress / tests / weird-files2-test
index fe5a50c97275346afbed2b6347bde25ff1a9de6f..8e3b6eaa50cdb0826394d2b18a2097199d88fc29 100755 (executable)
@@ -3,12 +3,9 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-debug=0
-if test "$debug" -eq 1 ; then
-  out="tee"
-else
-  out="output"
-fi
+TestName="weird-files2-test"
+JobName=weird-files2
+. scripts/functions
 
 if test ! -d weird-files ; then
    echo " "
@@ -16,39 +13,34 @@ if test ! -d weird-files ; then
    exit 0
 fi
 cwd=`pwd`
-scripts/copy-test-confs
 scripts/cleanup
+scripts/copy-test-confs
 rm -rf weird-files2
 cp -Rp weird-files weird-files2
-echo "${cwd}/weird-files2" >/tmp/file-list
+echo "${cwd}/weird-files2" >${cwd}/tmp/file-list
+cd weird-files2
+#perl socket.pl     # we no longer restore sockets
+cd ..
 
-echo " "
-echo " "
-echo " === Starting weird-files2 test at `date +%R:%S` ==="
-echo " === Starting weird-file2 test at `date +%R:%S` ===" >>working/log
-echo " "
+change_jobname NightlySave $JobName
+start_test
 
-bin/testls weird-files2 >${cwd}/tmp/original
+bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original
 
 cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
 messages
 @$out tmp/log1.out
 label storage=File volume=TestVolume001
-run job=NightlySave yes
+run job=$JobName yes
 wait
 messages
 @$out
 quit
 END_OF_DATA
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
-scripts/check_for_zombie_jobs storage=File 
+
+run_bacula
+check_for_zombie_jobs storage=File 
 #
 # Now mess up the a hard link, and a soft link
 #
@@ -77,36 +69,15 @@ messages
 quit
 END_OF_DATA
 
-if test "$debug" -eq 1 ; then
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
-scripts/check_for_zombie_jobs storage=File 
-bin/bacula stop 2>&1 >/dev/null
+run_bconsole
+check_for_zombie_jobs storage=File 
+stop_bacula
+
 bin/testls weird-files2 >${cwd}/tmp/restored
-grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
+
+check_two_logs
 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Weird files2 test failed!!! !!!!! "
-   echo "  !!!!! Weird files2 test failed!!! !!!!! " >>test.out
-   if [ $bstat != 0 -o $rstat != 0 ] ; then
-      echo "  !!!!! Bad Job termination status     !!!!! "
-      echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
-   else
-      echo "  !!!!! Restored files differ          !!!!! "
-      echo "  !!!!! Restored files differ          !!!!! " >>test.out
-   fi
-   echo " "
-else
-   echo "  ===== Weird files2 test OK ===== "
-   echo "  ===== Weird files2 test OK ===== " >>test.out
-   cd ${cwd}
-   scripts/cleanup
-   rm -rf weird-files2
-fi
+#diff -u ${cwd}/tmp/original ${cwd}/tmp/restored
+dstat=$?
+
+end_test