summaryrefslogtreecommitdiff
path: root/test/apiv2/25-containersMore.at
blob: 9cdc2a33f5e1e5500de9a319be9e5b02c1f01317 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- sh -*-
#
# test more container-related endpoints
#

podman pull $IMAGE &>/dev/null

# Ensure clean slate
podman rm -a -f &>/dev/null

podman run -d --name foo $IMAGE top

# Check exists for none such
t GET libpod/containers/nonesuch/exists 404

# Check container foo exists
t GET libpod/containers/foo/exists 204

# Pause the container
t POST libpod/containers/foo/pause 204

t GET libpod/containers/foo/json 200 \
  .Id~[0-9a-f]\\{64\\} \
  .State.Status=paused \
  .ImageName=$IMAGE \
  .Config.Cmd[0]=top \
  .Name=foo

# Unpause the container
t POST libpod/containers/foo/unpause 204

t GET libpod/containers/foo/json 200 \
  .Id~[0-9a-f]\\{64\\} \
  .State.Status=running \
  .ImageName=$IMAGE \
  .Config.Cmd[0]=top \
  .Name=foo

# List processes of the container
t GET libpod/containers/foo/top 200 \
  length=2 \
  .Processes[0][7]="top"

# List processes of none such
t GET libpod/containers/nonesuch/top 404

# Mount the container to host filesystem
t POST libpod/containers/foo/mount 200
like "$output" ".*merged" "Check container mount"

# Unmount the container
t POST libpod/containers/foo/unmount 204

t DELETE libpod/containers/foo?force=true 200

# Create 3 stopped containers to test containers prune
podman run $IMAGE true
podman run $IMAGE true
podman run $IMAGE true

t POST libpod/containers/prune 200
t GET libpod/containers/json 200 \
  length=0
# vim: filetype=sh