diff options
author | Sakshi <sabansal@redhat.com> | 2015-05-05 10:55:56 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-02-29 20:54:20 -0800 |
commit | 0cdfd1aa02b0f5f6483fd56625bc032060694a93 (patch) | |
tree | 7cf27421c993c4f966afd18b693f6c02e87f36d9 /tests | |
parent | 080af56a02aeec20899ecbc7202a8d293378c1f9 (diff) |
cli: output of rebalance to show run time in proper format
Backport of http://review.gluster.org/#/c/10544/
Modified tests to parse the new rebalance time format.
> Change-Id: I775f13c8046dd2aeb9d4b86a737dcebb396778b4
> BUG: 1223625
> Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
> Reviewed-on: http://review.gluster.org/10544
> Smoke: Gluster Build System <jenkins@build.gluster.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: N Balachandran <nbalacha@redhat.com>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1311822
Change-Id: I3c8106f7a1309f154861ce1b3efa202fa6c47c57
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/13514
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Raghavendra Talur <rtalur@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/tier/tierd_check.t | 13 | ||||
-rw-r--r-- | tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t | 4 | ||||
-rw-r--r-- | tests/tier.rc | 10 |
3 files changed, 13 insertions, 14 deletions
diff --git a/tests/basic/tier/tierd_check.t b/tests/basic/tier/tierd_check.t index ee97883688d..6edd2f3b795 100644 --- a/tests/basic/tier/tierd_check.t +++ b/tests/basic/tier/tierd_check.t @@ -19,11 +19,6 @@ function create_dist_tier_vol () { TEST $CLI volume set $V0 cluster.tier-mode test } -function tier_deamon_check () { -pgrep -f "rebalance/$V0" -echo "$?" -} - function tier_deamon_kill () { pkill -f "rebalance/$V0" echo "$?" @@ -40,22 +35,22 @@ TEST $CLI volume status #Create and start a tiered volume create_dist_tier_vol -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_deamon_check +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_daemon_check EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_deamon_kill TEST $CLI volume tier $V0 start -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_deamon_check +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_deamon_kill TEST $CLI volume tier $V0 start force -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_deamon_check +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check TEST $CLI volume tier $V0 start force -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_deamon_check +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check cleanup diff --git a/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t b/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t index a2a10ee5ef6..75e2d337687 100644 --- a/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t +++ b/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t @@ -39,7 +39,7 @@ TEST $CLI volume status #Create and start a tiered volume create_dist_tier_vol -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_deamon_check +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_daemon_check sleep 2 #wait for some time to run tier daemon time_before_restarting=$(rebalance_run_time $V0); @@ -51,7 +51,7 @@ EXPECT "0" non_zero_check $time_before_restarting; kill -9 $(pidof glusterd); TEST glusterd; sleep 2; -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_deamon_check; +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check; time1=$(rebalance_run_time $V0); EXPECT "0" non_zero_check $time1; sleep 4; diff --git a/tests/tier.rc b/tests/tier.rc index 19234c521a0..dd220fe09d2 100644 --- a/tests/tier.rc +++ b/tests/tier.rc @@ -114,13 +114,17 @@ function sleep_until_mid_cycle { sleep $mod } -function tier_deamon_check () { +function tier_daemon_check () { pgrep -f "rebalance/$V0" echo "$?" } function rebalance_run_time () { local time=$($CLI volume rebalance $1 status | awk '{print $9}' | sed -n 3p); - time=$(printf "%.0f\n" "$time"); - echo $time + local hh=$(echo $time | cut -d ':' -f1); + local mm=$(echo $time | cut -d ':' -f2); + local ss=$(echo $time | cut -d ':' -f3); + local total=$(($hh * 3600 + $mm * 60 + $ss)); + + echo $total; } |