]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add check for new custom label format
authorEric Bollengier <eric@baculasystems.com>
Tue, 8 Aug 2023 15:45:01 +0000 (17:45 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:02 +0000 (13:57 +0200)
regress/tests/migration-job-test

index 728847fa16d595d185773882714f73c480c3752f..3e81094d05d0dde60e9227a65a9d9a2d417c6387 100755 (executable)
@@ -20,6 +20,10 @@ scripts/copy-migration-confs
 scripts/prepare-disk-changer
 echo "${cwd}/build" >${cwd}/tmp/file-list
 
+$bperl -e 'add_attribute("$conf/bacula-sd.conf", "LabelMedia", "yes", "Device")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "LabelFormat", "\"Vol\${JobId}_\${PriorJobId}_\${PriorJobName}\"", "Pool")'
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumVolumeJobs", "1", "Pool")'
+
 change_jobname NightlySave $JobName
 start_test
 
@@ -37,9 +41,9 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 messages
 @$out ${cwd}/tmp/log1.out
 setdebug level=000 storage=File
-label storage=File volume=FileVolume001 Pool=Default
-label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
-label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+@#label storage=File volume=FileVolume001 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 two jobs (both will be migrated)
 run job=$JobName yes
 run job=$JobName yes
@@ -88,6 +92,12 @@ run_bacula
 check_for_zombie_jobs storage=File
 stop_bacula
 
+grep "Vol5_1_MigrationJobSave" $tmp/log1.out > /dev/null
+if [ $? -ne 0 ]; then
+    print_debug "ERROR: Should find custom volume name"
+    estat=1
+fi
+
 check_two_logs
 check_restore_diff
 end_test