summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2016-03-29 16:24:07 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-06-21 00:11:06 -0700
commita6e551122c603ab0cba798e7e2b30d3a15191b68 (patch)
tree270790caeac909da89ea9753c2048b7efb2c9ae4 /tests
parent4797ca3778d82a671716d4913c14f285591ae959 (diff)
Fix opRet value for volume info --xml call on non-existent volume
The opRet field was being assigned to 0 in the XML output when a gluster volume info --xml call is made on a non-existent volume. This change assigns a value of -1 to opRet for volume info calls for non-existent volumes. Other fields like opErrno and opErrstr are also assigned relevant values Change-Id: I3920c602328f74252c87bb521f5a43d4bdc7d44d BUG: 1321836 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: http://review.gluster.org/13843 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: darshan n <dnarayan@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/glusterd/bug-1321836-fix-opret-for-volume-info-xml-output.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/glusterd/bug-1321836-fix-opret-for-volume-info-xml-output.t b/tests/bugs/glusterd/bug-1321836-fix-opret-for-volume-info-xml-output.t
new file mode 100644
index 00000000000..48fccc621d8
--- /dev/null
+++ b/tests/bugs/glusterd/bug-1321836-fix-opret-for-volume-info-xml-output.t
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../cluster.rc
+
+## Check that opRet field has correct value assigned for non existent volumes
+## --------------------------------------------------------------------------
+
+function get_opret_value () {
+ local VOL=$1
+ $CLI volume info $VOL --xml | sed -ne 's/.*<opRet>\([-0-9]*\)<\/opRet>/\1/p'
+}
+
+cleanup;
+
+TEST glusterd;
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 $H0:$B0/$V0;
+
+EXPECT 0 get_opret_value $V0
+EXPECT -1 get_opret_value "novol"
+
+cleanup;