]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add two-client-test to reproduce issue with Restore/Backup Client menu
authorEric Bollengier <eric@baculasystems.com>
Wed, 29 Jun 2022 17:01:56 +0000 (19:01 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
regress/tests/two-client-test [new file with mode: 0755]

diff --git a/regress/tests/two-client-test b/regress/tests/two-client-test
new file mode 100755 (executable)
index 0000000..a26cbce
--- /dev/null
@@ -0,0 +1,75 @@
+#!/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
+#
+# Run a simple backup of the Bacula build directory
+#   then restore it to the second client
+#
+TestName="two-client-test"
+JobName=backup
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-confs
+
+#
+# Zap out any schedule in default conf file so that
+#  it doesn't start during our test
+#
+outf="$tmp/sed_tmp"
+echo "s%  Schedule =%# Schedule =%g" >${outf}
+cp $scripts/bacula-dir.conf $tmp/1
+sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
+
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Client", "1-fd", "JobDefs")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Client", "1-fd", "Job")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Name", "1-fd", "Client")'
+$bperl -e 'extract_resource("$conf/bacula-dir.conf", "Client")' > $tmp/1
+$bperl -e 'add_attribute("$tmp/1", "Name", "2-fd", "Client")'
+cat $tmp/1 >> $conf/bacula-dir.conf
+
+change_jobname BackupClient1 $JobName
+start_test
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@output /dev/null
+messages
+@$out $tmp/log1.out
+setdebug level=4 storage=File1
+label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
+run job=$JobName client=1-fd yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out $tmp/log2.out  
+setdebug level=4 storage=File1
+restore where=$tmp/bacula-restores jobid=1 all done
+1
+yes
+wait
+messages
+restore where=$tmp/bacula-restores2 jobid=1 client=1-fd restoreclient=2-fd select all done
+yes
+wait
+messages
+restore where=$tmp/bacula-restores3 jobid=1 client=1-fd all done
+mod
+5
+2
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File1
+stop_bacula
+
+check_two_logs
+#check_restore_diff
+end_test