@@ -88,7 +88,7 @@ func TestBadInput(t *testing.T) {
88
88
t .Fatal (err )
89
89
}
90
90
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
92
92
t .Logf ("executing: %s\n " , strings .Join (cmdCreate .Args , " " ))
93
93
err = cmdCreate .Run ()
94
94
require .Error (t , err , "runtime should return an error" )
@@ -106,7 +106,7 @@ func TestGoodInput(t *testing.T) {
106
106
}
107
107
108
108
//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" })... )
110
110
t .Logf ("executing: %s\n " , strings .Join (cmdRun .Args , " " ))
111
111
output , err := cmdRun .CombinedOutput ()
112
112
require .NoErrorf (t , err , "runtime should not return an error" , "output=%v" , string (output ))
@@ -117,7 +117,7 @@ func TestGoodInput(t *testing.T) {
117
117
require .Empty (t , spec .Hooks , "there should be no hooks in config.json" )
118
118
119
119
//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" })... )
121
121
t .Logf ("executing: %s\n " , strings .Join (cmdCreate .Args , " " ))
122
122
err = cmdCreate .Run ()
123
123
require .NoError (t , err , "runtime should not return an error" )
@@ -162,7 +162,7 @@ func TestDuplicateHook(t *testing.T) {
162
162
163
163
// Test how runtime handles already existing prestart hook in config.json
164
164
//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" })... )
166
166
t .Logf ("executing: %s\n " , strings .Join (cmdCreate .Args , " " ))
167
167
output , err := cmdCreate .CombinedOutput ()
168
168
require .NoErrorf (t , err , "runtime should not return an error" , "output=%v" , string (output ))
@@ -231,7 +231,7 @@ func (c testConfig) generateNewRuntimeSpec() error {
231
231
}
232
232
233
233
//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 ()})... )
235
235
err = cmd .Run ()
236
236
if err != nil {
237
237
return err
0 commit comments