From be69510e670cb5ee893399ca1d7e7d2a60a9483c Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 20 Jul 2016 15:04:01 +0530 Subject: tests: Fix spurious failure of tests/bugs/glusterd/bug-1111041.t On a faster machine the ps check was returning two pids, including the glusterfsd process's pid, right after that, process forked. Hence removing that ps, as for the scope of this test, verifying the snapd pid from the status command itself is enough. Change-Id: I8bd8fc4ea406d96e3a47f952cfe44560b615dbe6 BUG: 1358195 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/14963 Smoke: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Atin Mukherjee NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- tests/bugs/glusterd/bug-1111041.t | 36 ------------------------------------ tests/bugs/snapshot/bug-1111041.t | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 36 deletions(-) delete mode 100644 tests/bugs/glusterd/bug-1111041.t create mode 100644 tests/bugs/snapshot/bug-1111041.t diff --git a/tests/bugs/glusterd/bug-1111041.t b/tests/bugs/glusterd/bug-1111041.t deleted file mode 100644 index caaece0fcbb..00000000000 --- a/tests/bugs/glusterd/bug-1111041.t +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../fileio.rc -. $(dirname $0)/../../nfs.rc - -cleanup; - -function is_snapd_running { - $CLI volume status $1 | grep "Snapshot Daemon" | wc -l; -} - -TEST glusterd; - -TEST pidof glusterd; - -TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 - -TEST $CLI volume start $V0; - -EXPECT "0" is_snapd_running $v0 - -TEST $CLI volume set $V0 features.uss enable; - -EXPECT "1" is_snapd_running $V0 - -SNAPD_PID=$(ps auxww | grep snapd | grep -v grep | awk '{print $2}'); - -TEST [ $SNAPD_PID -gt 0 ]; - -SNAPD_PID2=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'}); - -TEST [ $SNAPD_PID -eq $SNAPD_PID2 ] - -cleanup ; diff --git a/tests/bugs/snapshot/bug-1111041.t b/tests/bugs/snapshot/bug-1111041.t new file mode 100644 index 00000000000..9188880912c --- /dev/null +++ b/tests/bugs/snapshot/bug-1111041.t @@ -0,0 +1,32 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../fileio.rc +. $(dirname $0)/../../nfs.rc + +cleanup; + +function is_snapd_running { + $CLI volume status $1 | grep "Snapshot Daemon" | wc -l; +} + +TEST glusterd; + +TEST pidof glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 + +TEST $CLI volume start $V0; + +EXPECT "0" is_snapd_running $v0 + +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'}); + +TEST [ $SNAPD_PID -gt 0 ] + +cleanup ; -- cgit