From: Eric Bollengier Date: Wed, 2 Sep 2020 13:33:31 +0000 (+0200) Subject: BEE Backport regress/tests/shared-storage-test X-Git-Tag: Release-11.3.2~1165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecfb8bfa34d4778f05c27bdb1416cede71316f01;p=thirdparty%2Fbacula.git BEE Backport regress/tests/shared-storage-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: Kern Sibbald Date: Tue Oct 23 18:52:29 2012 +0200 Drop previous regression test output Author: Eric Bollengier Date: Mon Feb 27 18:30:19 2012 +0100 regress: Add test for new shared storage directive --- diff --git a/regress/tests/shared-storage-test b/regress/tests/shared-storage-test new file mode 100755 index 0000000000..928cbf5a85 --- /dev/null +++ b/regress/tests/shared-storage-test @@ -0,0 +1,107 @@ +#!/bin/sh +# +# Copyright (C) 2000-2020 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Run backups with dummy tape driver +# This test setups an Autochanger with 80 slots +# and 5 drives (3 LTO3 and 2 LTO1) +# +# USE_VTAPE=yes + + +TestName="shared-storage-test" +JobName=backup +. scripts/functions + +require_vtape + +scripts/cleanup +scripts/copy-tape-confs +cp $rscripts/bacula-dir-vtape.conf $conf/bacula-dir.conf +cp $rscripts/bacula-sd-vtape.conf $conf/bacula-sd.conf +scripts/prepare-fake-autochanger + +echo "${cwd}/build/po" >${cwd}/tmp/file-list + +# change SharedStorage from yes to no to test the regular env +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'SharedStorage', 'no', 'Director')" + +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaxWaitTime', '10sec', 'Job')" + +start_test + +clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf` + +# Catalog record for cleaning tape "CLN01" successfully created. +# CLN01 | Cleaning + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output /dev/null +setdebug level=50 dir trace=1 +messages +@$out $tmp/log6.out +@#setdebug level=200 storage=LTO1 +label barcodes pool=Scratch slots=1-4 storage=LTO3 drive=0 +yes +messages +list volumes +@$out ${cwd}/tmp/log1.out +run storage=LTO3_0 job=NightlySave pool=Inc yes +run storage=LTO3_0 job=NightlySave2 pool=Full yes +run storage=LTO3_0 job=NightlySave1 pool=Default yes +wait +messages +quit +END_OF_DATA + +run_bacula + +# test update slots +# remove volume vol1 from autochanger +grep -v vol1 $working/ach/barcodes > $tmp/1 +cp $tmp/1 $working/ach/barcodes +mv $working/ach/slot1 $working/ach/slot1.dis + +# With SharedStorage=yes it will use vol4, with SharedStorage=no, it will ask +# to load vol1 and fail + +cat <${cwd}/tmp/bconcmds +@$out $tmp/log3.out +update slots=1-4 storage=LTO3 drive=0 +llist volumes=vol1 +@$out $tmp/log4.out +update slots=1-4 storage=LTO3_0 drive=0 +llist volumes=vol1 +@$out $tmp/log1.out +run storage=LTO3_1 job=NightlySave pool=Inc yes +run storage=LTO3_1 job=NightlySave2 pool=Full yes +run storage=LTO3_1 job=NightlySave1 pool=Default yes +wait +messages +quit +END_OF_DATA + +touch $tmp/log2.out + +run_bconsole +check_for_zombie_jobs storage=LTO3 client=$clientname + +stop_bacula + +check_two_logs + +grep "inchanger: 0" $tmp/log3.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR bad inchanger status after update slots" + # show the update slots bug +fi + +grep "inchanger: 0" $tmp/log4.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR bad inchanger status after update slots" + estat=1 +fi + +end_test