Whamcloud - gitweb
LU-15998 pcc: set hsm-root correctly during copytool setup 09/47909/3
authorQian Yingjin <qian@ddn.com>
Fri, 8 Jul 2022 02:59:36 +0000 (22:59 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Dec 2022 02:43:14 +0000 (02:43 +0000)
During copytool setup, we set --hsm-root with the archive root
path of $SINGLEAGT. However, when set --hsm-root explicitly via
"-h|--hsm-root", it should reset the hsm root with the specified
one. Otherwise, it will cuase sanity-pcc/test_3b failed.

Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Ida6c1ff7459548b068fd62ce315fe8075633b5fc
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47909
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/test-framework.sh

index 5144b23..f89fcfb 100755 (executable)
@@ -10474,11 +10474,10 @@ copytool()
        # Use default values
        local facet=$SINGLEAGT
        local mountpoint="${MOUNT2:-$MOUNT}"
-       local hsm_root="${hsm_root:-$(hsm_root "$facet")}"
 
        # Parse arguments
        local fail_on_error=true
-       local -a hsmtool_options=("--hsm-root=$hsm_root")
+       local -a hsmtool_options=()
        local -a action_options=()
 
        if [[ -n "$HSMTOOL_ARCHIVE_FORMAT" ]]; then
@@ -10505,7 +10504,7 @@ copytool()
                        ;;
                -h|--hsm-root)
                        shift
-                       hsm_root="$1"
+                       local hsm_root="$1"
                        ;;
                -b|--bwlimit)
                        shift
@@ -10522,6 +10521,9 @@ copytool()
                shift
        done
 
+       local hsm_root="${hsm_root:-$(hsm_root "$facet")}"
+       hsmtool_options+=("--hsm-root=$hsm_root")
+
        stack_trap "do_facet $facet rm -rf '$hsm_root'" EXIT
        do_facet $facet mkdir -p "$hsm_root" ||
                error "mkdir '$hsm_root' failed"