github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/integration/system/info_linux_test.go (about)

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