fix version handling in e2e tests
Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
parent
3f75344053
commit
f0fd525a24
@ -268,10 +268,12 @@ func (self dockerActions) Run(args DockerRunArgs, cmd ...string) string {
|
|||||||
func (self dockerActions) Version() []string {
|
func (self dockerActions) Version() []string {
|
||||||
dockerCommand := []string{"docker", "version", "-f", "'{{.Server.Version}}'"}
|
dockerCommand := []string{"docker", "version", "-f", "'{{.Server.Version}}'"}
|
||||||
output, _ := self.fm.Shell().Run("sudo", dockerCommand...)
|
output, _ := self.fm.Shell().Run("sudo", dockerCommand...)
|
||||||
if len(output) != 1 {
|
output = strings.TrimSpace(output)
|
||||||
self.fm.T().Fatalf("need 1 arguments in output %v to get the version but have %v", output, len(output))
|
ret := strings.Split(output, ".")
|
||||||
|
if len(ret) != 3 {
|
||||||
|
self.fm.T().Fatalf("invalid version %v", output)
|
||||||
}
|
}
|
||||||
return strings.Split(output, ".")
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self dockerActions) StorageDriver() string {
|
func (self dockerActions) StorageDriver() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user