Whamcloud - gitweb
LU-14298 tests: fix sanity-sec test_44 for aarch64 client 46/41146/6
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 6 Jan 2021 10:13:56 +0000 (11:13 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 7 Jan 2021 14:38:55 +0000 (14:38 +0000)
PAGE_SIZE on aarch64 client is 64KB instead of 4KB, so sizes of IOs
performed in sanity-sec test_44 must be adapted.

Test-Parameters: testgroup=review-ldiskfs-arm env=ONLY=44 clientdistro=el8.3 serverdistro=el8.3
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I3764a75f6df871d71d751764627ed618bedf8e0b
Reviewed-on: https://review.whamcloud.com/41146
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-sec.sh

index 8b0900c..31a2f09 100755 (executable)
@@ -3199,6 +3199,7 @@ test_44() {
        local testfile=$DIR/$tdir/$tfile
        local tmpfile=$TMP/abc
        local resfile=$TMP/resfile
        local testfile=$DIR/$tdir/$tfile
        local tmpfile=$TMP/abc
        local resfile=$TMP/resfile
+       local pagesz=$(getconf PAGESIZE)
        local respage
 
        $LCTL get_param mdc.*.import | grep -q client_encryption ||
        local respage
 
        $LCTL get_param mdc.*.import | grep -q client_encryption ||
@@ -3215,8 +3216,8 @@ test_44() {
        setup_for_enc_tests
 
        $LFS setstripe -c1 -i0 $testfile
        setup_for_enc_tests
 
        $LFS setstripe -c1 -i0 $testfile
-       dd if=/dev/urandom of=$tmpfile bs=8192 count=1 conv=fsync
-       dd if=$tmpfile of=$testfile bs=8192 count=1 oflag=direct ||
+       dd if=/dev/urandom of=$tmpfile bs=$pagesz count=2 conv=fsync
+       dd if=$tmpfile of=$testfile bs=$pagesz count=2 oflag=direct ||
                error "could not write to file with O_DIRECT (1)"
 
        respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
                error "could not write to file with O_DIRECT (1)"
 
        respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
@@ -3225,7 +3226,7 @@ test_44() {
 
        cancel_lru_locks
 
 
        cancel_lru_locks
 
-       dd if=$testfile of=$resfile bs=8192 count=1 iflag=direct ||
+       dd if=$testfile of=$resfile bs=$pagesz count=2 iflag=direct ||
                error "could not read from file with O_DIRECT (1)"
 
        respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
                error "could not read from file with O_DIRECT (1)"
 
        respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
@@ -3237,13 +3238,13 @@ test_44() {
 
        rm -f $resfile
 
 
        rm -f $resfile
 
-       $TRUNCATE $tmpfile 4096
-       dd if=$tmpfile of=$testfile bs=4096 count=1 seek=13 oflag=direct ||
+       $TRUNCATE $tmpfile $pagesz
+       dd if=$tmpfile of=$testfile bs=$pagesz count=1 seek=13 oflag=direct ||
                error "could not write to file with O_DIRECT (2)"
 
        cancel_lru_locks
 
                error "could not write to file with O_DIRECT (2)"
 
        cancel_lru_locks
 
-       dd if=$testfile of=$resfile bs=4096 count=1 skip=13 iflag=direct ||
+       dd if=$testfile of=$resfile bs=$pagesz count=1 skip=13 iflag=direct ||
                error "could not read from file with O_DIRECT (2)"
        cmp -bl $tmpfile $resfile ||
                error "file $testfile is corrupted (2)"
                error "could not read from file with O_DIRECT (2)"
        cmp -bl $tmpfile $resfile ||
                error "file $testfile is corrupted (2)"
@@ -3251,12 +3252,12 @@ test_44() {
        rm -f $testfile $resfile
        $LFS setstripe -c1 -i0 $testfile
 
        rm -f $testfile $resfile
        $LFS setstripe -c1 -i0 $testfile
 
-       $TRUNCATE $tmpfile 2043
+       $TRUNCATE $tmpfile $((pagesz/2 - 5))
        cp $tmpfile $testfile
 
        cancel_lru_locks
 
        cp $tmpfile $testfile
 
        cancel_lru_locks
 
-       dd if=$testfile of=$resfile bs=4096 count=1 iflag=direct ||
+       dd if=$testfile of=$resfile bs=$pagesz count=1 iflag=direct ||
                error "could not read from file with O_DIRECT (3)"
        cmp -bl $tmpfile $resfile ||
                error "file $testfile is corrupted (3)"
                error "could not read from file with O_DIRECT (3)"
        cmp -bl $tmpfile $resfile ||
                error "file $testfile is corrupted (3)"