mirror of https://github.com/docker/docs.git
add attach-diff-port-top integration test
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
parent
fc692741d7
commit
5841d0f98e
|
@ -10,12 +10,15 @@ function teardown() {
|
|||
@test "docker attach" {
|
||||
start_docker 3
|
||||
swarm_manage
|
||||
|
||||
# container run in background
|
||||
run docker_swarm run -d --name test_container busybox sleep 100
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# make sure container is up
|
||||
run docker_swarm ps -l
|
||||
# make sure container is up
|
||||
run docker_swarm ps -l
|
||||
[ "${#lines[@]}" -eq 2 ]
|
||||
[[ "${lines[1]}" == *"test_container"* ]]
|
||||
[[ "${lines[1]}" == *"Up"* ]]
|
||||
|
||||
# attach to running container
|
||||
|
@ -63,12 +66,18 @@ function teardown() {
|
|||
# make sure container is up
|
||||
run docker_swarm ps -l
|
||||
[ "${#lines[@]}" -eq 2 ]
|
||||
[[ "${lines[1]}" == *"test_container"* ]]
|
||||
[[ "${lines[1]}" == *"Up"* ]]
|
||||
|
||||
|
||||
# no changs
|
||||
run docker_swarm diff test_container
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 0 ]
|
||||
|
||||
# make changes on container's filesystem
|
||||
run docker_swarm exec test_container touch /home/diff.txt
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# verify
|
||||
run docker_swarm diff test_container
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[*]}" == *"diff.txt"* ]]
|
||||
|
@ -147,13 +156,16 @@ function teardown() {
|
|||
swarm_manage
|
||||
run docker_swarm run -d -p 8000 --name test_container busybox sleep 500
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
|
||||
# make sure container is up
|
||||
run docker_swarm ps -l
|
||||
[ "${#lines[@]}" -eq 2 ]
|
||||
[[ "${lines[1]}" == *"test_container"* ]]
|
||||
[[ "${lines[1]}" == *"Up"* ]]
|
||||
|
||||
# port verify
|
||||
run docker_swarm port test_container
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[*]}" == *"8000"* ]]
|
||||
}
|
||||
|
||||
|
@ -198,23 +210,9 @@ function teardown() {
|
|||
[[ "${lines[1]}" == *"false"* ]]
|
||||
}
|
||||
|
||||
# FIXME
|
||||
@test "docker pull" {
|
||||
start_docker 3
|
||||
swarm_manage
|
||||
run docker_swarm pull busybox
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# docker_swarm verify
|
||||
run docker_swarm images
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[*]}" == *"busybox"* ]]
|
||||
|
||||
# node verify
|
||||
for host in ${HOSTS[@]}; do
|
||||
run docker -H $host images
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[*]}" == *"busybox"* ]]
|
||||
done
|
||||
skip
|
||||
}
|
||||
|
||||
# FIXME
|
||||
|
@ -286,11 +284,14 @@ function teardown() {
|
|||
# make sure container is running
|
||||
run docker_swarm ps -l
|
||||
[ "${#lines[@]}" -eq 2 ]
|
||||
[[ "${lines[1]}" == *"test_container"* ]]
|
||||
[[ "${lines[1]}" == *"Up"* ]]
|
||||
|
||||
run docker_swarm top test_container
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" == *"UID"* ]]
|
||||
[[ "${lines[0]}" == *"UID"* ]]
|
||||
[[ "${lines[0]}" == *"CMD"* ]]
|
||||
[[ "${lines[1]}" == *"sleep 500"* ]]
|
||||
}
|
||||
|
||||
# FIXME
|
||||
|
|
Loading…
Reference in New Issue