Files
podman/test/apiv2/44-mounts.at
Ed Santiago 963d19c759 System test cleanup
- cp test: clean up stray image

- build test: add workaround for #9567 (ultra-slow ubuntu).
  We're seeing CI flakes (timeouts) due to ubuntu 2004 being
  absurdly slow. Workaround: double our timeout on one specific
  test when ubuntu + remote.

- build test: clean up new copy-from test (from #9275).
  The test was copy-pasted from buildah system tests, without
  really adapting for podman environment (e.g. it was using
  images that we don't use here, and would cause pulls, which
  will cause flakes). Rewrite test so it references only $IMAGE,
  remove some confusing/unnecessary stuff, selectively run
  parts of it even when rootless or remote, and add a
  test to confirm that copy-from succeeded.

- load test: add error-message test to new load-invalid (#9672).
  Basically, make sure the command fails for the right reason.

- play test (kube): use $IMAGE, not alpine; and add pause-image
  cleanup to teardown()

- apiv2 mounts test: add a maintainability comment in a tricky
  section of code; and tighten up the mount point test.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-15 15:27:06 -06:00

32 lines
1.1 KiB
Bash

# -*- 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"