|
@@ -4,7 +4,7 @@ import (
|
|
|
"net/http"
|
|
|
"testing"
|
|
|
|
|
|
- "github.com/docker/docker/internal/test/daemon"
|
|
|
+ "github.com/docker/docker/api/types/versions"
|
|
|
req "github.com/docker/docker/internal/test/request"
|
|
|
"gotest.tools/assert"
|
|
|
is "gotest.tools/assert/cmp"
|
|
@@ -13,17 +13,10 @@ import (
|
|
|
|
|
|
func TestSessionCreate(t *testing.T) {
|
|
|
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
|
|
+ skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
|
|
|
|
|
|
defer setupTest(t)()
|
|
|
daemonHost := req.DaemonHost()
|
|
|
- if !testEnv.DaemonInfo.ExperimentalBuild {
|
|
|
- skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
|
|
-
|
|
|
- d := daemon.New(t, daemon.WithExperimental)
|
|
|
- d.StartWithBusybox(t)
|
|
|
- defer d.Stop(t)
|
|
|
- daemonHost = d.Sock()
|
|
|
- }
|
|
|
|
|
|
res, body, err := req.Post("/session",
|
|
|
req.Host(daemonHost),
|
|
@@ -41,17 +34,10 @@ func TestSessionCreate(t *testing.T) {
|
|
|
|
|
|
func TestSessionCreateWithBadUpgrade(t *testing.T) {
|
|
|
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
|
|
+ skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
|
|
|
|
|
|
defer setupTest(t)()
|
|
|
daemonHost := req.DaemonHost()
|
|
|
- if !testEnv.DaemonInfo.ExperimentalBuild {
|
|
|
- skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
|
|
-
|
|
|
- d := daemon.New(t, daemon.WithExperimental)
|
|
|
- d.StartWithBusybox(t)
|
|
|
- defer d.Stop(t)
|
|
|
- daemonHost = d.Sock()
|
|
|
- }
|
|
|
|
|
|
res, body, err := req.Post("/session", req.Host(daemonHost))
|
|
|
assert.NilError(t, err)
|