From: Alain Spineux Date: Tue, 17 Nov 2020 08:28:09 +0000 (+0100) Subject: regress: skip unsuitable dedup test regarding the dedup driver X-Git-Tag: Release-11.3.2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58fe97126e67abd0e7a50ec9bd1ad21e856538fe;p=thirdparty%2Fbacula.git regress: skip unsuitable dedup test regarding the dedup driver - some test are incompatible with Legacy or Dedup2 drivers - use check_dedup_enable like in > check_dedup_enable # use default aka Legacy > check_dedup_enable Legacy > check_dedup_enable Dedup2 > check_dedup_enable Legacy Dedup2 # works on both --- diff --git a/regress/scripts/functions b/regress/scripts/functions index 0638036c3..c1d1b88ff 100755 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -851,14 +851,31 @@ die_early() # check_dedup_enable() { + dedup_drivers=${1:-Legacy} if [ "$FORCE_DEDUP" != "yes" ] ; then - print_debug "This test is dedicated to DEDUP, set variable FORCE_DEDUP to 'yes'" + echo "This test is dedicated to DEDUP, set variable FORCE_DEDUP to 'yes'" exit 0 fi if [ "$DEDUP_FS_OPTION" != "bothsides" -a "$DEDUP_FS_OPTION" != "storage" -a "$DEDUP_FS_OPTION" != "none" ] ; then - print_debug "variable DEDUP_FS_OPTION must be set to bothsides, storage or none" + echo "variable DEDUP_FS_OPTION must be set to bothsides, storage or none" exit 1 fi + if [ -n $dedup_drivers ] ; then + # a list of valid drivers for the test has been specified + # check if one match the active one + active_driver=${DEDUP_DRIVER=:-Legacy} + result="no" + for driver in $dedup_drivers ; do + if [ "$driver" = "$active_driver" ] ; then + result="ok" + break + fi + done + if [ $result != ok ] ; then + echo "This test is designed for dedup drivers: "$dedup_drivers", not $active_driver" + exit 0 + fi + fi } @@ -867,9 +884,9 @@ check_dedup_enable() # check_dedup_forced() { - check_dedup_enable + check_dedup_enable $* if [ "$DEDUP_FS_OPTION" = "none" ] ; then - print_debug "This test expect to see the DDE grow then DEDUP_FS_OPTION cannot be none" + echo "This test expect to see the DDE grow then DEDUP_FS_OPTION cannot be none" exit 0 fi }