From 0130d7019534611ff05a29fad657226d2eb6b79e Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Fri, 22 May 2020 12:06:47 +0800 Subject: [PATCH] LU-10401 procs: print new line based on distro 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 Change-Id: Ibb5961e4de8b05d9dd59875e4fd38a42fa07d0d6 Reviewed-on: https://review.whamcloud.com/38699 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- libcfs/libcfs/debug.c | 4 +++- lustre/tests/sanity.sh | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index 280ada3..cd6cfdb 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -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; diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 513ecae..c9ee46e 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 } -- 1.8.3.1