2017-12-11 19:00:43 -05:00
|
|
|
// +build !windows
|
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package system // import "github.com/docker/docker/integration/system"
|
2017-12-11 19:00:43 -05:00
|
|
|
|
|
|
|
import (
|
2018-04-19 18:30:59 -04:00
|
|
|
"context"
|
2018-02-07 13:23:31 -05:00
|
|
|
"net/http"
|
2017-12-11 19:00:43 -05:00
|
|
|
"testing"
|
|
|
|
|
2019-08-29 16:52:40 -04:00
|
|
|
req "github.com/docker/docker/testutil/request"
|
2018-06-11 09:32:11 -04:00
|
|
|
"gotest.tools/assert"
|
|
|
|
is "gotest.tools/assert/cmp"
|
2017-12-11 19:00:43 -05:00
|
|
|
)
|
|
|
|
|
2018-02-07 13:23:31 -05:00
|
|
|
func TestInfoBinaryCommits(t *testing.T) {
|
2019-01-02 08:16:25 -05:00
|
|
|
defer setupTest(t)()
|
|
|
|
client := testEnv.APIClient()
|
2017-12-11 19:00:43 -05:00
|
|
|
|
|
|
|
info, err := client.Info(context.Background())
|
2018-03-13 15:28:34 -04:00
|
|
|
assert.NilError(t, err)
|
|
|
|
|
|
|
|
assert.Check(t, "N/A" != info.ContainerdCommit.ID)
|
|
|
|
assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID))
|
|
|
|
|
|
|
|
assert.Check(t, "N/A" != info.InitCommit.ID)
|
|
|
|
assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID))
|
|
|
|
|
|
|
|
assert.Check(t, "N/A" != info.RuncCommit.ID)
|
|
|
|
assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID))
|
2017-12-11 19:00:43 -05:00
|
|
|
}
|
2018-02-07 13:23:31 -05:00
|
|
|
|
|
|
|
func TestInfoAPIVersioned(t *testing.T) {
|
|
|
|
// Windows only supports 1.25 or later
|
|
|
|
|
|
|
|
res, body, err := req.Get("/v1.20/info")
|
2018-03-13 15:28:34 -04:00
|
|
|
assert.NilError(t, err)
|
|
|
|
assert.Check(t, is.DeepEqual(res.StatusCode, http.StatusOK))
|
2018-02-07 13:23:31 -05:00
|
|
|
|
|
|
|
b, err := req.ReadBody(body)
|
2018-03-13 15:28:34 -04:00
|
|
|
assert.NilError(t, err)
|
2018-02-07 13:23:31 -05:00
|
|
|
|
|
|
|
out := string(b)
|
2018-03-13 15:28:34 -04:00
|
|
|
assert.Check(t, is.Contains(out, "ExecutionDriver"))
|
|
|
|
assert.Check(t, is.Contains(out, "not supported"))
|
2018-02-07 13:23:31 -05:00
|
|
|
}
|