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