From: Eric Bollengier Date: Wed, 2 Sep 2020 12:59:39 +0000 (+0200) Subject: BEE Backport regress/tests/upgrade-to-full-test X-Git-Tag: Release-11.3.2~1271 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dff6376111dfded877314b9944c4d289f8f6708e;p=thirdparty%2Fbacula.git BEE Backport regress/tests/upgrade-to-full-test This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Tue Jul 21 10:28:13 2020 +0200 regress: Add copyright to regress scripts Author: Eric Bollengier Date: Thu Mar 28 10:04:17 2019 +0100 regress: Add test to check messages when upgrading to full --- diff --git a/regress/tests/upgrade-to-full-test b/regress/tests/upgrade-to-full-test new file mode 100755 index 0000000000..aa4f5d848a --- /dev/null +++ b/regress/tests/upgrade-to-full-test @@ -0,0 +1,87 @@ +#!/bin/sh +# +# Copyright (C) 2000-2020 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Run a simple backup of the Bacula build directory +# then do a couple of new jobs to see what bacula prints +# when upgrading a job +# +TestName="upgrade-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 + +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 +run job=$JobName yes +wait +messages +@$out $tmp/log2.out +@# Modify the fileset, should display a message with the fileset +@exec "sed -i s:build:build/po: $conf/bacula-dir.conf" +reload +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File1 + +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaxFullInterval', '2s', 'Job')" + +cat <$tmp/bconcmds +@$out $tmp/log3.out +reload +@sleep 3 +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +stop_bacula + +grep "No prior or suitable Full backup found in catalog." $tmp/log1.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR: The first job should display a message in $tmp/log1.out" + estat=1 +fi + +grep "No prior or suitable Full backup found in catalog for the current FileSet." $tmp/log2.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR: After the fileset modification, the message should be clear in $tmp/log2.out" + estat=2 +fi + +grep "Max Full Interval" $tmp/log3.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR: After Max Full Interval in $tmp/log3.out" + estat=3 +fi + + +end_test