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