Files
docker-docs/test/integration/api/top.bats
Andrea Luzzardi 4bb035e41a integration: Fix API races related to delay in refresh.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-08 19:26:58 -07:00

26 lines
579 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker top" {
start_docker_with_busybox 2
swarm_manage
docker_swarm run -d --name test_container busybox sleep 500
# make sure container is running
# FIXME(#748): Retry required because of race condition.
retry 5 0.5 eval "[ $(docker_swarm inspect -f '{{ .State.Running }}' test_container) == 'true' ]"
run docker_swarm top test_container
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *"UID"* ]]
[[ "${lines[0]}" == *"CMD"* ]]
[[ "${lines[1]}" == *"sleep 500"* ]]
}