From d4504e6f53895e9f0125b560d0e01e697e96ac2e Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 18 Jun 2020 15:12:07 -0600 Subject: system tests: new rm, build tests - rm: confirm 'rm' and 'rm -f' on running container - build: shotgun test of workdir, cmd, env, labels The new build test cd's to a temporary directory, which broke test invocations using a relative path (./bin/podman). Added code to detect relative paths and convert them to absolute. Signed-off-by: Ed Santiago --- test/system/070-build.bats | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'test/system/070-build.bats') diff --git a/test/system/070-build.bats b/test/system/070-build.bats index fd4ce03fc..793c2e5a0 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -99,6 +99,84 @@ EOF } +@test "podman build - workdir, cmd, env, label" { + tmpdir=$PODMAN_TMPDIR/build-test + mkdir -p $tmpdir + + # Random workdir, and multiple random strings to verify command & env + workdir=/$(random_string 10) + s_echo=$(random_string 15) + s_env1=$(random_string 20) + s_env2=$(random_string 25) + s_env3=$(random_string 30) + + # Label name: make sure it begins with a letter! jq barfs if you + # try to ask it for '.foo.xyz', i.e. any string beginning with digit + label_name=l$(random_string 8) + label_value=$(random_string 12) + + # Command to run on container startup with no args + cat >$tmpdir/mycmd <$tmpdir/Containerfile < expect=<$expect}>" + is "$actual" "$expect" "jq .Config.$field" + done + + # Clean up + run_podman rmi -f build_test +} + function teardown() { # A timeout or other error in 'build' can leave behind stale images # that podman can't even see and which will cascade into subsequent -- cgit v1.2.3-54-g00ecf