diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-04-19 13:02:39 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-19 01:55:36 -0700 | 
| commit | 1fc9b98a4eb6eda8db30940a8bb07d206e2fa049 (patch) | |
| tree | d74345d893fc40ee5d0d65a4214add1d20139ca1 /tests | |
| parent | 9d74f78141b681faf9d60456d00c73d2905f2735 (diff) | |
tests: Fix volume-status test script
* The functions now return the aggregated return value instead of just echoing it.
* Fixed the shd test loop to use the proper variable
* Added 'wait's for nfs and shd services to come online.
BUG: 764966
Change-Id: Iedbb5be0d5e50108ed4847d58625ccb093c22251
Original-author: Kaushal M <kaushal@redhat.com>
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4856
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/basic/volume-status.t | 11 | ||||
| -rw-r--r-- | tests/volume.rc | 4 | 
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/basic/volume-status.t b/tests/basic/volume-status.t index a7a9b233..f4196ac3 100644 --- a/tests/basic/volume-status.t +++ b/tests/basic/volume-status.t @@ -1,6 +1,7 @@  #!/bin/bash  . $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc  cleanup; @@ -23,6 +24,8 @@ TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0;  TEST $CLI volume status all  TEST $CLI volume status $V0 +EXPECT_WITHIN 10 'Y' nfs_up_status +EXPECT_WITHIN 10 'Y' glustershd_up_status  function test_nfs_cmds () {      local ret=0      declare -a nfs_cmds=("clients" "mem" "inode" "callpool") @@ -30,17 +33,17 @@ function test_nfs_cmds () {          $CLI volume status $V0 nfs $cmd          (( ret += $? ))      done -    echo ret +    return $ret  }  function test_shd_cmds () {      local ret=0      declare -a shd_cmds=("mem" "inode" "callpool") -    for scmd in ${shd_cmds[@]}; do +    for cmd in ${shd_cmds[@]}; do          $CLI volume status $V0 shd $cmd          (( ret += $? ))      done -    echo ret +    return $ret  }  function test_brick_cmds () { @@ -52,7 +55,7 @@ function test_brick_cmds () {              (( ret += $? ))          done      done -    echo ret +    return $ret  }  TEST test_shd_cmds; diff --git a/tests/volume.rc b/tests/volume.rc index 5b7a38f7..54b6173c 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -119,6 +119,10 @@ function afr_child_up_status_in_shd {          _afr_child_up_status $vol $brick_id generate_shd_statedump  } +function nfs_up_status { +        gluster volume status | grep "NFS Server" | awk '{print $6}' +} +  function glustershd_up_status {          gluster volume status | grep "Self-heal Daemon" | awk '{print $6}'  }  | 
