From: Sebastien Buisson Date: Tue, 5 Jan 2021 09:23:32 +0000 (+0100) Subject: LU-14281 tests: fix sanity-sec test_56 for ZFS X-Git-Tag: 2.14.0-RC1~30 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=98b7df0be162581a143bfd4e60ac921b5d0b7394 LU-14281 tests: fix sanity-sec test_56 for ZFS Skip sanity-sec test_56 in case of ZFS backend, as it does not support FIEMAP. Also simplify sanity-sec test_56, as all we care about is whether the "encrypted" flag is set at all. Fixes: 33322f3a2488 ("LU-14149 llite: fiemap set flags for encrypted files") Test-Parameters: trivial Test-Parameters: testlist=sanity-sec env=ONLY=56 clientdistro=el8.3 serverdistro=el8.3 fstype=ldiskfs Test-Parameters: testlist=sanity-sec env=ONLY=56 clientdistro=el8.3 serverdistro=el8.3 fstype=zfs Signed-off-by: Sebastien Buisson Change-Id: I69125d3e06acb89dbda421e573d18a2c22beac37 Reviewed-on: https://review.whamcloud.com/41130 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Nunez --- diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 31a2f09..160f186 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -4147,6 +4147,8 @@ run_test 55 "access with seteuid" test_56() { local testfile=$DIR/$tdir/$tfile + [[ $(facet_fstype ost1) == zfs ]] && skip "skip ZFS backend" + $LCTL get_param mdc.*.import | grep -q client_encryption || skip "client encryption not supported" @@ -4158,12 +4160,12 @@ test_56() { stack_trap cleanup_for_enc_tests EXIT setup_for_enc_tests - $LFS setstripe -c2 -i0 -S 1M $testfile + $LFS setstripe -c1 $testfile dd if=/dev/urandom of=$testfile bs=1M count=3 conv=fsync filefrag -v $testfile || error "filefrag $testfile failed" - (( $(filefrag -v $testfile | grep -c encrypted) >= 2 )) || + (( $(filefrag -v $testfile | grep -c encrypted) >= 1 )) || error "filefrag $testfile does not show encrypted flag" - (( $(filefrag -v $testfile | grep -c encoded) >= 2 )) || + (( $(filefrag -v $testfile | grep -c encoded) >= 1 )) || error "filefrag $testfile does not show encoded flag" } run_test 56 "FIEMAP on encrypted file"