a0bf80fe | package main import ( "encoding/json" |
c7845e27 | "net/http" |
a0bf80fe | "github.com/docker/docker/api/types" "github.com/docker/docker/autogen/dockerversion" |
dc944ea7 | "github.com/go-check/check" |
a0bf80fe | ) |
dc944ea7 | func (s *DockerSuite) TestGetVersion(c *check.C) { |
c7845e27 | status, body, err := sockRequest("GET", "/version", nil) c.Assert(status, check.Equals, http.StatusOK) c.Assert(err, check.IsNil) |
a0bf80fe | var v types.Version if err := json.Unmarshal(body, &v); err != nil { |
dc944ea7 | c.Fatal(err) |
a0bf80fe | } if v.Version != dockerversion.VERSION { |
dc944ea7 | c.Fatal("Version mismatch") |
a0bf80fe | } } |