podman
1# -*- sh -*-
2
3podman pull $IMAGE &>/dev/null4
5# Test various HostConfig options
6tmpfs_name="/mytmpfs"7t POST containers/create?name=hostconfig_test \8Image=$IMAGE \9Cmd='["df","-P","'$tmpfs_name'"]' \10HostConfig='{"Binds":["/tmp/doesnotexist:/test1"]' \11TmpFs="{\"$tmpfs_name\":\"rw\"}}" \12201 \13.Id~[0-9a-f]\\{64\\}14cid=$(jq -r '.Id' <<<"$output")15
16# Prior to #9512, the tmpfs would be called '/mytmpfs=rw', with the '=rw'
17t GET containers/${cid}/json 200 \18.HostConfig.Tmpfs[\"${tmpfs_name}\"]~rw,19
20# Run the container, verify output
21t POST containers/${cid}/start 20422t POST containers/${cid}/wait 20023t GET containers/${cid}/logs?stdout=true 20024
25# /logs returns application/octet-stream, which our test helper saves in
26# an outfile rather than returning in $output. That's why we can't test
27# this directly in the /logs test above; instead, we rely on knowing the
28# path to the stored results. The 'tr' is needed because there may be
29# null bytes in the outfile.
30like "$(tr -d \\0 <$WORKDIR/curl.result.out)" ".* ${tmpfs_name}" \31"'df' output includes tmpfs name"32