summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2015-12-04 18:34:36 +0530
committerDan Lambright <dlambrig@redhat.com>2015-12-16 09:28:19 -0800
commit5f6baf2cb061fd32a35bff2081b8ba966871e39d (patch)
tree3b06fcd464f4eb22b6290cbdb5ea0126a8759985 /tests/basic
parente35b9e272be54c3a2f9f9e7409053c6fb94707bb (diff)
tier/glusterd : making new tier detach command throw warning
back port of : http://review.gluster.org/#/c/12883/ For detach tier, the validation was done using the string "detach-tier" but the new commands used has the string "tier". Making the string use "tier" to compare, creates problem as the tier status and tier detach have the keyword "tier". So tier detach and tier status were separated. and strtok was used to prevent the condition from passing when the volume name has a substring of "tier". (only the second word from the string is got and checked if the feature is tier). Problem: new detach tier command doesnt throw warnings like "not a tier volume" or " detach tier not started" respectively instead it prints empty output. Fix: while validate the volume is checked if its a tiered volume if yes it is checked if the detach tier is started, else a warning is thrown respectively. >Change-Id: I94246d53b18ab0e9406beaf459eaddb7c5b766c2 >BUG: 1288517 >Signed-off-by: hari gowtham <hgowtham@redhat.com> >Reviewed-on: http://review.gluster.org/12883 >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Change-Id: I1ac3b6baaec644dbc2025085a7f17abd56ba169d BUG: 1291970 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/12976 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/tier/new-tier-cmds.t65
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/basic/tier/new-tier-cmds.t b/tests/basic/tier/new-tier-cmds.t
new file mode 100644
index 00000000000..c38ecf9d7db
--- /dev/null
+++ b/tests/basic/tier/new-tier-cmds.t
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+. $(dirname $0)/../../tier.rc
+
+
+# Creates a tiered volume with pure distribute hot and cold tiers
+# Both hot and cold tiers will have an equal number of bricks.
+
+function create_dist_tier_vol () {
+ mkdir $B0/cold
+ mkdir $B0/hot
+ TEST $CLI volume create $V0 disperse 6 disperse-data 4 $H0:$B0/cold/${V0}{1..12}
+ TEST $CLI volume set $V0 performance.quick-read off
+ TEST $CLI volume set $V0 performance.io-cache off
+ TEST $CLI volume start $V0
+ TEST $CLI volume attach-tier $V0 replica 2 $H0:$B0/hot/${V0}{0..5}
+ TEST $CLI volume set $V0 cluster.tier-mode test
+}
+
+function tier_detach_commit () {
+ $CLI volume tier $V0 detach commit | grep "success" | wc -l
+}
+
+cleanup;
+
+#Basic checks
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume status
+
+
+#Create and start a tiered volume
+create_dist_tier_vol
+
+#Issue detach tier on the tiered volume
+#Will throw error saying detach tier not started
+
+EXPECT "Tier command failed" $CLI volume tier $V0 detach status
+
+#after starting detach tier the detach tier status should display the status
+
+TEST $CLI volume tier $V0 detach start
+
+TEST $CLI volume tier $V0 detach status
+
+TEST $CLI volume tier $V0 detach stop
+
+#If detach tier is stopped the detach tier command will fail
+
+EXPECT "Tier command failed" $CLI volume tier $V0 detach status
+
+TEST $CLI volume tier $V0 detach start
+
+#wait for the detach to complete
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_commit
+
+#If detach tier is committed then the detach status should fail throwing an error
+#saying its not a tiered volume
+
+EXPECT "Tier command failed" $CLI volume tier $V0 detach status
+
+cleanup;
+