summaryrefslogtreecommitdiffstats
path: root/tests/bugs/glusterd
diff options
context:
space:
mode:
authorGauravKumarGarg <ggarg@redhat.com>2015-01-06 16:58:38 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-01-19 20:28:28 -0800
commit1ee8ce725f0e70f45419aa0e2f4d85db7223d766 (patch)
treed93f0499e6b94b88600ccff1611f194c6d99487f /tests/bugs/glusterd
parenta29d6c80dfbd848e0b453d64faf761fe52b4d6c5 (diff)
glusterd: option features.uss should accept only boolean value
"features.uss" with a non-boolean value gets set in the volume option table because of which subsequent volume set operation fails since features.uss does not contain a valid boolean value. Fix is not to allow a non-boolean value to get set in the volume option table. "features.uss" option should have validation function "validate_uss" which validate the input value given by user. Change-Id: I4a212f876627a4979715183b0d488fd69095f193 BUG: 1179175 Signed-off-by: ggarg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/9395 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'tests/bugs/glusterd')
-rw-r--r--tests/bugs/glusterd/bug-1179175-uss-option-validation.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs/glusterd/bug-1179175-uss-option-validation.t b/tests/bugs/glusterd/bug-1179175-uss-option-validation.t
new file mode 100644
index 00000000000..6bbe3c9336f
--- /dev/null
+++ b/tests/bugs/glusterd/bug-1179175-uss-option-validation.t
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+## Test case for option features.uss validation.
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+
+cleanup;
+
+## Start glusterd
+TEST glusterd;
+TEST pidof glusterd;
+
+## Lets create and start volume
+TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
+TEST $CLI volume start $V0
+
+## Set features.uss option with non-boolean value. These non-boolean value
+## for features.uss option should fail.
+TEST ! $CLI volume set $V0 features.uss abcd
+TEST ! $CLI volume set $V0 features.uss #$#$
+TEST ! $CLI volume set $V0 features.uss 2324
+
+## Setting other options with valid value. These options should succeed.
+TEST $CLI volume set $V0 barrier enable
+TEST $CLI volume set $V0 ping-timeout 60
+
+## Set features.uss option with valid boolean value. It should succeed.
+TEST $CLI volume set $V0 features.uss enable
+TEST $CLI volume set $V0 features.uss disable
+
+
+## Setting other options with valid value. These options should succeed.
+TEST $CLI volume set $V0 barrier enable
+TEST $CLI volume set $V0 ping-timeout 60
+
+cleanup;