2015-05-21 17:48:36 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-10-06 14:09:54 +00:00
|
|
|
"strings"
|
|
|
|
|
2016-12-30 17:23:00 +00:00
|
|
|
"github.com/docker/docker/integration-cli/checker"
|
2015-05-21 17:48:36 +00:00
|
|
|
"github.com/go-check/check"
|
|
|
|
)
|
|
|
|
|
2016-10-06 14:09:54 +00:00
|
|
|
func (s *DockerSuite) TestExperimentalVersionTrue(c *check.C) {
|
2017-01-02 22:42:45 +00:00
|
|
|
testExperimentalInVersion(c, ExperimentalDaemon, "*true")
|
2016-10-06 14:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerSuite) TestExperimentalVersionFalse(c *check.C) {
|
2017-01-02 22:42:45 +00:00
|
|
|
testExperimentalInVersion(c, NotExperimentalDaemon, "*false")
|
|
|
|
}
|
2016-10-06 14:09:54 +00:00
|
|
|
|
2017-01-02 22:42:45 +00:00
|
|
|
func testExperimentalInVersion(c *check.C, requirement func() bool, expectedValue string) {
|
|
|
|
testRequires(c, requirement)
|
2016-10-06 14:09:54 +00:00
|
|
|
out, _ := dockerCmd(c, "version")
|
|
|
|
for _, line := range strings.Split(out, "\n") {
|
|
|
|
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
|
2017-01-02 22:42:45 +00:00
|
|
|
c.Assert(line, checker.Matches, expectedValue)
|
2016-10-06 14:09:54 +00:00
|
|
|
return
|
2015-05-21 17:48:36 +00:00
|
|
|
}
|
|
|
|
}
|
2015-05-29 00:59:07 +00:00
|
|
|
|
2016-10-06 14:09:54 +00:00
|
|
|
c.Fatal(`"Experimental" not found in version output`)
|
2015-05-21 17:48:36 +00:00
|
|
|
}
|