Whamcloud - gitweb
LU-10366 test: re-enable sanity test 410 for Ubuntu 21/31921/31
authorJames Simmons <jsimmons@infradead.org>
Tue, 6 Feb 2024 17:45:53 +0000 (12:45 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 4 Mar 2024 20:00:04 +0000 (20:00 +0000)
For older Ubuntu the pr_err() messages in the kinode module was not
making it to the dmesg ring buffer due to the default loglevel used
in their environment. Now that older verisons of Ubuntu are dropped
sanity 410 should pass. Thanks to the work of LU-17096 the kinode
modules is in its proper place so sanity 410 should pass.

This patch also changes test_410 and kinode to load the module
successfully and unload after the test is done. The Lustre spec
file is adjusted to accommodate this change.

Test-Parameters: trivial
Test-Parameters: testlist=sanity env=ONLY=410,ONLY_REPEAT=10
Test-Parameters: testlist=sanity env=ONLY=410,ONLY_REPEAT=10 clientdistro=ubuntu2204
Change-Id: Iac96efe64db721f9d7247a889f6e9bd4c7d45e2a
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Timothy Day <timday@amazon.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/31921
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.spec.in
lustre/kunit/kinode.c
lustre/tests/sanity.sh
rpm/kmp-lustre-tests.files

index df06893..b63f0f6 100644 (file)
@@ -731,8 +731,7 @@ mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
 mkdir -p $basemodpath-tests/fs
 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
 mv $basemodpath/fs/obd_test.ko $basemodpath-tests/fs/obd_test.ko
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
-mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
+mv $basemodpath/fs/kinode.ko $basemodpath-tests/fs/kinode.ko
 %endif
 %endif
 
index 2958482..2fea634 100644 (file)
@@ -110,20 +110,20 @@ static int __init kinode_init(void)
 
        if (strlen(fname) < 1) {
                pr_err(PREFIX " invalid file name '%s'\n", run_id, fname);
-               goto out;
+               return -EINVAL;
        }
 
        rc = stat_file(&stbuf1);
        if (rc) {
                pr_err(PREFIX " direct stat failed: %d\n", run_id, rc);
-               goto out;
+               return -EINVAL;
        }
 
        /* Run the same from a kthread. */
        thr = kthread_run(stat_thread, &stbuf2, "kinode_%u", run_id);
        if (IS_ERR(thr)) {
                pr_err(PREFIX " Cannot create kthread\n", run_id);
-               goto out;
+               return -EINVAL;
        }
 
        /* Wait for the thread to start, then wait for it to
@@ -132,7 +132,7 @@ static int __init kinode_init(void)
        rc = kthread_stop(thr);
        if (rc) {
                pr_err(PREFIX " indirect stat failed: %d\n", run_id, rc);
-               goto out;
+               return -EINVAL;
        }
 
        if (stbuf1.ino != stbuf2.ino)
@@ -143,9 +143,7 @@ static int __init kinode_init(void)
                pr_err(PREFIX " inode numbers are identical: %llu\n",
                       run_id, stbuf1.ino);
 
-out:
-       /* Don't load. */
-       return -EINVAL;
+       return 0;
 }
 
 static void __exit kinode_exit(void)
index 75b4347..a3f223b 100755 (executable)
@@ -112,17 +112,6 @@ elif [ -r /etc/redhat-release ]; then
                # failure on fio io_uring I/O engine.
                always_except LU-17289 906
        fi
-elif [ -r /etc/os-release ]; then
-       if grep -qi ubuntu /etc/os-release; then
-               ubuntu_version=$(version_code $(sed -n -e 's/"//g' \
-                                               -e 's/^VERSION=//p' \
-                                               /etc/os-release |
-                                               awk '{ print $1 }'))
-
-               if [[ $ubuntu_version -gt $(version_code 16.0.0) ]]; then
-                       always_except LU-10366 410
-               fi
-       fi
 fi
 
 build_test_filter
@@ -28389,8 +28378,6 @@ test_410()
 {
        [[ $CLIENT_VERSION -lt $(version_code 2.9.59) ]] &&
                skip "Need client version at least 2.9.59"
-       [ -f $LUSTRE/tests/kernel/kinode.ko ] ||
-               skip "Need MODULES build"
 
        # Create a file, and stat it from the kernel
        local testfile=$DIR/$tfile
@@ -28399,15 +28386,18 @@ test_410()
        local run_id=$RANDOM
        local my_ino=$(stat --format "%i" $testfile)
 
-       # Try to insert the module. This will always fail as the
-       # module is designed to not be inserted.
-       insmod $LUSTRE/tests/kernel/kinode.ko run_id=$run_id fname=$testfile \
-           &> /dev/null
+       # Try to insert the module.
+       load_module kunit/kinode run_id=$run_id fname=$testfile ||
+               error "load_module failed"
 
        # Anything but success is a test failure
        dmesg | grep -q \
            "lustre_kinode_$run_id: inode numbers are identical: $my_ino" ||
            error "no inode match"
+
+       # Remove the test module
+       rmmod -v kinode ||
+               error "rmmod failed (may trigger a failure in a later test)"
 }
 run_test 410 "Test inode number returned from kernel thread"
 
index bc1838e..9deabbc 100644 (file)
@@ -2,3 +2,4 @@
 %dir %{modules_fs_path}/%{lustre_name}-tests/fs
 %{modules_fs_path}/%{lustre_name}-tests/fs/llog_test.ko
 %{modules_fs_path}/%{lustre_name}-tests/fs/obd_test.ko
+%{modules_fs_path}/%{lustre_name}-tests/fs/kinode.ko