summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-04-26 12:46:18 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-04-26 22:04:06 -0700
commit57f66ea86a2fbf61df34b3d6854f639f437cc12b (patch)
tree49f4002694df0bd9d3918ae2e5480604dbffb244 /tests
parent2fff1c41bbe1a355fe398df08f2a27844b925b47 (diff)
glusterd: fix validation of lower op-version check in volume set
Commit 2d87a98 introduced a validation to fail lowering down the cluster.op-version. Commit 2eb8758 actually changed the variable value from cluster's op-version to volume's op-version which resulted the logic go for a toss. Change-Id: I70df32b75c3a3fe47dc840c4a655059e5b124bca BUG: 1330545 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/14069 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/14077
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/glusterd/bug-1315186-reject-lowering-down-op-version.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/bugs/glusterd/bug-1315186-reject-lowering-down-op-version.t b/tests/bugs/glusterd/bug-1315186-reject-lowering-down-op-version.t
new file mode 100644
index 00000000000..4bd6eaac59f
--- /dev/null
+++ b/tests/bugs/glusterd/bug-1315186-reject-lowering-down-op-version.t
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+. $(dirname $0)/../../include.rc
+
+# The test validates that lowering down the op-version should fail
+
+cleanup
+
+TEST glusterd
+TEST pidof glusterd
+
+#volume create is just to ensure glusterd.info file is created
+TEST $CLI volume create $V0 $H0:$B0/b1
+
+GDWD=$($CLI system getwd)
+OP_VERS_ORIG=$(grep 'operating-version' ${GDWD}/glusterd.info | cut -d '=' -f 2)
+OP_VERS_NEW=`expr $OP_VERS_ORIG-1`
+
+TEST ! $CLI volume set all $V0 cluster.op-version $OP_VERS_NEW
+
+cleanup;
+