]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/two-vol-test
Use new restore command args
[bacula/bacula] / regress / tests / two-vol-test
index 2192c86dae3b420dbb8031bd188fe51891d02aaa..d4795a5057c8abc973a482ea9e2c5806039ecffe 100755 (executable)
@@ -5,7 +5,7 @@
 #
 cwd=`pwd`
 scripts/copy-test-confs
-rm -rf tmp/TestVolume001 tmp/TestVolume002 tmp/bacula-restores
+scripts/cleanup
 echo "${cwd}/build" >/tmp/file-list
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables
@@ -14,12 +14,14 @@ bin/make_sqlite_tables
 echo " "
 echo " "
 echo " === Starting two-vol-test  ==="
+echo " === Starting two-vol-test  ===" >working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 @output /dev/null
 messages
+@output tmp/log1.out
 label storage=File1
 TestVolume001
 label storage=File1
@@ -28,7 +30,6 @@ update Volume=TestVolume001
 6
 3000000
 10
-@output
 run job=NightlySave storage=File1
 yes
 wait
@@ -36,24 +37,28 @@ messages
 @# 
 @# now do a restore
 @#
-restore where=${cwd}/tmp/bacula-restores
-5
-done
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current all
 yes
 wait
 messages
+@output
 quit
 END_OF_DATA
-bin/bacula stop
-diff -ur build  tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+bin/bacula stop 2>&1 >/dev/null
+grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
+rstat=$?
+diff -r build  tmp/bacula-restores${cwd}/build
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
-   echo "  ===== two-vol-test Bacula source failed!!! ===== "
-   echo "  ===== two-vol-test failed!!! ===== " >>test.out
+   echo "  !!!!! two-vol-test Bacula source failed!!! !!!!! "
+   echo "  !!!!! two-vol-test failed!!! !!!!! " >>test.out
    echo " "
 else
    echo "  ===== two-vol-test Bacula source OK ===== "
    echo "  ===== two-vol-test OK ===== " >>test.out
-   rm -rf tmp/bacula-restores tmp/TestVolume001 tmp/TestVolume002
+   scripts/cleanup
 fi