Skip to content

Commit b491a15

Browse files
committed
nit: update tests
Signed-off-by: Nate Bracy <[email protected]>
1 parent b5fa146 commit b491a15

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/nvidia-container-runtime/main_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func TestBadInput(t *testing.T) {
8888
t.Fatal(err)
8989
}
9090

91-
cmdCreate := exec.Command(oci.Escape1(nvidiaRuntime), oci.Escape([]string{"create", "--bundle"})...) //nolint:gosec
91+
cmdCreate := exec.Command(oci.EscapeArg(nvidiaRuntime), oci.Escape([]string{"create", "--bundle"})...) //nolint:gosec
9292
t.Logf("executing: %s\n", strings.Join(cmdCreate.Args, " "))
9393
err = cmdCreate.Run()
9494
require.Error(t, err, "runtime should return an error")
@@ -106,7 +106,7 @@ func TestGoodInput(t *testing.T) {
106106
}
107107

108108
//nolint:gosec
109-
cmdRun := exec.Command(oci.Escape1(nvidiaRuntime), oci.Escape([]string{"run", "--bundle", cfg.bundlePath(), "testcontainer"})...)
109+
cmdRun := exec.Command(oci.EscapeArg(nvidiaRuntime), oci.Escape([]string{"run", "--bundle", cfg.bundlePath(), "testcontainer"})...)
110110
t.Logf("executing: %s\n", strings.Join(cmdRun.Args, " "))
111111
output, err := cmdRun.CombinedOutput()
112112
require.NoErrorf(t, err, "runtime should not return an error", "output=%v", string(output))
@@ -117,7 +117,7 @@ func TestGoodInput(t *testing.T) {
117117
require.Empty(t, spec.Hooks, "there should be no hooks in config.json")
118118

119119
//nolint:gosec
120-
cmdCreate := exec.Command(oci.Escape1(nvidiaRuntime), oci.Escape([]string{"create", "--bundle", cfg.bundlePath(), "testcontainer"})...)
120+
cmdCreate := exec.Command(oci.EscapeArg(nvidiaRuntime), oci.Escape([]string{"create", "--bundle", cfg.bundlePath(), "testcontainer"})...)
121121
t.Logf("executing: %s\n", strings.Join(cmdCreate.Args, " "))
122122
err = cmdCreate.Run()
123123
require.NoError(t, err, "runtime should not return an error")
@@ -162,7 +162,7 @@ func TestDuplicateHook(t *testing.T) {
162162

163163
// Test how runtime handles already existing prestart hook in config.json
164164
//nolint:gosec
165-
cmdCreate := exec.Command(oci.Escape1(nvidiaRuntime), oci.Escape([]string{"create", "--bundle", cfg.bundlePath(), "testcontainer"})...)
165+
cmdCreate := exec.Command(oci.EscapeArg(nvidiaRuntime), oci.Escape([]string{"create", "--bundle", cfg.bundlePath(), "testcontainer"})...)
166166
t.Logf("executing: %s\n", strings.Join(cmdCreate.Args, " "))
167167
output, err := cmdCreate.CombinedOutput()
168168
require.NoErrorf(t, err, "runtime should not return an error", "output=%v", string(output))
@@ -231,7 +231,7 @@ func (c testConfig) generateNewRuntimeSpec() error {
231231
}
232232

233233
//nolint:gosec
234-
cmd := exec.Command(oci.Escape1("cp"), oci.Escape([]string{c.unmodifiedSpecFile(), c.specFilePath()})...)
234+
cmd := exec.Command(oci.EscapeArg("cp"), oci.Escape([]string{c.unmodifiedSpecFile(), c.specFilePath()})...)
235235
err = cmd.Run()
236236
if err != nil {
237237
return err

0 commit comments

Comments
 (0)