blob: d54669e7d0c084d3fc05492355774fc50320ccbe (
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
|
# -*- sh -*-
podman pull $IMAGE &>/dev/null
# Test various HostConfig options
tmpfs_name="/mytmpfs"
t POST containers/create?name=hostconfig_test \
Image=$IMAGE \
Cmd='["df","-P","'$tmpfs_name'"]' \
HostConfig='{"Binds":["/tmp/doesnotexist:/test1"]' \
TmpFs="{\"$tmpfs_name\":\"rw\"}}" \
201 \
.Id~[0-9a-f]\\{64\\}
cid=$(jq -r '.Id' <<<"$output")
# Prior to #9512, the tmpfs would be called '/mytmpfs=rw', with the '=rw'
t GET containers/${cid}/json 200 \
.HostConfig.Tmpfs[\"${tmpfs_name}\"]~rw,
# Run the container, verify output
t POST containers/${cid}/start 204
t POST containers/${cid}/wait 200
t GET containers/${cid}/logs?stdout=true 200
# /logs returns application/octet-stream, which our test helper saves in
# an outfile rather than returning in $output. That's why we can't test
# this directly in the /logs test above; instead, we rely on knowing the
# path to the stored results. The 'tr' is needed because there may be
# null bytes in the outfile.
like "$(tr -d \\0 <$WORKDIR/curl.result.out)" ".* ${tmpfs_name}" \
"'df' output includes tmpfs name"
|