Whamcloud - gitweb
LU-11492 tests: fix thread_sanity() defect 35/33335/2
authorElena Gryaznova <c17455@cray.com>
Wed, 10 Oct 2018 14:20:10 +0000 (17:20 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Nov 2018 04:05:35 +0000 (04:05 +0000)
tmin, tmax, tstarted are not set if do_facet fails by some reason.
This leads to the following failure:
Assertion 28 failed: (($tstarted >= $tmin && $tstarted <= $tmax ))
   (expanded: ((16 >=  && 16 <= 16 )))
Patch sets variables equal to 0 for cases of failed do_facet, like
it is done for other similar cases.

Test-Parameters:trivial testlist=sanity envdefinitions=ONLY="53a 53b"
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: LUS-5638
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Vitaly Fertman <c17818@cray.com>
Change-Id: If713ba20a0f71cb17208f776a9a4edd359c07c43
Reviewed-on: https://review.whamcloud.com/33335
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh

index fa8b6bf..0f5cafc 100644 (file)
@@ -4172,10 +4172,12 @@ thread_sanity() {
        setmodopts $modname "$oldvalue"
 
        # Check that $opts took
-       tmin=$(do_facet $facet "$LCTL get_param -n ${paramp}.threads_min")
-       tmax=$(do_facet $facet "$LCTL get_param -n ${paramp}.threads_max")
+       tmin=$(do_facet $facet "$LCTL get_param -n ${paramp}.threads_min" ||
+               echo 0)
+       tmax=$(do_facet $facet "$LCTL get_param -n ${paramp}.threads_max" ||
+               echo 0)
        tstarted=$(do_facet $facet \
-                  "$LCTL get_param -n ${paramp}.threads_started")
+                  "$LCTL get_param -n ${paramp}.threads_started" || echo 0)
        lassert 28 "$msg" '(($tstarted >= $tmin && $tstarted <= $tmax ))' ||
                return $?
        cleanup