2014-02-25 11:17:48 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
2015-04-18 12:46:47 -04:00
|
|
|
|
|
|
|
"github.com/go-check/check"
|
2014-02-25 11:17:48 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// ensure docker version works
|
2015-04-18 12:46:47 -04:00
|
|
|
func (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) {
|
2015-07-20 02:44:22 -04:00
|
|
|
out, _ := dockerCmd(c, "version")
|
2015-06-19 13:03:13 -04:00
|
|
|
stringsToCheck := map[string]int{
|
|
|
|
"Client:": 1,
|
|
|
|
"Server:": 1,
|
|
|
|
" Version:": 2,
|
|
|
|
" API version:": 2,
|
|
|
|
" Go version:": 2,
|
|
|
|
" Git commit:": 2,
|
|
|
|
" OS/Arch:": 2,
|
|
|
|
" Built:": 2,
|
2014-04-01 20:30:02 -04:00
|
|
|
}
|
2014-02-25 11:17:48 -05:00
|
|
|
|
2015-06-19 13:03:13 -04:00
|
|
|
for k, v := range stringsToCheck {
|
|
|
|
if strings.Count(out, k) != v {
|
|
|
|
c.Errorf("%v expected %d instances found %d", k, v, strings.Count(out, k))
|
2014-02-25 11:17:48 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|