From: Alain Spineux Date: Wed, 23 Dec 2020 15:05:11 +0000 (+0100) Subject: regress: copy-job-test add option to force the copy to rehydrate the data X-Git-Tag: Release-11.0.1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c486e73d6c8464699aab1f14fa9282698e7deee1;p=thirdparty%2Fbacula.git regress: copy-job-test add option to force the copy to rehydrate the data - 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 ) --- diff --git a/regress/tests/copy-job-test b/regress/tests/copy-job-test index 2e2fb1103..49e7b1d65 100755 --- a/regress/tests/copy-job-test +++ b/regress/tests/copy-job-test @@ -14,6 +14,10 @@ # 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