Whamcloud - gitweb
LU-10401 procs: print new line based on distro 99/38699/7
authorYang Sheng <ys@whamcloud.com>
Fri, 22 May 2020 04:06:47 +0000 (12:06 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 30 May 2020 09:38:39 +0000 (09:38 +0000)
Since upstream changed to print new line in module
parameter callback instead of kernel self. So we
need test output of param_get_byte to determine
whether output the new line.
(upstream: v4.14-rc3-148-g96802e6b1dbf)
Also output filename and file content when test
failed for santy 133h.

Test-Parameters: trivial testlist=sanity clientdistro=el8.1 serverdistro=el8.1
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: Ibb5961e4de8b05d9dd59875e4fd38a42fa07d0d6
Reviewed-on: https://review.whamcloud.com/38699
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
libcfs/libcfs/debug.c
lustre/tests/sanity.sh

index 280ada3..cd6cfdb 100644 (file)
@@ -132,7 +132,9 @@ static int param_get_delay(char *buffer, cfs_kernel_param_arg_t *kp)
 {
        unsigned int d = *(unsigned int *)kp->arg;
 
-       return sprintf(buffer, "%lu", jiffies_to_msecs(d * 10) / MSEC_PER_SEC);
+       param_get_byte(buffer, kp);
+       return sprintf(buffer, "%lu%c", jiffies_to_msecs(d * 10) / MSEC_PER_SEC,
+                      strnchr(buffer, PAGE_SIZE, '\n') ? '\n' : '\0');
 }
 
 unsigned int libcfs_console_max_delay;
index 513ecae..c9ee46e 100755 (executable)
@@ -12913,10 +12913,8 @@ test_133h() {
                skip "Need MDS version at least 2.9.54"
 
        local facet
-
        for facet in client mds1 ost1; do
                # Get the list of files that are missing the terminating newline
-               #local missing=($(do_facet $facet \
                local plist=$(do_facet $facet
                        $LCTL list_param -FR '*' | grep '=' | tr -d =)
                local ent
@@ -12925,8 +12923,10 @@ test_133h() {
                                awk -v FS='\v' -v RS='\v\v' \
                                "'END { if(NR>0 && \\\$NF !~ /.*\\\n\$/) \
                                        print FILENAME}'" 2>/dev/null)
-                       [ -z $missing ] ||
-                               error "files do not end with newline: $missing"
+                       [ -z $missing ] || {
+                               do_facet $facet $LCTL get_param $ent | od -An -tx1
+                               error "file does not end with newline: $facet-$ent"
+                       }
                done
        done
 }