]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: volenc-mkey-test test master-key
authorAlain Spineux <alain@baculasystems.com>
Tue, 10 Jan 2023 17:19:47 +0000 (18:19 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
- basic test

regress/tests/volenc-mkey-test [new file with mode: 0755]

diff --git a/regress/tests/volenc-mkey-test b/regress/tests/volenc-mkey-test
new file mode 100755 (executable)
index 0000000..4c4fd02
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2000-2021 Kern Sibbald
+# Copyright (C) 2021-2022 Bacula Systems SA
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Test the masterkey feature of the volume encoding using gnupg
+#
+
+TestName="volenc-mkey-test"
+JobName=backup
+. scripts/functions
+
+if [ "$FORCE_VOLENC" != "yes" ]; then
+    echo "Test $TestName disabled because FORCE_VOLENC is not set"
+    exit 0
+fi
+
+scripts/cleanup
+scripts/copy-test-confs
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+$bin/install-key-manager.sh install
+
+sed -i 's/#*volume_regex=.*/volume_regex=TestVolume[0-9]+|Volume[0-9]+/' bin/key-manager.conf
+
+start_test
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@output /dev/null
+messages
+@$out $tmp/log1.out
+setdebug level=4 storage=File
+setdebug level=1 client
+label storage=File volume=TestVolume001
+run job=Simple yes
+wait
+messages
+@#
+@# now do a restore
+@#
+@$out $tmp/log2.out
+setdebug level=4 storage=File
+restore where=$tmp/bacula-restores select all done
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+check_two_logs
+check_restore_diff
+end_test