Whamcloud - gitweb
LU-16082 ldiskfs: Large EA upgrade test 50/48350/11
authorAlexander Zarochentsev <alexander.zarochentsev@hpe.com>
Sat, 20 Aug 2022 11:34:25 +0000 (14:34 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 13 Jan 2023 07:16:57 +0000 (07:16 +0000)
Check whether old Lustre-only ea inodes
are accessible under new ext4 versions;
additional fixes for 32newtarball test
to work with dm-flakey devices;
32newtarball now creates ldiskfs fs with
ea_inode fs feature enabled;
disk2_12 ldiskfs image is replaced by
a new disk image with a large xattr test
file;
Fix FLR file creation in 32newtarball test.

Test-Parameters: env=ONLY=32 testlist=conf-sanity serverdistro=el7.9
Test-Parameters: env=ONLY=32 testlist=conf-sanity serverdistro=el8.5
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Change-Id: Id8c33b91f7ca7d68a97384dce8922dd25e8ecd68
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48350
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Sarah Liu <sarah@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/disk2_12-ldiskfs.tar.bz2

index 680033c..45ef0f4 100644 (file)
@@ -1517,12 +1517,21 @@ test_32newtarball() {
                cp $dom_file $tmp/src/dom_dir
        # FLR #
                mkdir -p $flr_dir
-               LFS mirror create -N2 $flr_file
+               $LFS mirror create -N2 $flr_file
                dd if=/dev/urandom of=$flr_file bs=1k count=1
                mkdir -p $tmp/src/flr_dir
                cp $flr_file $tmp/src/flr_dir
        fi
        ############
+
+       local large_xattr_dir=/mnt/$FSNAME/large_xattr_test_dir
+       local xattr_file=$large_xattr_dir/large_xattr_file
+
+       mkdir $large_xattr_dir
+       touch $xattr_file
+       setfattr -n user.fooattr -v $(printf "%c" {1..4096} ) $xattr_file ||
+               rm -f $xattr_file
+
        stopall
 
        mkdir $tmp/img || return 1
@@ -1585,20 +1594,26 @@ test_32newtarball() {
        uname -r >$tmp/img/kernel
        uname -m >$tmp/img/arch
 
-       for num in $(seq 2 $MDSCOUNT); do
+       for ((num=1; num <= $MDSCOUNT; num++)); do
                local devname=$(mdsdevname $num)
                local facet=mds$num
+               local image_name
+
+               [[ num -eq 1 ]] && image_name=mdt || image_name=mdt$num
                [[ $(facet_fstype $facet) != zfs ]] ||
                        devname=$(mdsvdevname $num)
-               mv $devname $tmp/img
+               dd conv=sparse bs=4k if=$devname of=$tmp/img/$image_name
        done
 
-       for num in $(seq $OSTCOUNT); do
+       for ((num=1; num <= $OSTCOUNT; num++)); do
                local devname=$(ostdevname $num)
                local facet=oss$num
+               local image_name
+
+               [[ num -eq 1 ]] && image_name=ost || image_name=ost$num
                [[ $(facet_fstype $facet) != zfs ]] ||
                        devname=$(ostdevname $num)
-               mv $devname $tmp/img
+               dd conv=sparse bs=4k if=$devname of=$tmp/img/$image_name
        done
 
        version=$(sed -e 's/\(^[0-9]\+\.[0-9]\+\)\(.*$\)/\1/' $tmp/img/commit |
@@ -1610,7 +1625,7 @@ test_32newtarball() {
 
        rm -r $tmp
 }
-#run_test 32newtarball "Create a new test_32 disk image tarball for this version"
+# run_test 32newtarball "Create a new test_32 disk image tarball for this version"
 
 #
 # The list of applicable tarballs is returned via the caller's
@@ -2325,7 +2340,7 @@ t32_test() {
 
        if [ "$writeconf" ]; then
                echo "== writeconf and client mount =="
-               $MOUNT_CMD $nid:/$fsname $tmp/mnt/lustre || {
+               $MOUNT_CMD $nid:/$fsname -o user_xattr $tmp/mnt/lustre || {
                        error_noexit "Mounting the client"
                        return 1
                }
@@ -2516,6 +2531,24 @@ t32_test() {
                        }
                fi
 
+               local large_xattr_dir=$tmp/mnt/lustre/large_xattr_test_dir
+
+               if [[ -d $large_xattr_dir ]]; then
+                       echo "== check Large EA =="
+                       local xattr_file=$large_xattr_dir/large_xattr_file
+
+                       xattr_val=$(getfattr --only-values\
+                               -n user.fooattr $xattr_file) || {
+                               error_noexit "Large EA cannot be read"
+                               return 1
+                       }
+
+                       [[ $xattr_val == $(printf "%c" {1..4096}) ]] || {
+                               error_noexit "Wrong large EA value"
+                               return 1;
+                       }
+               fi
+
                if [ "$project_quota_upgrade" != "no" ]; then
                        if ! $mdt2_is_available; then
                                quota_dir=$tmp/mnt/lustre/project_quota_dir
index 51ad5e6..1f416ce 100644 (file)
Binary files a/lustre/tests/disk2_12-ldiskfs.tar.bz2 and b/lustre/tests/disk2_12-ldiskfs.tar.bz2 differ