summaryrefslogtreecommitdiffstats
path: root/dvm
diff options
context:
space:
mode:
authorM S Vishwanath Bhat <vishwanath@gluster.com>2011-12-26 16:45:43 +0530
committerM S Vishwanath Bhat <vishwanath@gluster.com>2012-01-05 12:13:43 +0530
commit60ca522dc59d8fadeb70b2c077aa2145043a6bee (patch)
tree459e535ee3acecaa9a4ce276510c71924b506657 /dvm
parentd64ce0636ba4802e0c9adb8057eaa4068c5bba0b (diff)
BUG:2606 -- Checks whether volume top lists 100 entries
Change-Id: If7ee93529cc0a6776962917f66bdf3a43dec0486 BUG: 2606 Signed-off-by: M S Vishwanath Bhat <vishwanath@gluster.com>
Diffstat (limited to 'dvm')
-rwxr-xr-xdvm/2606/testcase42
1 files changed, 42 insertions, 0 deletions
diff --git a/dvm/2606/testcase b/dvm/2606/testcase
new file mode 100755
index 0000000..46e548d
--- /dev/null
+++ b/dvm/2606/testcase
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+source $cwd/regression_helpers
+
+$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/\
+$global_bug_id/brick 2>/dev/null 1>/dev/null;
+
+$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null;
+
+mount_glusterfs $global_bug_id 2>/dev/null 1>/dev/null;
+sleep 2;
+
+for i in {1..100}
+do
+ dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null;
+ dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null;
+done
+
+
+#First few lines of volume top open/read/write contains details like brick whose
+#info is being displayed,and header for each column of the list. Volume top open
+#in addition will have one line info about openfds. This means that every top
+#open output will have 4 lines of details along with the actual list. For top
+#read/write there will be 3 lines of details. For this reason we should grep out
+#those lines containing details and take line count on the actual list.
+
+
+temp1=`$GLUSTERFSDIR/gluster volume top $global_bug_id open | grep -v "Brick:\|\
+Current open fds:\|Count\|=" | wc -l`
+
+temp2=`$GLUSTERFSDIR/gluster volume top $global_bug_id read | grep -v "Brick:\|\
+Count\|=" |wc -l`
+
+temp3=`$GLUSTERFSDIR/gluster volume top $global_bug_id write | grep -v "Brick:\|\
+Count\|=" | wc -l`
+
+
+if [ $temp1 -eq 100 ] && [ $temp3 -eq 100 ] && [ $temp2 -eq 100 ];then
+ exit 0;
+else
+ exit 1;
+fi