]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new verify data test
authorEric Bollengier <eric@baculasystems.com>
Fri, 18 Dec 2015 10:38:54 +0000 (11:38 +0100)
committerKern Sibbald <kern@sibbald.com>
Fri, 18 Dec 2015 10:38:54 +0000 (11:38 +0100)
regress/all-dev-tests
regress/all-disk-tests
regress/scripts/new-test-bacula-dir.conf.in
regress/tests/verify-data-test [new file with mode: 0644]

index f787e590f67bbbea5bf62f77aa2412b8b85bb4a4..32e07b2def05787b9ac743d98c10b5e355f11291 100755 (executable)
@@ -46,6 +46,7 @@ rm -f dumps/*
 ./run tests/strip-test
 ./run tests/sqlite-test
 ./run tests/two-vol-test
+./run tests/verify-data-test
 ./run tests/verify-vol-test
 ./run tests/weird-files2-test
 ./run tests/weird-files-test
index 4d467f2e7a8a21ff1e432471d03c5da99b33fcf2..fd1b94e345e34da91b44c217824c4b6c60e7cec7 100755 (executable)
@@ -76,6 +76,7 @@ rm -f dumps/*
 ./run tests/strip-test
 ./run tests/two-jobs-test
 ./run tests/two-vol-test
+./run tests/verify-data-test
 ./run tests/verify-cat-test
 ./run tests/verify-vol-test
 ./run tests/verify-voltocat-test
index 7ecb324b59f88bd92ee0481db4dbaaed780e74ff..c389f9f0a026cf62d4630e569b711fa79908810a 100644 (file)
@@ -104,6 +104,19 @@ Job {
   Max Run Time = 30min
 }
 
+Job {
+  Name = "VerifyData"
+  Type = Verify
+  Level = Data
+  Client=@hostname@-fd 
+  FileSet="Full Set"
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Write Bootstrap = "@working_dir@/NightlySave.bsr"
+  Max Run Time = 30min
+}
+
 
 Job {
   Name = "SparseTest"
@@ -286,6 +299,94 @@ FileSet {
   }
 }
 
+FileSet {
+  Name = "FSno5"
+  Include  { Options { verify=s5 }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { compression=GZIP }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { compression=LZO }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { compression=LZO; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { compression=GZIP; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+}
+
+FileSet {
+  Name = "FS5"
+  Include  { Options { signature=MD5; verify=s5 }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=GZIP }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=LZO }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=LZO; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=GZIP; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+}
+
+FileSet {
+  Name = "FS5nocheck"
+  Include  { Options { verify="nog"; signature=MD5 }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=GZIP }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=LZO }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=LZO; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=MD5; compression=GZIP; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+}
+
+FileSet {
+  Name = "FS1"
+  Include  { Options { verify=s1; signature=SHA1 }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=SHA1; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=SHA1; compression=GZIP }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=SHA1; compression=LZO }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=SHA1; compression=LZO; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+  Include  { Options { signature=SHA1; compression=GZIP; sparse=yes }
+    File = <@tmpdir@/file-list
+  }
+}
+
 FileSet {
   Name = "SimpleSet"
   Include {  
diff --git a/regress/tests/verify-data-test b/regress/tests/verify-data-test
new file mode 100644 (file)
index 0000000..712073f
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+#
+# Run a simple backup of the Bacula build directory
+#   then verify the data on the volume.           
+#
+TestName="verify-data-test"
+JobName=VerifyVol
+. scripts/functions
+
+cwd=`pwd`
+scripts/cleanup
+scripts/copy-test-confs
+echo "${cwd}/tmp/files" >$tmp/file-list
+echo "${cwd}/build/src/dird"      >>$tmp/file-list
+echo "${cwd}/build/src/filed"     >>$tmp/file-list
+
+#
+# Add this back when verify can handle sparse files
+#  the same way that backup does
+#
+mkdir -p $tmp/files
+dd if=${cwd}/build/configure of=$tmp/files/sparsefile bs=1 count=1 seek=10M > /dev/null
+
+change_jobname NightlySave $JobName
+start_test
+
+cat <<END_OF_DATA >tmp/bconcmds
+@output /dev/null
+messages
+@$out tmp/log1.out
+label storage=File volume=TestVolume001
+run job=$JobName level=full fileset=FS1 yes
+run job=$JobName level=full fileset=FS5 yes
+run job=$JobName level=full fileset=FSno5 yes
+run job=$JobName level=full fileset=FS5nocheck yes
+wait
+messages
+@# 
+@# now do a verify volume
+@#
+@$out ${cwd}/tmp/log2.out
+setdebug level=10 client
+run job=VerifyData jobid=1 yes
+run job=VerifyData jobid=2 yes
+run job=VerifyData jobid=3 yes
+run job=VerifyData jobid=4 yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+sleep 2
+check_for_zombie_jobs storage=File 
+stop_bacula
+
+$bperl -e 'add_attribute("$conf/bacula-sd.conf", "BlockChecksum", "no", "Device")'
+
+nbok=2
+if [ x$FORCE_DEDUP = xyes ]; then
+    nbok=4
+elif [ x$FORCE_ALIGNED = xyes ]; then
+    sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001.add
+else
+    sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001
+fi
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out tmp/log3.out
+@# 
+@# now do a verify volume with errors
+@#
+@$out ${cwd}/tmp/log3.out
+setdebug level=10 client
+run job=VerifyData jobid=1 yes
+run job=VerifyData jobid=2 yes
+run job=VerifyData jobid=3 yes
+run job=VerifyData jobid=4 yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+sleep 2
+check_for_zombie_jobs storage=File
+stop_bacula
+
+nb=`grep "^  Termination: *Backup OK" tmp/log1.out | wc -l`
+if [ $nb -ne 4 ]; then
+    bstat=1
+fi
+nb=`grep "^  Termination: *Verify OK" tmp/log2.out | wc -l`
+if [ $nb -ne 4 ]; then
+    rstat=1
+fi
+nb=`grep "^  Termination: *Verify OK" tmp/log3.out | wc -l`
+if [ $nb -ne $nbok ]; then
+    rstat=2
+fi
+dstat=0
+end_test