]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/backup-to-null-crc32
authorEric Bollengier <eric@baculasystems.com>
Wed, 2 Sep 2020 13:23:46 +0000 (15:23 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 1 Mar 2022 14:36:18 +0000 (15:36 +0100)
This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Tue Jul 21 10:28:13 2020 +0200

    regress: Add copyright to regress scripts

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Wed Jun 3 11:45:10 2015 +0200

    regress: Add test to test speed with crc32

regress/tests/backup-to-null-crc32 [new file with mode: 0755]

diff --git a/regress/tests/backup-to-null-crc32 b/regress/tests/backup-to-null-crc32
new file mode 100755 (executable)
index 0000000..dc862ec
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Run a simple backup of the Bacula build directory 
+#   to /dev/null Of course, it's not possible to restore ;-)
+#
+# Can be monitored with "perf top"
+# 
+TestName="backup-to-null-crc32"
+JobName=backuptonull
+
+
+. scripts/functions
+
+# Not compatible with a backup to /dev/null
+unset FORCE_DEDUP
+unset FORCE_ALIGNED
+export REGRESS_CHECK_CORRUPTION=no
+export CHECK_JOBMEDIA=0
+
+scripts/cleanup
+scripts/copy-fifo-confs
+
+echo "${cwd}/tmp/bigsparse" >${cwd}/tmp/file-list
+dd if=/dev/zero of=${cwd}/tmp/bigsparse count=1 bs=1024 seek=32914560
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "LabelFormat", "vol", "Pool")'
+$bperl -e 'add_attribute("$conf/bacula-fd.conf", "CommCompression", "no", "FileDaemon")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "SpoolData", "no", "Job")'
+
+# cut off MD5 signature, limiting factor on the FD
+sed -i s/signature=MD5// $conf/bacula-dir.conf
+
+change_jobname NightlySave $JobName
+rm -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out
+start_test
+
+# Write out bconsole commands
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log.out
+run level=full job=$JobName yes
+@sleep 5
+status storage=Dummy
+@sleep 5
+status client
+@sleep 5
+status client
+@sleep 5
+status client
+@sleep 5
+status client
+@sleep 5
+status client
+@sleep 5
+status client
+@sleep 5
+status client
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=Dummy
+stop_bacula
+
+mv $tmp/log.out $tmp/log1.out
+
+$bperl -e 'add_attribute("$conf/bacula-sd.conf", "BlockChecksum", "no", "Device")'
+
+run_bacula
+check_for_zombie_jobs storage=Dummy
+stop_bacula
+
+mv $tmp/log.out $tmp/log2.out
+
+grep "^  Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^  Termination: *Backup OK" ${cwd}/tmp/log2.out 2>&1 >/dev/null
+estat=$?
+
+echo "With crc32"
+grep "Rate:" ${cwd}/tmp/log1.out
+echo "Without crc32"
+grep "Rate:" ${cwd}/tmp/log2.out
+
+# not yet implemented
+dstat=0
+rstat=0
+zstat=0
+estat=0
+
+end_test