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>
This commit is contained in:
Jacob Howard 2025-08-29 18:06:10 -06:00
parent fec154ead1
commit 08ba6d8f78
No known key found for this signature in database
GPG Key ID: 3E8B8F7FEB46FC66
1 changed files with 8 additions and 1 deletions

View File

@ -1,12 +1,19 @@
package sandbox
import (
"runtime"
"testing"
)
// TestSandbox performs basic sandbox testing.
func TestSandbox(t *testing.T) {
sandbox, err := New(t.Context(), ConfigurationLlamaCpp, nil, "date")
var sandbox Sandbox
var err error
if runtime.GOOS == "windows" {
sandbox, err = New(t.Context(), ConfigurationLlamaCpp, nil, "go", "version")
} else {
sandbox, err = New(t.Context(), ConfigurationLlamaCpp, nil, "date")
}
if err != nil {
t.Fatal("unable to create sandboxed process:", err)
}