From: Eric Bollengier Date: Tue, 30 Aug 2022 10:11:27 +0000 (+0200) Subject: regress: Add sigterm-bacula-test to reproduce org#2624 X-Git-Tag: Release-13.0.2~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f61e86a56eaab30c624112889c2c89d8d492d82;p=thirdparty%2Fbacula.git regress: Add sigterm-bacula-test to reproduce org#2624 --- diff --git a/regress/tests/sigterm-bacula-test b/regress/tests/sigterm-bacula-test new file mode 100755 index 000000000..66332bb38 --- /dev/null +++ b/regress/tests/sigterm-bacula-test @@ -0,0 +1,57 @@ +#!/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 send a TERM signal to see if FD is properly stopped +# +TestName="sigterm-bacula-test" +JobName=backup +. scripts/functions + +require_linux + +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 + +change_jobname BackupClient1 $JobName +start_test + +cat <$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 +setbandwidth limit=1000 client +run job=$JobName yes +@sleep 5 +messages +@exec "killall -TERM bacula-fd" +@sleep 2 +messages +quit +END_OF_DATA + +run_bacula + +ls -l $working/ | grep backtrace +if [ $? = 0 ]; then + print_debug "ERROR: Found backtrace file" + estat=1 +fi + +stop_bacula + +end_test