add test for compose ls

Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
aiordache 2020-09-07 11:23:55 +02:00
parent 50c99ed7f6
commit 19a707495f
1 changed files with 11 additions and 0 deletions

View File

@ -98,6 +98,17 @@ func TestCompose(t *testing.T) {
url = "http://" + strings.Replace(fields[3], "->80/http", "", 1)
})
t.Run("compose ls", func(t *testing.T) {
res := c.RunDockerCmd("compose", "ls", "--project-name", stack)
lines := strings.Split(res.Stdout(), "\n")
assert.Equal(t, 2, len(lines))
fields := strings.Fields(lines[1])
assert.Equal(t, 2, len(fields))
assert.Check(t, strings.Contains(fields[0], stack))
assert.Equal(t, "Running", fields[1])
})
t.Run("nginx GET", func(t *testing.T) {
checkUp := func(t poll.LogT) poll.Result {
r, err := http.Get(url)