Skip to content

Commit 08ba6d8

Browse files
committed
sandbox: fix up test to be Windows-portable
We have to be a little careful what we choose on each platform since we're using a fairly strict sandboxing profile. Signed-off-by: Jacob Howard <jacob.howard@docker.com>
1 parent fec154e commit 08ba6d8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/sandbox/sandbox_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
package sandbox
22

33
import (
4+
"runtime"
45
"testing"
56
)
67

78
// TestSandbox performs basic sandbox testing.
89
func TestSandbox(t *testing.T) {
9-
sandbox, err := New(t.Context(), ConfigurationLlamaCpp, nil, "date")
10+
var sandbox Sandbox
11+
var err error
12+
if runtime.GOOS == "windows" {
13+
sandbox, err = New(t.Context(), ConfigurationLlamaCpp, nil, "go", "version")
14+
} else {
15+
sandbox, err = New(t.Context(), ConfigurationLlamaCpp, nil, "date")
16+
}
1017
if err != nil {
1118
t.Fatal("unable to create sandboxed process:", err)
1219
}

0 commit comments

Comments
 (0)