-
Notifications
You must be signed in to change notification settings - Fork 1
/
unpause.bats
37 lines (30 loc) · 949 Bytes
/
unpause.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bats
load helpers
function teardown(){
swarm_manage_cleanup
stop_docker
}
@test "docker pause a running container should return success" {
start_docker 3
swarm_manage
run docker_swarm run -d --name test_container busybox sleep 1000
[ "$status" -eq 0 ]
# make sure container is up
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"Up"* ]]
# pause
run docker_swarm pause test_container
[ "$status" -eq 0 ]
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"Paused"* ]]
# unpause
run docker_swarm unpause test_container
[ "$status" -eq 0 ]
# verify
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"Up"* ]]
[[ "${lines[1]}" != *"Paused"* ]]
}