From 5a28f3bc4bd769d61dde54fdbf7ad11a16b47224 Mon Sep 17 00:00:00 2001 From: Cyril Bordage Date: Thu, 8 Jul 2021 16:35:44 +0200 Subject: [PATCH] LU-14789 tests: make sanity 133f and 133g working Tests sanity 133f and 133g were doing nothing after change 38567. Because the argument given to badarea_io was not a path, 0 was always returned. This patch finds the complete path of the parameters returned by "lctl get_param" and gives them to badarea_io. Fixes: 1c54733894f8 ("LU-10401 tests: add -F so list_param prints entry type") Signed-off-by: Cyril Bordage Change-Id: I7a8914e2950d5a8b2a93948c4fbe889520a3198c Reviewed-on: https://review.whamcloud.com/44184 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- lustre/tests/sanity.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 81053e9..744e6d6 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -92,6 +92,8 @@ if [ "$ost1_FSTYPE" = "zfs" ]; then ALWAYS_EXCEPT+=" 130a 130b 130c 130d 130e 130f 130g" fi +proc_regexp="/{proc,sys}/{fs,sys,kernel/debug}/{lustre,lnet}/" + # Get the SLES distro version # # Returns a version string that should only be used in comparing @@ -13832,8 +13834,12 @@ test_133f() { $LCTL get_param -R '*' &> /dev/null # Verifing writability with badarea_io. + local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) + local skipped_params='force_lbug|changelog_mask|daemon_file' $LCTL list_param -FR '*' | grep '=' | tr -d = | - egrep -v 'force_lbug|changelog_mask' | xargs badarea_io || + egrep -v "$skipped_params" | + xargs -n 1 find $proc_dirs -name | + xargs -n 1 badarea_io || error "client badarea_io failed" # remount the FS in case writes/reads /proc break the FS @@ -13846,6 +13852,8 @@ test_133g() { remote_mds_nodsh && skip "remote MDS with nodsh" remote_ost_nodsh && skip "remote OST with nodsh" + local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) + local skipped_params="'force_lbug|changelog_mask|daemon_file'" local facet for facet in mds1 ost1; do local facet_ver=$(lustre_version_code $facet) @@ -13856,8 +13864,9 @@ test_133g() { fi if [ $facet_ver -ge $(version_code 2.5.54) ]; then do_facet $facet "$LCTL list_param -FR '*' | grep '=' | - tr -d = | egrep -v 'force_lbug|changelog_mask' | - xargs badarea_io" || + tr -d = | egrep -v $skipped_params | + xargs -n 1 find $proc_dirs -name | + xargs -n 1 badarea_io" || error "$facet badarea_io failed" else skip_noexit "$facet: too old lustre for get_param -R" @@ -24065,7 +24074,6 @@ test_401a() { #LU-7437 #count the number of parameters by "list_param -R" local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l) #count the number of parameters by listing proc files - local proc_regexp="/{proc,sys}/{fs,sys,kernel/debug}/{lustre,lnet}/" local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) echo "proc_dirs='$proc_dirs'" [ -n "$proc_dirs" ] || error "no proc_dirs on $HOSTNAME" -- 1.8.3.1