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) {
|
|
|
|
testRequires(c, ExperimentalDaemon)
|
|
|
|
|
2015-07-20 02:55:40 -04:00
|
|
|
out, _ := dockerCmd(c, "version")
|
2015-05-21 13:48:36 -04:00
|
|
|
for _, line := range strings.Split(out, "\n") {
|
2016-10-06 10:09:54 -04:00
|
|
|
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
|
2015-10-22 20:22:23 -04:00
|
|
|
c.Assert(line, checker.Matches, "*true")
|
2016-10-06 10:09:54 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
c.Fatal(`"Experimental" not found in version output`)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerSuite) TestExperimentalVersionFalse(c *check.C) {
|
|
|
|
testRequires(c, NotExperimentalDaemon)
|
|
|
|
|
|
|
|
out, _ := dockerCmd(c, "version")
|
|
|
|
for _, line := range strings.Split(out, "\n") {
|
|
|
|
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
|
|
|
|
c.Assert(line, checker.Matches, "*false")
|
|
|
|
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
|
|
|
}
|