github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/test/apiv2/44-mounts.at (about) 1 # -*- sh -*- 2 3 podman pull $IMAGE &>/dev/null 4 5 # Test various HostConfig options 6 tmpfs_name="/mytmpfs" 7 t POST containers/create?name=hostconfig_test \ 8 Image=$IMAGE \ 9 Cmd='["df","-P","'$tmpfs_name'"]' \ 10 HostConfig='{"Binds":["/tmp/doesnotexist:/test1"]' \ 11 TmpFs="{\"$tmpfs_name\":\"rw\"}}" \ 12 201 \ 13 .Id~[0-9a-f]\\{64\\} 14 cid=$(jq -r '.Id' <<<"$output") 15 16 # Prior to #9512, the tmpfs would be called '/mytmpfs=rw', with the '=rw' 17 t GET containers/${cid}/json 200 \ 18 .HostConfig.Tmpfs[\"${tmpfs_name}\"]~rw, 19 20 # Run the container, verify output 21 t POST containers/${cid}/start 204 22 t POST containers/${cid}/wait 200 23 t GET containers/${cid}/logs?stdout=true 200 24 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. 30 like "$(tr -d \\0 <$WORKDIR/curl.result.out)" ".* ${tmpfs_name}" \ 31 "'df' output includes tmpfs name"