Whamcloud - gitweb
LU-11488 test: ignore statfs from precreate in sanity 133b() 17/33517/2
authorJohn L. Hammond <jhammond@whamcloud.com>
Tue, 30 Oct 2018 16:44:44 +0000 (11:44 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 Oct 2018 18:01:32 +0000 (18:01 +0000)
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 <jhammond@whamcloud.com>
Change-Id: Ia47e535d6ce94c712da8ad8698315188c8d64d83
Reviewed-on: https://review.whamcloud.com/33517
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 855dcc8..279330d 100755 (executable)
@@ -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
 }