Whamcloud - gitweb
LU-14789 tests: make sanity 133f and 133g working 84/44184/4
authorCyril Bordage <cbordage@whamcloud.com>
Thu, 8 Jul 2021 14:35:44 +0000 (16:35 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Jul 2021 21:38:01 +0000 (21:38 +0000)
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 <cbordage@whamcloud.com>
Change-Id: I7a8914e2950d5a8b2a93948c4fbe889520a3198c
Reviewed-on: https://review.whamcloud.com/44184
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/tests/sanity.sh

index 81053e9..744e6d6 100755 (executable)
@@ -92,6 +92,8 @@ if [ "$ost1_FSTYPE" = "zfs" ]; then
        ALWAYS_EXCEPT+="                130a 130b 130c 130d 130e 130f 130g"
 fi
 
        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
 # 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.
        $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 = |
        $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
                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"
 
        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)
        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 '=' |
                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"
                                        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
        #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"
        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"