summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2012-12-12 15:36:26 +0530
committerAnand Avati <avati@redhat.com>2012-12-17 16:42:09 -0800
commitb8a19d235a5d4fef572fe3a4ad5ccddaf207ee49 (patch)
treec1ecca7715ad15b08dca98e4d1077a85d83e5b44
parentcdcbc5bb3dfd2b447df0dff843d7774a1a463a09 (diff)
tests: Added basic sanity test for all volume-status cmds
Change-Id: I482a38ca9f67a5f4b4cbc96731cb68c3b442c2d4 BUG: 764966 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4298 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--tests/basic/volume-status.t63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/basic/volume-status.t b/tests/basic/volume-status.t
new file mode 100644
index 00000000000..a7a9b233f41
--- /dev/null
+++ b/tests/basic/volume-status.t
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8};
+
+TEST $CLI volume start $V0;
+
+sleep 2
+
+## Mount FUSE
+TEST glusterfs -s $H0 --volfile-id $V0 $M0;
+
+## Mount NFS
+TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0;
+
+TEST $CLI volume status all
+TEST $CLI volume status $V0
+
+function test_nfs_cmds () {
+ local ret=0
+ declare -a nfs_cmds=("clients" "mem" "inode" "callpool")
+ for cmd in ${nfs_cmds[@]}; do
+ $CLI volume status $V0 nfs $cmd
+ (( ret += $? ))
+ done
+ echo ret
+}
+
+function test_shd_cmds () {
+ local ret=0
+ declare -a shd_cmds=("mem" "inode" "callpool")
+ for scmd in ${shd_cmds[@]}; do
+ $CLI volume status $V0 shd $cmd
+ (( ret += $? ))
+ done
+ echo ret
+}
+
+function test_brick_cmds () {
+ local ret=0
+ declare -a cmds=("detail" "clients" "mem" "inode" "fd" "callpool")
+ for cmd in ${cmds[@]}; do
+ for i in {1..2}; do
+ $CLI volume status $V0 $H0:$B0/${V0}$i $cmd
+ (( ret += $? ))
+ done
+ done
+ echo ret
+}
+
+TEST test_shd_cmds;
+TEST test_nfs_cmds;
+TEST test_brick_cmds;
+
+cleanup;
+