diff options
author | GauravKumarGarg <ggarg@redhat.com> | 2014-11-12 17:41:33 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-02-04 22:02:42 -0800 |
commit | e44d4e135747b04a5e2b7cfac21f9a3343e071db (patch) | |
tree | e514e5f6f0bd2752c2d0c0c564a0ae12dbb175f6 /tests/bugs/glusterd | |
parent | 0b198a113e254f6a2702a87a45e823cea964ab11 (diff) |
DHT: cluster.min-free-disk option should validate correctly
PROBLEM:
Previously gluster accepting input value as a percentage which is out of range
[0-100] and accepting input value as a size (unit is byte) which is fractional
for option cluster.min-free-disk.
FIX:
Now with this change it will refer to correct validation function
and it will accept value that is in range [0-100] for input value as a
percentage and unsigned integer value for input as a size (unit in byte)
for option cluster.min-free-disk.
Change-Id: Iee1962a100542e146276cfc8a4068abddee2bf2d
BUG: 1163108
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/9104
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs/glusterd')
-rw-r--r-- | tests/bugs/glusterd/bug-1163108-min-free-disk-option-validation.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs/glusterd/bug-1163108-min-free-disk-option-validation.t b/tests/bugs/glusterd/bug-1163108-min-free-disk-option-validation.t new file mode 100644 index 00000000000..9fc7ac3b845 --- /dev/null +++ b/tests/bugs/glusterd/bug-1163108-min-free-disk-option-validation.t @@ -0,0 +1,37 @@ +#!/bin/bash + +## Test case for cluster.min-free-disk option 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/brick1 $H0:$B0/brick2 +TEST $CLI volume start $V0 + +## Setting invalid value for option cluster.min-free-disk should fail +TEST ! $CLI volume set $V0 min-free-disk "" +TEST ! $CLI volume set $V0 min-free-disk 143.!/12 +TEST ! $CLI volume set $V0 min-free-disk 123% +TEST ! $CLI volume set $V0 min-free-disk 194.34% + +## Setting fractional value as a size (unit is byte) for option +## cluster.min-free-disk should fail +TEST ! $CLI volume set $V0 min-free-disk 199.051 +TEST ! $CLI volume set $V0 min-free-disk 111.999 + +## Setting valid value for option cluster.min-free-disk should pass +TEST $CLI volume set $V0 min-free-disk 12% +TEST $CLI volume set $V0 min-free-disk 56.7% +TEST $CLI volume set $V0 min-free-disk 120 +TEST $CLI volume set $V0 min-free-disk 369.0000 + + +cleanup; |