github.com/rumpl/bof@v23.0.0-rc.2+incompatible/integration/system/info_linux_test.go (about) 1 //go:build !windows 2 // +build !windows 3 4 package system // import "github.com/docker/docker/integration/system" 5 6 import ( 7 "context" 8 "net/http" 9 "testing" 10 11 req "github.com/docker/docker/testutil/request" 12 "gotest.tools/v3/assert" 13 is "gotest.tools/v3/assert/cmp" 14 ) 15 16 func TestInfoBinaryCommits(t *testing.T) { 17 defer setupTest(t)() 18 client := testEnv.APIClient() 19 20 info, err := client.Info(context.Background()) 21 assert.NilError(t, err) 22 23 assert.Check(t, "N/A" != info.ContainerdCommit.ID) 24 assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) 25 26 assert.Check(t, "N/A" != info.InitCommit.ID) 27 assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) 28 29 assert.Check(t, "N/A" != info.RuncCommit.ID) 30 assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) 31 } 32 33 func TestInfoAPIVersioned(t *testing.T) { 34 // Windows only supports 1.25 or later 35 36 res, body, err := req.Get("/v1.20/info") 37 assert.NilError(t, err) 38 assert.Check(t, is.DeepEqual(res.StatusCode, http.StatusOK)) 39 40 b, err := req.ReadBody(body) 41 assert.NilError(t, err) 42 43 out := string(b) 44 assert.Check(t, is.Contains(out, "ExecutionDriver")) 45 assert.Check(t, is.Contains(out, "not supported")) 46 }