mirror of https://github.com/docker/docs.git
35 lines
736 B
Bash
35 lines
736 B
Bash
#!/usr/bin/env bats
|
|
|
|
load ../helpers
|
|
|
|
function teardown() {
|
|
swarm_manage_cleanup
|
|
stop_docker
|
|
}
|
|
|
|
@test "docker diff" {
|
|
start_docker_with_busybox 2
|
|
swarm_manage
|
|
run docker_swarm run -d --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"* ]]
|
|
|
|
# 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"* ]]
|
|
}
|