]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/aligned-and-normal-test
authorKern Sibbald <kern@sibbald.com>
Wed, 2 Sep 2020 13:03:26 +0000 (15:03 +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: Kern Sibbald <kern@sibbald.com>
Date:   Thu Nov 10 18:19:13 2016 +0100

    regress: tweak tests output

Author: Kern Sibbald <kern@sibbald.com>
Date:   Tue Aug 23 11:30:55 2016 +0200

    regress: Tweak aligned tests not compatible with cloud

Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Jun 16 20:44:27 2016 +0200

    Fix aligned tests not to try to make plugin

Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Jul 2 11:08:38 2016 +0200

    regress: add new/modified aligned volumes tests

Author: Alain Spineux <alain@baculasystems.com>
Date:   Mon Apr 7 15:08:12 2014 +0200

    Part 2 beginning dedup code

regress/tests/aligned-and-normal-test [new file with mode: 0755]

diff --git a/regress/tests/aligned-and-normal-test b/regress/tests/aligned-and-normal-test
new file mode 100755 (executable)
index 0000000..8d65390
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Test aligned data volumes 
+# A non-aligned backup is run on the same Volume at the same time.
+#
+#  This currently produces corrupted data volumes
+#
+TestName="aligned-and-normal-test"
+JobName=NightlySave
+. scripts/functions
+
+if test x$FORCE_CLOUD = xyes ; then
+   echo "\n=== Test $TestName skipped not compatible with Cloud  ==="
+   exit 0
+fi
+
+scripts/cleanup
+scripts/copy-test-confs
+cp scripts/aligned-bacula-sd.conf bin/bacula-sd.conf
+# uncomment for a big fileset
+#cp scripts/aligned-bacula-dir.conf bin/bacula-dir.conf
+
+# install the aligned volume plugin
+#make -C build/src/plugins/sd install-aligned-plugin >/dev/null
+
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label storage=File volume=Vol1
+label storage=File2 volume=Vol2
+@#label storage=File volume=Vol3
+@#setdebug level=100 storage=File
+@# Note, Create an aligned volume
+@#  Run Job 1 aligned job
+@#  Run Job 2 non-aligned job
+@#  Run Job 3 aligned jobs
+@#  Run Job 4 non-aligned job
+run job=$JobName level=Full yes
+run job=$JobName Storage=File2 level=Full yes
+run job=$JobName level=Full yes
+run job=$JobName Storage=File2 level=Full yes
+wait
+list volumes
+sql
+select * from JobMedia;
+
+messages
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@# 
+@# now restore last Job run
+@#
+@$out ${cwd}/tmp/log2.out
+@# setdebug level=0 fd
+restore where=${cwd}/tmp/bacula-restores
+5
+mark *
+done
+yes
+wait
+messages
+@# Now restore JobId=1
+restore where=${cwd}/tmp/bacula-restores
+3
+1
+mark *
+done
+yes
+wait
+@# Now restore JobId=2
+restore where=${cwd}/tmp/bacula-restores
+3
+2
+mark *
+done
+yes
+wait
+END_OF_DATA
+
+run_bconsole
+
+sleep 2
+check_for_zombie_jobs storage=File 
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test