]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: modify copy-job-test to test fix for #9116
authorAlain Spineux <alain@baculasystems.com>
Thu, 12 May 2022 09:50:28 +0000 (11:50 +0200)
committerEric Bollengier <eric@baculasystems.com>
Fri, 27 May 2022 08:30:50 +0000 (10:30 +0200)
- add a dummy client with a FdStorageAddress and configure the copy-job
  with it.
- tweak restore and check_for_zombie_jobs to not complain about the
  new dummy client

regress/tests/copy-job-test

index 07e9c8d7fd643eb3156de0a99f75e0d4806798b9..164e39936dcc671d1e56ec1aa844827b35119415 100755 (executable)
@@ -36,6 +36,26 @@ sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
 change_jobname NightlySave $JobName
 
+if bin/true ; then
+   # add a dummy client for the copy-job to test for bug #9116
+   $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Client', 'dummy-fd', 'Job', 'copy-job')"
+   cat >> $conf/bacula-dir.conf <<EOF
+Client {
+  Name = dummy-fd
+  Address = 8.8.8.8
+  FDPort = 8102
+  FdStorageAddress = 8.8.8.8
+  Catalog = MyCatalog
+  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
+  File Retention = 30d                # 30 days
+  Job Retention = 180d                # six months
+  AutoPrune = yes                     # Prune expired Jobs/Files
+  Maximum Concurrent Jobs = 4
+}
+
+EOF
+fi
+
 SPOOLDATA_JOB=${SPOOLDATA_JOB:-default}
 if [ "$SPOOLDATA_JOB" = "yes" ] ; then
    $bperl -e "add_attribute('$conf/bacula-dir.conf', 'SpoolData', 'yes', 'Job', 'copy-job')"
@@ -124,7 +144,7 @@ list volumes
 @#setdebug level=150 storage=DiskChanger
 @# Note, here we are restoring from the original backup,
 @#  so if you specify storage=DiskChanger the restore will fail
-restore where=${cwd}/tmp/bacula-restores select
+restore client=$CLIENT where=${cwd}/tmp/bacula-restores select
 unmark *
 mark *
 done
@@ -136,7 +156,7 @@ quit
 END_OF_DATA
 
 run_bacula
-check_for_zombie_jobs storage=File
+check_for_zombie_jobs storage=File client=${CLIENT}
 stop_bacula
 
 check_two_logs