X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8094a4b4914d892461b2a6fbcbeb10b938a6733b..1e9e1e556f51abaa2f001b1c280f1d4a09ca75e2:/services/crunch-dispatch-slurm/script_test.go diff --git a/services/crunch-dispatch-slurm/script_test.go b/services/crunch-dispatch-slurm/script_test.go index 3cb407dbb0..bba9a05755 100644 --- a/services/crunch-dispatch-slurm/script_test.go +++ b/services/crunch-dispatch-slurm/script_test.go @@ -1,4 +1,8 @@ -package main +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +package dispatchslurm import ( . "gopkg.in/check.v1" @@ -19,6 +23,7 @@ func (s *ScriptSuite) TestExecScript(c *C) { {[]string{`foo"`, "'waz 'qux\n"}, `exec 'foo"' ''\''waz '\''qux` + "\n" + `'`}, } { c.Logf("%+v -> %+v", test.args, test.script) - c.Check(execScript(test.args), Equals, "#!/bin/sh\n"+test.script+"\n") + c.Check(execScript(test.args, nil), Equals, "#!/bin/sh\n"+test.script+"\n") } + c.Check(execScript([]string{"sh", "-c", "echo $foo"}, map[string]string{"foo": "b'ar"}), Equals, "#!/bin/sh\nfoo='b'\\''ar' exec 'sh' '-c' 'echo $foo'\n") }