From: Michal Rakowski Date: Mon, 30 Aug 2021 08:57:07 +0000 (+0200) Subject: regress: add store-mngr-many-read-devs-test X-Git-Tag: Release-11.3.2~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0044765e04c052c1057b4fb269d95f40feddb0dc;p=thirdparty%2Fbacula.git regress: add store-mngr-many-read-devs-test --- diff --git a/regress/tests/store-mngr-many-read-devs-test b/regress/tests/store-mngr-many-read-devs-test new file mode 100755 index 000000000..913539de6 --- /dev/null +++ b/regress/tests/store-mngr-many-read-devs-test @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Copyright (C) 2000-2021 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Test for #8098 +# Run MAC job with 'Pool' defined with many read storages defined. + +# +TestName="store-mngr-many-read-devs-test" +JobName=MigrationJobSave +. scripts/functions + +scripts/cleanup +scripts/copy-migration-confs +echo "${cwd}/build" >${cwd}/tmp/file-list + +change_jobname NightlySave $JobName +start_test + +# We first backup into Pool Default, +# then Migrate into Pool Full. +# Pool Default uses Storage=File,DiskChanger +# Pool Full uses Storage=File + +# Add 'DiskChanger' device for the 'read' pool to be the second Storage in the group +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Storage" , "File,DiskChanger", "Pool", "Default")' + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log1.out +label storage=File volume=FileVolume001 Pool=Full +label storage=File volume=FileVolume002 Pool=Default +label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 +label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 +run job=$JobName yes +wait +messages +@$out $tmp/log2.out +run job=migrate-job yes +wait +messages +@$out $tmp/log3.out +run job=migrate-job yes +wait +messages +quit +END_OF_DATA + +run_bacula + +# Check if first migration job succeeded +n=`grep "Migration OK" $tmp/log2.out | wc -l` +if [ ${n} -ne 1 ]; then + estat=1 + print_debug "ERROR: Migration job failed, see $tmp/log2.out" +fi + +# Second migration job should do nothing, proper result should be printed +n=`grep "Migration -- no files to migrate" $tmp/log3.out | wc -l` +if [ ${n} -ne 1 ]; then + estat=1 + print_debug "ERROR: Incorrect migration job status, see $tmp/log3.out" +fi + +check_for_zombie_jobs storage=File +stop_bacula + +end_test