|
@@ -4,6 +4,7 @@ import (
|
|
|
"io/ioutil"
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
+ "runtime"
|
|
|
"testing"
|
|
|
|
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
@@ -16,6 +17,7 @@ import (
|
|
|
"github.com/docker/docker/volume/local"
|
|
|
"github.com/docker/docker/volume/store"
|
|
|
"github.com/docker/go-connections/nat"
|
|
|
+ "github.com/stretchr/testify/assert"
|
|
|
)
|
|
|
|
|
|
//
|
|
@@ -302,3 +304,10 @@ func TestMerge(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TestValidateContainerIsolation(t *testing.T) {
|
|
|
+ d := Daemon{}
|
|
|
+
|
|
|
+ _, err := d.verifyContainerSettings(runtime.GOOS, &containertypes.HostConfig{Isolation: containertypes.Isolation("invalid")}, nil, false)
|
|
|
+ assert.EqualError(t, err, "invalid isolation 'invalid' on "+runtime.GOOS)
|
|
|
+}
|