mirror of https://github.com/docker/docs.git
35 lines
835 B
Bash
35 lines
835 B
Bash
#!/usr/bin/env bats
|
|
|
|
load ../mesos_helpers
|
|
|
|
function teardown() {
|
|
swarm_manage_cleanup
|
|
stop_mesos
|
|
stop_docker
|
|
}
|
|
|
|
@test "mesos - docker logs" {
|
|
start_docker_with_busybox 2
|
|
start_mesos
|
|
swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT
|
|
|
|
# make sure no container exist
|
|
run docker_swarm ps -qa
|
|
[ "${#lines[@]}" -eq 0 ]
|
|
|
|
# run a container with echo command
|
|
docker_swarm run -d -m 20m --name test_container busybox /bin/sh -c "echo hello world; echo hello docker; echo hello swarm"
|
|
|
|
# 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[0]}" == *"hello world"* ]]
|
|
[[ "${lines[1]}" == *"hello docker"* ]]
|
|
[[ "${lines[2]}" == *"hello swarm"* ]]
|
|
}
|