From 2b8fdde926532014f19d850b1321a4c7046dc001 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 27 May 2015 16:59:19 +0530 Subject: tests: Await for graph switch before testing open fop count In performance/open-behind.t, a test for open fop reaching the brick is done by switching off open-behind and performing a read operation. If the read operation is performed before a graph switch, the read happens on the old graph and hence open does not get accounted in the brick. To overcome this EXPECT_WITHIN 10 seconds has now been added to ensure that a graph switch has happened. The read operation happens subsequently after the graph switch. Cleaned up a "No volumes present" message from stderr while doing this. Change-Id: I05f7cbfd1ce51782f5ab778468a980d3732509a2 BUG: 1225077 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/10941 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi --- tests/include.rc | 1 + tests/performance/open-behind.t | 5 ++++- tests/volume.rc | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/include.rc b/tests/include.rc index 3a54ee28f79..2c45873aec0 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -65,6 +65,7 @@ JANITOR_TIMEOUT=60 UMOUNT_TIMEOUT=5 CONFIG_UPDATE_TIMEOUT=5 AUTH_REFRESH_INTERVAL=10 +GRAPH_SWITCH_TIMEOUT=10 LOGDIR=$(gluster --print-logdir) diff --git a/tests/performance/open-behind.t b/tests/performance/open-behind.t index 5a24c83954d..e7a2bcf788b 100755 --- a/tests/performance/open-behind.t +++ b/tests/performance/open-behind.t @@ -1,12 +1,13 @@ #!/bin/bash . $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc cleanup; TEST glusterd TEST pidof glusterd -TEST $CLI volume info; +TEST $CLI volume info 2>/dev/null; TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; @@ -49,6 +50,8 @@ EXPECT "" echo $string; TEST $CLI volume set $V0 performance.open-behind off; +EXPECT_WITHIN $GRAPH_SWITCH_TIMEOUT "2" num_graphs $M0; + D1="hello-this-is-a-test-message1"; F1="test-file1"; diff --git a/tests/volume.rc b/tests/volume.rc index bc34b608891..9e01fff687d 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -512,6 +512,12 @@ function cleanup_georep { $CLI volume geo-rep $GMV0 $H0::$GSV0 delete } +function num_graphs +{ + local mountpoint=$1 + echo `ls $mountpoint/.meta/graphs/ | grep -v active | wc -l` +} + function get_aux() { ##Check if a auxiliary mount is there -- cgit