]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: copy-job-test add option to force the copy to rehydrate the data
authorAlain Spineux <alain@baculasystems.com>
Wed, 23 Dec 2020 15:05:11 +0000 (16:05 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 4 Feb 2021 14:52:43 +0000 (15:52 +0100)
- only available if FORCE_DEDUP = 1
- set XPARAM NEXT_NODEDUP to yes to change the target device of the copy
  job to a "File" device and force the copy job to do the rehydration
  ( just notice that the restore at the end also do the rehydration )

regress/tests/copy-job-test

index 2e2fb11036360534bb41641c00aa900f77d38ff0..49e7b1d650ce51f9f5ae633285c4c7d941d9e0bd 100755 (executable)
 # XPARAM SPOOLDATA_RUN=(default|yes|no)
 # enable spooldata=(yes|no) in the run command or let the default,
 # don't specify the spooldata option in the run command
+# XPARAM NEXT_NODEDUP=(default|yes|no)
+# if dedup is enable and NEXT_NODEDUP=yes, then change the
+# target device of the copy job to a normal device (not a dedup one)
+# this force the copy job to rehydrate the data
 #
 # use it this way
 # ( for run in default no yes ; do for job in default no yes ; do SPOOLDATA_RUN=$run \
@@ -50,10 +54,19 @@ else
    run_spooldata=""
 fi
 
-echo === SETUP === SPOOLDATA_JOB=$SPOOLDATA_JOB SPOOLDATA_RUN=$SPOOLDATA_RUN
-
 start_test
 
+NEXT_NODEDUP=${NEXT_NODEDUP:-default}
+if [ "$NEXT_NODEDUP" = "yes" -a "$FORCE_DEDUP" = 1 ] ; then
+   $bperl -e "add_attribute('$conf/bacula-sd.conf', 'Device Type', 'File', 'Device', 'Drive-0')"
+elif [ "$NEXT_NODEDUP" = "no" -a "$FORCE_DEDUP" = 1 ] ; then
+   /bin/true # don't change anything
+elif [ "$FORCE_DEDUP" = 1 ] ; then
+   /bin/true # don't change anything
+fi
+
+echo === SETUP === SPOOLDATA_JOB=$SPOOLDATA_JOB SPOOLDATA_RUN=$SPOOLDATA_RUN NEXT_NODEDUP=$NEXT_NODEDUP
+
 #
 # Note, we first backup into Pool Default, 
 #          then Copy into Pool Full. 
@@ -80,6 +93,7 @@ list volumes
 @# should copy two jobs
 @#setdebug level=51 storage=DiskChanger
 @#setdebug level=100 storage=File tags=dedup,asx,network options=h
+dedup rehydra_check_hash=1
 run job=copy-job $run_spooldata yes
 wait
 messages