Files
docker-docs/test/integration/api/logs.bats
Andrea Luzzardi c75992a3bd integration: faster. faster. faster.
- Use start_with_busybox everywhere it's possible.
- Start only what we need.
- Improved correctness of a few tests at the same time.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-06 10:51:07 -07:00

31 lines
691 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker logs" {
start_docker_with_busybox 2
swarm_manage
# run a container with echo command
run docker_swarm run -d --name test_container busybox /bin/sh -c "echo hello world; echo hello docker; echo hello swarm"
[ "$status" -eq 0 ]
# make sure container exists
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"test_container"* ]]
# verify
run docker_swarm logs test_container
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 3 ]
[[ "${lines[0]}" == *"hello world"* ]]
[[ "${lines[1]}" == *"hello docker"* ]]
[[ "${lines[2]}" == *"hello swarm"* ]]
}