Whamcloud - gitweb
LU-12704 tests: component end must be multiple of stripesize 74/36174/3
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 12 Sep 2019 21:44:10 +0000 (15:44 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Oct 2019 03:44:36 +0000 (03:44 +0000)
In racer file_create.sh, it was generating a random multiple of 64KB
in [64K..1024K] for the stripe_size, but using a fixed 1MB component
end.  However, the component end must be a multiple of stripe_size,
or an error will be returned by "lfs setstripe":

  Invalid layout: component end must be aligned by the stripe size

Generate the component_end argument as a random multiple [1..8] of
the stripe size for PFL, DoM, and FLR files.

Fixes: 0b66b11523cb ("LU-3285 tests: add dom into racer test suite")
Test-Parameters: trivial testlist=racer
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib79131fc71d0eaa4a398cd8c8adf6e53473ebbe5
Reviewed-on: https://review.whamcloud.com/36174
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/racer/file_create.sh

index 2dba88a..f5fd90f 100755 (executable)
@@ -28,12 +28,13 @@ while /bin/true; do
 
        [ $stripecount -gt 0 ] && {
                stripesize=$(((RANDOM % 16 + 1) * 64))K
+               comp_end=$((${stripesize%K} * (RANDOM % 8 + 1)))K
                pattern=${layout[$RANDOM % ${#layout[*]}]}
 
                case $pattern in
                dom) opt="setstripe -E $stripesize -L mdt -E eof -c $stripecount -S 1M" ;;
-               pfl) opt="setstripe -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
-               flr) opt="mirror create -N2 -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
+               pfl) opt="setstripe -E $comp_end -S $stripesize -E eof -c $stripecount -S 2M" ;;
+               flr) opt="mirror create -N2 -E $comp_end -S $stripesize -E eof -c $stripecount -S 2M" ;;
                raid0) opt="setstripe -S $stripesize -c $stripecount" ;;
                esac