summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2020-04-07 20:55:19 +0530
committerPranith Kumar K <pkarampu@redhat.com>2020-04-07 21:01:01 +0530
commitae8867fcfa5b14008a1c9a29674e971f502e1a61 (patch)
tree5a5cf7ef051df5cc734b65157640269bc43c94cd
parent55914f968d907ed747774da15285b42653afda61 (diff)
tests: Fix spurious failure of tests/bugs/snapshot/bug-1111041.t
Test should wait for process down notification to be received by glusterd. Fixes: #1153 Change-Id: I9162b58a92c1a909ca98097f14c0714f9086bdd1 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
-rwxr-xr-xtests/bugs/snapshot/bug-1111041.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/bugs/snapshot/bug-1111041.t b/tests/bugs/snapshot/bug-1111041.t
index f771d64f2a3..efda9688d8b 100755
--- a/tests/bugs/snapshot/bug-1111041.t
+++ b/tests/bugs/snapshot/bug-1111041.t
@@ -11,6 +11,10 @@ function is_snapd_running {
$CLI volume status $1 | grep "Snapshot Daemon" | wc -l;
}
+function snapd_pid {
+ $CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'}
+}
+
TEST glusterd;
TEST pidof glusterd;
@@ -25,14 +29,12 @@ TEST $CLI volume set $V0 features.uss enable;
EXPECT "1" is_snapd_running $V0
-SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'});
+SNAPD_PID=$(snapd_pid);
TEST [ $SNAPD_PID -gt 0 ]
kill -9 $SNAPD_PID
-SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'});
-
-TEST [ $SNAPD_PID = 'N/A' ]
+EXPECT_WITHIN $PROCESS_DOWN_TIMEOUT "^N/A$" snapd_pid
cleanup ;