]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/reload-status-test
authorEric Bollengier <eric@baculasystems.com>
Wed, 2 Sep 2020 13:32:03 +0000 (15:32 +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:   Tue Jul 17 10:32:25 2018 +0200

    regress: Add reload-status-test

regress/tests/reload-status-test [new file with mode: 0755]

diff --git a/regress/tests/reload-status-test b/regress/tests/reload-status-test
new file mode 100755 (executable)
index 0000000..38181c2
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+# Do a reload while a job is running and test the status storage command
+TestName="reload-status-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", "MaximumReloadRequests", "40", "Director")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "CommCompression", "no", "Director")'
+$bperl -e 'add_attribute("$conf/bacula-fd.conf", "CommCompression", "no", "FileDaemon")'
+
+echo "echo setbandwidth limit=10mb/s client | $bin/bconsole"  > $tmp/cmd
+echo "echo wait | $bin/bconsole"  >> $tmp/cmd
+chmod +x $tmp/cmd
+
+change_jobname BackupClient1 $JobName
+start_test
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@$out /dev/null
+messages
+@$out $tmp/log1.out
+setdebug level=100 trace=1 options=t dir
+label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
+setbandwidth limit="3000kb/s" client
+run job=$JobName yes
+@sleep 2
+reload
+quit
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@$out $tmp/log1.out
+status storage jobid=1
+status storage=File1
+status storage select
+1
+status storage job=$JobName
+@sleep 2
+@exec "sh $tmp/cmd"
+@sleep 5
+status dir
+wait
+messages
+END_OF_DATA
+
+run_bconsole
+
+check_for_zombie_jobs storage=File1
+stop_bacula
+
+nb=`grep "Writing: Full Backup job backup JobId=1" $tmp/log1.out | wc -l`
+if [ $nb != 4 ]; then
+    print_debug "ERROR: Got a problem with a status storage command"
+    estat=1
+fi
+
+touch $tmp/log2.out
+check_two_logs
+
+end_test