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