From 60a75cdca76b0a4b83eb6f5bc70a320d586d79aa Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Wed, 10 Sep 2014 17:33:20 +0530 Subject: glusterd: file-snapshot and features-encryption options should be validate correctly By giving non-boolean value to volume set command for features.file-snapshot and features.encryption option the command failed after that subsequent volume set request with valid value of the existing any volume set option fail. Previously when user supplies a non-boolean value in volume set command for features.file-snapshot and features.encryption option's then validation of that value was done by volinfo->dict but actual value of that option store in input dictonary. Now with this change it will refer correct dictonary for validation of supplies value. Change-Id: I4a93d8be848cd33fdf4b4eb9b1a8d15ec9d1e66a BUG: 1140162 Reviewed-on: http://review.gluster.org/8688 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Kaushal M --- ...hot-and-features-encryption-option-validation.t | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/bugs/bug-1140162-file-snapshot-and-features-encryption-option-validation.t (limited to 'tests/bugs') diff --git a/tests/bugs/bug-1140162-file-snapshot-and-features-encryption-option-validation.t b/tests/bugs/bug-1140162-file-snapshot-and-features-encryption-option-validation.t new file mode 100644 index 00000000000..a7aa883cba8 --- /dev/null +++ b/tests/bugs/bug-1140162-file-snapshot-and-features-encryption-option-validation.t @@ -0,0 +1,33 @@ +#!/bin/bash + +## Test case for BZ-1140160 Volume option set and +## command input should validate correctly. + +. $(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.file-snapshot and features.encryption option with non-boolean +## value. These options should fail. +TEST ! $CLI volume set $V0 features.file-snapshot abcd +TEST ! $CLI volume set $V0 features.encryption redhat + +## Set 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.file-snapshot and features.encryption option with valid boolean +## value. These options should succeed. +TEST $CLI volume set $V0 features.file-snapshot on +TEST $CLI volume set $V0 features.encryption on + +cleanup; -- cgit