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:
parent
fec154ead1
commit
08ba6d8f78
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue