19166: Pass GatewayAuthSecret to crunch-run through lsf/slurm.
[arvados.git] / services / crunch-dispatch-slurm / script_test.go
index 3cb407dbb0765681bddcb1c96527feb7d24086b4..bba9a05755cb36ec9848d11b17bc0187657e87d3 100644 (file)
@@ -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")
 }