summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2013-02-19 12:37:04 +0530
committerAnand Avati <avati@redhat.com>2013-09-09 17:19:36 -0700
commit3438475cfda277fac0de6758ea9f85e3587596b5 (patch)
tree3f3936ae46418d13ebc8c2056ad80d41994a7cf4 /tests
parent64c84723064ed9ef9f2a7755d3afffd1ecf08af4 (diff)
performance/open-behind: use anonymous fd for doing fstat and readv
Change-Id: I61a3c221e0a15736ab6315e2538c03dac27480a5 BUG: 846240 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4483 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5807 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/performance/open-behind.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/performance/open-behind.t b/tests/performance/open-behind.t
index 2524ce9e276..032154a202d 100755
--- a/tests/performance/open-behind.t
+++ b/tests/performance/open-behind.t
@@ -32,6 +32,21 @@ function write_to()
TEST write_to "$M0/$F0" "$D0";
EXPECT "$D0" cat $M1/$F0;
+# open-behind delays open and uses anonymous fds for fops like
+# fstat and readv. So after creating the file, if volume is restarted
+# then later when the file is read, because of the use of anonymous fds
+# volume top open will show number of files opened as 0.
+TEST $CLI volume stop $V0;
+sleep 1;
+TEST $CLI volume start $V0;
+
+sleep 2;
+cat $M1/$F0 >/dev/null;
+
+string=$(gluster volume top $V0 open | grep -w "$F0");
+
+EXPECT "" echo $string;
+
TEST $CLI volume set $V0 performance.open-behind off;
D1="hello-this-is-a-test-message1";
@@ -42,4 +57,7 @@ EXPECT "$D1" cat $M1/$F1;
EXPECT "$D0" cat $M1/$F0;
+gluster volume top $V0 open | grep -w "$F0" >/dev/null 2>&1
+TEST [ $? -eq 0 ];
+
cleanup;