summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-03-08 13:31:28 +0100
committerNiels de Vos <ndevos@redhat.com>2016-03-11 08:59:04 -0800
commit2492bbc3bb8a115be0b0a6fe85fd42f906df8395 (patch)
tree38258593807b3b88f0370fa11b2ad2e250dd34d1
parent206ccaa4f417da633af3860a3ffae896d517fdd0 (diff)
cli: Don't override cli mode when stdin in not a tty
Cherry picked from commit f139fc7e44da27670e90bd7ba55ff80e7c8b8ecd: > Change-Id: I801c6e6ecd6c5a91e487e8e54ec5f684d450a080 > BUG: 1047378 > Signed-off-by: Kaushal M <kaushal@redhat.com> > Reviewed-on: http://review.gluster.org/6687 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> Change-Id: I801c6e6ecd6c5a91e487e8e54ec5f684d450a080 BUG: 1313968 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/13648 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
-rw-r--r--cli/src/input.c2
-rw-r--r--tests/bugs/bug-1047378.t12
2 files changed, 13 insertions, 1 deletions
diff --git a/cli/src/input.c b/cli/src/input.c
index a8ea46c..26f337c 100644
--- a/cli/src/input.c
+++ b/cli/src/input.c
@@ -87,7 +87,7 @@ cli_input_init (struct cli_state *state)
cli_rl_enable (state);
} else {
state->prompt = "";
- state->mode = GLUSTER_MODE_SCRIPT | GLUSTER_MODE_ERR_FATAL;
+ state->mode |= GLUSTER_MODE_SCRIPT | GLUSTER_MODE_ERR_FATAL;
}
if (!state->rl_enabled)
diff --git a/tests/bugs/bug-1047378.t b/tests/bugs/bug-1047378.t
new file mode 100644
index 0000000..b441ee9
--- /dev/null
+++ b/tests/bugs/bug-1047378.t
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd
+
+TEST "echo volume list | $CLI --xml | xmllint --format -"
+
+cleanup