summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2016-03-29 16:24:07 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-07-06 21:17:50 -0700
commit1b5ed7e2ee3a3ac7d85e649b4ed3adc170f3a9a1 (patch)
treebe93c4519e98cfc51a8eb5c39a6fe6e6473a3a8a /tests/bugs
parent4c012e223f89f9515cd3f8ebec1197ec1594218c (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 > 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> (cherry picked from commit a6e551122c603ab0cba798e7e2b30d3a15191b68) Change-Id: I3920c602328f74252c87bb521f5a43d4bdc7d44d BUG: 1352880 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: http://review.gluster.org/14863 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'tests/bugs')
-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;