From f7ecbce39a37bb0d2dabdab317bfc5c30d2e3e6b Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Thu, 22 Feb 2018 14:06:06 +0000 Subject: [PATCH] Fix test running in non-bash shells --- agent/watch_handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/watch_handler_test.go b/agent/watch_handler_test.go index ca98e17a9..f7ba83b0a 100644 --- a/agent/watch_handler_test.go +++ b/agent/watch_handler_test.go @@ -15,7 +15,7 @@ func TestMakeWatchHandler(t *testing.T) { t.Parallel() defer os.Remove("handler_out") defer os.Remove("handler_index_out") - script := "echo $CONSUL_INDEX >> handler_index_out && cat >> handler_out" + script := "bash -c 'echo $CONSUL_INDEX >> handler_index_out && cat >> handler_out'" handler := makeWatchHandler(os.Stderr, script) handler(100, []string{"foo", "bar", "baz"}) raw, err := ioutil.ReadFile("handler_out")