summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2014-01-13 12:42:31 +0530
committerVijay Bellur <vbellur@redhat.com>2014-01-14 22:27:09 -0800
commitf139fc7e44da27670e90bd7ba55ff80e7c8b8ecd (patch)
tree609898c55cc787366a231bddadaabc60dc0451fb
parent2f499e85a4ae0ac1e84785daa60a5bbfe979cc7f (diff)
cli: Don't override cli mode when stdin in not a tty
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>
-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