summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bug-1113476.t
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-06-26 07:51:02 +0530
committerVijay Bellur <vbellur@redhat.com>2014-09-23 02:00:22 -0700
commitb98ed29cf6c1b999a025dff2269118a9198bd987 (patch)
treeffc1031036bc104b979ae4e24ada47cabec578f2 /tests/bugs/bug-1113476.t
parent794d9fbe00b71aa80e841530f00af9b8f81c8f21 (diff)
cli/snapshot : gluster volume info should not show the options which are not set explicitly.
Problem : Even though snap-max-hard-limit, snap-max-soft-limit and auto-delete values were not set explicitly, It was getting showed in the output of gluster volume info. Solution : Check if the value is already present in dictionary (That means, it is set), If value is not present then consider the default value, NOTE : This patch doesn't solve the problem where the values which is set globally are being displayed in gluster volume info Change-Id: I61445b3d2a12eb68c38a19bea53b9051ad028050 BUG: 1145020 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8191 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8793 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Diffstat (limited to 'tests/bugs/bug-1113476.t')
-rw-r--r--tests/bugs/bug-1113476.t44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/bug-1113476.t b/tests/bugs/bug-1113476.t
new file mode 100644
index 00000000000..7cb9d908269
--- /dev/null
+++ b/tests/bugs/bug-1113476.t
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+. $(dirname $0)/../snapshot.rc
+
+function volinfo_validate ()
+{
+ local var=$1
+ $CLI volume info $V0 | grep "^$var" | sed 's/.*: //'
+}
+
+cleanup;
+
+TEST verify_lvm_version
+TEST glusterd
+TEST pidof glusterd
+TEST setup_lvm 1
+
+TEST $CLI volume create $V0 $H0:$L1
+TEST $CLI volume start $V0
+
+EXPECT '' volinfo_validate 'snap-max-hard-limit'
+EXPECT '' volinfo_validate 'snap-max-soft-limit'
+EXPECT '' volinfo_validate 'auto-delete'
+
+TEST $CLI snapshot config snap-max-hard-limit 100
+EXPECT '100' volinfo_validate 'snap-max-hard-limit'
+EXPECT '' volinfo_validate 'snap-max-soft-limit'
+EXPECT '' volinfo_validate 'auto-delete'
+
+TEST $CLI snapshot config snap-max-soft-limit 50
+EXPECT '100' volinfo_validate 'snap-max-hard-limit'
+EXPECT '50' volinfo_validate 'snap-max-soft-limit'
+EXPECT '' volinfo_validate 'auto-delete'
+
+TEST $CLI snapshot config auto-delete enable
+EXPECT '100' volinfo_validate 'snap-max-hard-limit'
+EXPECT '50' volinfo_validate 'snap-max-soft-limit'
+EXPECT 'enable' volinfo_validate 'auto-delete'
+
+cleanup;
+
+