|
@@ -3,15 +3,17 @@
|
|
package system
|
|
package system
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "net/http"
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
|
|
+ req "github.com/docker/docker/integration-cli/request"
|
|
"github.com/docker/docker/integration/util/request"
|
|
"github.com/docker/docker/integration/util/request"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/stretchr/testify/require"
|
|
"golang.org/x/net/context"
|
|
"golang.org/x/net/context"
|
|
)
|
|
)
|
|
|
|
|
|
-func TestInfo_BinaryCommits(t *testing.T) {
|
|
|
|
|
|
+func TestInfoBinaryCommits(t *testing.T) {
|
|
client := request.NewAPIClient(t)
|
|
client := request.NewAPIClient(t)
|
|
|
|
|
|
info, err := client.Info(context.Background())
|
|
info, err := client.Info(context.Background())
|
|
@@ -32,3 +34,18 @@ func TestInfo_BinaryCommits(t *testing.T) {
|
|
assert.Equal(t, testEnv.DaemonInfo.RuncCommit.Expected, info.RuncCommit.Expected)
|
|
assert.Equal(t, testEnv.DaemonInfo.RuncCommit.Expected, info.RuncCommit.Expected)
|
|
assert.Equal(t, info.RuncCommit.Expected, info.RuncCommit.ID)
|
|
assert.Equal(t, info.RuncCommit.Expected, info.RuncCommit.ID)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func TestInfoAPIVersioned(t *testing.T) {
|
|
|
|
+ // Windows only supports 1.25 or later
|
|
|
|
+
|
|
|
|
+ res, body, err := req.Get("/v1.20/info")
|
|
|
|
+ require.NoError(t, err)
|
|
|
|
+ assert.Equal(t, res.StatusCode, http.StatusOK)
|
|
|
|
+
|
|
|
|
+ b, err := req.ReadBody(body)
|
|
|
|
+ require.NoError(t, err)
|
|
|
|
+
|
|
|
|
+ out := string(b)
|
|
|
|
+ assert.Contains(t, out, "ExecutionDriver")
|
|
|
|
+ assert.Contains(t, out, "not supported")
|
|
|
|
+}
|