From: John L. Hammond Date: Tue, 30 Oct 2018 16:44:44 +0000 (-0500) Subject: LU-11488 test: ignore statfs from precreate in sanity 133b() X-Git-Tag: 2.12.0-RC1~131 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=08de147648da4c02ddeb4a6ea2f977f4a20d31d7 LU-11488 test: ignore statfs from precreate in sanity 133b() In sanity test_133b() use obdfilter client export stats rather than target stats to check for statfs allowing us to ignore statfs RPCs from the MDT for precreate. Signed-off-by: John L. Hammond Change-Id: Ia47e535d6ce94c712da8ad8698315188c8d64d83 Reviewed-on: https://review.whamcloud.com/33517 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 855dcc8..279330d 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -10781,7 +10781,7 @@ test_133b() { #define OBD_STATFS_CACHE_SECONDS 1 sleep 2 do_facet $SINGLEMDS $LCTL set_param mdt.*.md_stats=clear - do_facet ost1 $LCTL set_param obdfilter.*.stats=clear + do_facet ost1 $LCTL set_param obdfilter.*.exports.*.stats=clear $LFS df || error "lfs failed" check_stats $SINGLEMDS "statfs" 1 @@ -10792,12 +10792,20 @@ test_133b() { return 0 sleep 2 do_facet $SINGLEMDS $LCTL set_param mdt.*.md_stats=clear - do_facet ost1 $LCTL set_param obdfilter.*.stats=clear + do_facet ost1 $LCTL set_param obdfilter.*.exports.*.stats=clear df $DIR check_stats $SINGLEMDS "statfs" 1 - res=$(do_facet ost1 \ - $LCTL get_param obdfilter.$FSNAME-OST0000.stats | grep "statfs") - [ "$res" ] && error "OST got STATFS" + + # We want to check that the client didn't send OST_STATFS to + # ost1 but the MDT also uses OST_STATFS for precreate. So some + # extra care is needed here. + if remote_mds; then + local nid=$($LCTL list_nids | head -1 | sed "s/\./\\\./g") + local param="obdfilter.$FSNAME-OST0000.exports.'$nid'.stats" + + res=$(do_facet ost1 $LCTL get_param $param | grep statfs) + [ "$res" ] && error "OST got STATFS" + fi return 0 }