reg/vendor/github.com/docker/docker-ce/components/engine/integration/system/info_linux_test.go
Jess Frazelle ab6c553e6b
update deps
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-03-06 10:41:43 -05: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")
}