Whamcloud - gitweb
LU-18081 tests: improve conf-sanity/98 testing 33/59433/2
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 26 May 2025 08:44:19 +0000 (01:44 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 May 2025 02:07:20 +0000 (02:07 +0000)
conf-sanity test_98 is failing for newer distros like Ubuntu 24.04
and SLES15sp6, which have newer userspace tools.

Print better error messages about what options are being processed
to help debug this issue.  It appears mount is now deduplicating
options passed on the command-line, which invalidates the test case.

Change test_98 to call mount.lustre directly to verify this handling.

Lustre-change: https://review.whamcloud.com/55891
Lustre-commit: ae475331db533826fe444a71bf61ad08d42c0a21

Test-Parameters: trivial
Test-Parameters: testlist=conf-sanity env=ONLY=98 clientdistro=sles15sp6
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I34de0fdbd4ca36228d313b53251b5dbcfc502b07
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59433
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frederick Dilger <fdilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/utils/mount_lustre.c

index 228e220..2c36fe2 100755 (executable)
@@ -7784,11 +7784,14 @@ test_98()
        setup
        check_mount || error "mount failed"
        mountopt="user_xattr"
-       for ((x = 1; x <= PAGE_SIZE/11; x++)); do
+       for ((x = 1; x <= PAGE_SIZE/10; x++)); do
                mountopt="$mountopt,user_xattr"
        done
-       mount_client $MOUNT remount,$mountopt 2>&1 | grep "too long" ||
+       mount.lustre -o remount,$mountopt -v $MGSNID:/$FSNAME $MOUNT 2>&1 |
+               tee $TMP/$tfile.out
+       grep "too long" $TMP/$tfile.out ||
                error "Buffer overflow check failed"
+
        cleanup || error "cleanup failed"
 }
 run_test 98 "Buffer-overflow check while parsing mount_opts"
index 3ce3ed0..2e58c2f 100644 (file)
@@ -280,7 +280,11 @@ static int append_option(char *options, size_t options_len,
        }
        return 0;
 out_err:
-       fprintf(stderr, "error: mount options %s%s too long\n", param, value);
+       /* this 'too long' message is checked in conf-sanity test_98 */
+       fprintf(stderr,
+               "error: add mount options %s%s too long, %zu over limit %zu\n",
+               param, value, strlen(options) + strlen(param) + strlen(value),
+               options_len);
        return E2BIG;
 }
 
@@ -857,7 +861,7 @@ int main(int argc, char *const argv[])
        g_pagesize = sysconf(_SC_PAGESIZE);
        if (g_pagesize == -1) {
                rc = errno;
-               printf("error: %d failed to get page size.\n", rc);
+               printf("error: failed to get page size: %s\n", strerror(rc));
                return rc;
        }
        maxopt_len = MIN(g_pagesize, 64 * 1024);
@@ -871,7 +875,8 @@ int main(int argc, char *const argv[])
                        printf("arg[%d] = %s\n", i, argv[i]);
                printf("source = %s (%s), target = %s\n", mop.mo_usource,
                       mop.mo_source, mop.mo_target);
-               printf("options = %s\n", mop.mo_orig_options);
+               printf("options(%zu/%zu) = %s\n", strlen(mop.mo_orig_options),
+                      maxopt_len, mop.mo_orig_options);
        }
 
        options = malloc(maxopt_len);
@@ -882,7 +887,11 @@ int main(int argc, char *const argv[])
        }
 
        if (strlen(mop.mo_orig_options) >= maxopt_len) {
-               fprintf(stderr, "error: mount options too long\n");
+               /* this 'too long' message is checked in conf-sanity test_98 */
+
+               fprintf(stderr,
+                       "error: mount options too long, %zu over limit %zu\n",
+                       strlen(mop.mo_orig_options), maxopt_len);
                rc = E2BIG;
                goto out_options;
        }