1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration/system/info_linux_test.go
Vincent Demeester af306d149e
Rename integration/util to integration/internal
Both names have no real sense, but one allows to make sure these packages
aren't used outside of `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 09:16:32 +01:00

51 lines
1.5 KiB
Go

// +build !windows
package system // import "github.com/docker/docker/integration/system"
import (
"net/http"
"testing"
req "github.com/docker/docker/integration-cli/request"
"github.com/docker/docker/integration/internal/request"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
func TestInfoBinaryCommits(t *testing.T) {
client := request.NewAPIClient(t)
info, err := client.Info(context.Background())
require.NoError(t, err)
assert.NotNil(t, info.ContainerdCommit)
assert.NotEqual(t, "N/A", info.ContainerdCommit.ID)
assert.Equal(t, testEnv.DaemonInfo.ContainerdCommit.Expected, info.ContainerdCommit.Expected)
assert.Equal(t, info.ContainerdCommit.Expected, info.ContainerdCommit.ID)
assert.NotNil(t, info.InitCommit)
assert.NotEqual(t, "N/A", info.InitCommit.ID)
assert.Equal(t, testEnv.DaemonInfo.InitCommit.Expected, info.InitCommit.Expected)
assert.Equal(t, info.InitCommit.Expected, info.InitCommit.ID)
assert.NotNil(t, info.RuncCommit)
assert.NotEqual(t, "N/A", info.RuncCommit.ID)
assert.Equal(t, testEnv.DaemonInfo.RuncCommit.Expected, info.RuncCommit.Expected)
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")
}