]> git.sur5r.net Git - bacula/bacula/commitdiff
Add restore replace=never test ticket 2317
authorKern Sibbald <kern@sibbald.com>
Wed, 12 Jan 2011 14:14:08 +0000 (15:14 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:49 +0000 (14:39 +0200)
regress/tests/restore-replace-never-test [new file with mode: 0755]

diff --git a/regress/tests/restore-replace-never-test b/regress/tests/restore-replace-never-test
new file mode 100755 (executable)
index 0000000..d5542ce
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory using the compressed option
+#   then restore it.
+#
+
+TestName="restore-replace-never"
+JobName=restore-replace-never
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+mkdir -p ${cwd}/tmp/dir/dir1
+touch ${cwd}/tmp/dir/dir1/file1
+touch ${cwd}/tmp/dir/dir1/file2
+echo ${cwd}/tmp/dir >${cwd}/tmp/file-list
+
+stat ${cwd}/tmp/dir                >${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1          >>${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1/file1    >>${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1/file2    >>${cwd}/tmp/1
+# Strip Change: lines
+grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-before
+
+change_jobname CompressedTest $JobName
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label storage=File volume=TestVolume001
+run job=$JobName yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+rm -rf ${cwd}/tmp/dir
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log2.out
+restore where=/ storage=File replace=never select all done yes
+@#restore where=/ storage=File select all done yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+stat ${cwd}/tmp/dir                >${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1          >>${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1/file1    >>${cwd}/tmp/1
+stat ${cwd}/tmp/dir/dir1/file2    >>${cwd}/tmp/1
+# Strip Change: lines
+grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-after
+
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+if test "$debug" -eq 1 ; then
+  diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after
+else
+  diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after 2>&1 >/dev/null
+fi
+if [ $? != 0 ]; then
+  dstat=1
+fi
+end_test