diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2013-04-09 13:08:22 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-18 06:53:29 -0700 |
commit | 9d74f78141b681faf9d60456d00c73d2905f2735 (patch) | |
tree | 231148ad74ab2e8e833d4de5744fd7f2dd61dd4b /tests | |
parent | dcebed550ebfc878b0b3bd02ab7fe15db6764f81 (diff) |
glusterd: validate performance.nfs.* option values during volume set stage
PROBLEM:
performance.nfs.* option values (which are of type boolean) are
not validated during the stage phase of 'volume set'.
The result - nfs graph generation fails during commit phase,
AFTER the option and its (invalid) value have been placed in
volinfo->dict.
CAUSE:
nfsperfxl_option_handler() - the function that validates the values of
performance.nfs.* options - never receives the (key,value) pair that
needs to be set, for validation during 'volume set' stage.
FIX:
In build_nfs_graph(), copy the (mod_)dict containing the (option,value)
parameters into set_dict before attempting to build the client graph
for the volume on which the operation is being performed.
Of course, an easier way out would be to simply do a 'volume reset' and
pretend nothing wrong happened!
Change-Id: I56b17d0239d58a9e0b7798933a3c8451e2675b69
BUG: 949930
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/4814
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/bug-949930.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/bugs/bug-949930.t b/tests/bugs/bug-949930.t new file mode 100644 index 00000000000..4a738befac4 --- /dev/null +++ b/tests/bugs/bug-949930.t @@ -0,0 +1,27 @@ +#!/bin/bash +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +V1=patchy2 + +cleanup; + +TEST glusterd; +TEST pidof glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; +TEST $CLI volume start $V0; + +TEST $CLI volume create $V1 $H0:$B0/${V1}{1,2}; +TEST $CLI volume start $V1; + +TEST ! $CLI volume set $V0 performance.nfs.read-ahead blah +EXPECT '' volume_option $V0 performance.nfs.read-ahead + +TEST $CLI volume set $V0 performance.nfs.read-ahead on +EXPECT "on" volume_option $V0 performance.nfs.read-ahead + +EXPECT '' volume_option $V1 performance.nfs.read-ahead + +cleanup; + |