2015-04-16 19:48:04 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
2015-04-20 21:03:56 +00:00
|
|
|
"net/http"
|
2015-04-16 19:48:04 +00:00
|
|
|
|
2016-09-06 18:18:12 +00:00
|
|
|
"github.com/docker/docker/api/types"
|
2015-11-09 18:32:46 +00:00
|
|
|
"github.com/docker/docker/dockerversion"
|
2015-10-15 17:15:24 +00:00
|
|
|
"github.com/docker/docker/pkg/integration/checker"
|
2015-04-18 16:46:47 +00:00
|
|
|
"github.com/go-check/check"
|
2015-04-16 19:48:04 +00:00
|
|
|
)
|
|
|
|
|
2015-04-18 16:46:47 +00:00
|
|
|
func (s *DockerSuite) TestGetVersion(c *check.C) {
|
2015-04-20 21:03:56 +00:00
|
|
|
status, body, err := sockRequest("GET", "/version", nil)
|
2015-10-15 17:15:24 +00:00
|
|
|
c.Assert(status, checker.Equals, http.StatusOK)
|
|
|
|
c.Assert(err, checker.IsNil)
|
2015-04-20 21:03:56 +00:00
|
|
|
|
2015-04-16 19:48:04 +00:00
|
|
|
var v types.Version
|
|
|
|
|
2015-10-15 17:15:24 +00:00
|
|
|
c.Assert(json.Unmarshal(body, &v), checker.IsNil)
|
|
|
|
|
2015-11-09 18:32:46 +00:00
|
|
|
c.Assert(v.Version, checker.Equals, dockerversion.Version, check.Commentf("Version mismatch"))
|
2015-04-16 19:48:04 +00:00
|
|
|
}
|