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