diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/30-volumes.at | 4 | ||||
-rw-r--r-- | test/apiv2/35-networks.at | 4 | ||||
-rw-r--r-- | test/apiv2/44-mounts.at | 9 | ||||
-rw-r--r-- | test/apiv2/60-auth.at | 24 | ||||
-rw-r--r-- | test/apiv2/rest_api/test_rest_v2_0_0.py | 11 | ||||
-rw-r--r-- | test/e2e/build_test.go | 42 | ||||
-rw-r--r-- | test/e2e/common_test.go | 2 | ||||
-rw-r--r-- | test/e2e/generate_kube_test.go | 4 | ||||
-rw-r--r-- | test/e2e/run_test.go | 24 | ||||
-rw-r--r-- | test/system/065-cp.bats | 1 | ||||
-rw-r--r-- | test/system/070-build.bats | 69 | ||||
-rw-r--r-- | test/system/120-load.bats | 3 | ||||
-rw-r--r-- | test/system/700-play.bats | 16 |
13 files changed, 131 insertions, 82 deletions
diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at index c27c638bb..1a40b3cdf 100644 --- a/test/apiv2/30-volumes.at +++ b/test/apiv2/30-volumes.at @@ -86,6 +86,10 @@ t DELETE libpod/volumes/foo1 404 \ .message~.* \ .response=404 +# Prune volumes - bad filter input +t POST volumes/prune?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" + ## Prune volumes with label matching 'testlabel1=testonly' t POST libpod/volumes/prune?filters='{"label":["testlabel1=testonly"]}' 200 t GET libpod/volumes/json?filters='{"label":["testlabel1=testonly"]}' 200 length=0 diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at index 266a41421..6c3a34ece 100644 --- a/test/apiv2/35-networks.at +++ b/test/apiv2/35-networks.at @@ -44,6 +44,10 @@ t GET libpod/networks/json?filters='{"name":["network1"]}' 200 \ .[0].Name=network1 t GET networks 200 +#inspect network +t GET libpod/networks/network1/json 200 \ + .name="network1" + #network list docker endpoint t GET networks?filters='{"name":["network1","network2"]}' 200 \ length=2 diff --git a/test/apiv2/44-mounts.at b/test/apiv2/44-mounts.at index 901245da6..d54669e7d 100644 --- a/test/apiv2/44-mounts.at +++ b/test/apiv2/44-mounts.at @@ -6,7 +6,7 @@ podman pull $IMAGE &>/dev/null tmpfs_name="/mytmpfs" t POST containers/create?name=hostconfig_test \ Image=$IMAGE \ - Cmd='["df"]' \ + Cmd='["df","-P","'$tmpfs_name'"]' \ HostConfig='{"Binds":["/tmp/doesnotexist:/test1"]' \ TmpFs="{\"$tmpfs_name\":\"rw\"}}" \ 201 \ @@ -22,5 +22,10 @@ t POST containers/${cid}/start 204 t POST containers/${cid}/wait 200 t GET containers/${cid}/logs?stdout=true 200 -like "$(<$WORKDIR/curl.result.out)" ".* ${tmpfs_name}" \ +# /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" diff --git a/test/apiv2/60-auth.at b/test/apiv2/60-auth.at index 378955cd7..cfde519c1 100644 --- a/test/apiv2/60-auth.at +++ b/test/apiv2/60-auth.at @@ -5,25 +5,19 @@ start_registry -# FIXME FIXME FIXME: remove the 'if false' for use with PR 9589 -if false; then - -# FIXME FIXME: please forgive the horrible POST params format; I have an -# upcoming PR which should fix that. - # Test with wrong password. Confirm bad status and appropriate error message -t POST /v1.40/auth "\"username\":\"${REGISTRY_USERNAME}\",\"password\":\"WrOnGPassWord\",\"serveraddress\":\"localhost:$REGISTRY_PORT/\"" \ +t POST /v1.40/auth username=$REGISTRY_USERNAME password=WrOnGPassWord serveraddress=localhost:$REGISTRY_PORT/ \ 400 \ .Status~'.* invalid username/password' -# Test with the right password. Confirm status message and reasonable token -t POST /v1.40/auth "\"username\":\"${REGISTRY_USERNAME}\",\"password\":\"${REGISTRY_PASSWORD}\",\"serveraddress\":\"localhost:$REGISTRY_PORT/\"" \ +# Test with the right password. Confirm status message +t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=localhost:$REGISTRY_PORT/ \ 200 \ .Status="Login Succeeded" \ - .IdentityToken~[a-zA-Z0-9] - -# FIXME: now what? Try something-something using that token? -token=$(jq -r .IdentityToken <<<"$output") -# ... + .IdentityToken="" -fi # FIXME FIXME FIXME: remove when working +# Same test with url scheme provided +t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=https://localhost:$REGISTRY_PORT/ \ + 200 \ + .Status="Login Succeeded" \ + .IdentityToken="" diff --git a/test/apiv2/rest_api/test_rest_v2_0_0.py b/test/apiv2/rest_api/test_rest_v2_0_0.py index c0b61ea85..d7910f555 100644 --- a/test/apiv2/rest_api/test_rest_v2_0_0.py +++ b/test/apiv2/rest_api/test_rest_v2_0_0.py @@ -555,17 +555,6 @@ class TestApi(unittest.TestCase): self.assertIn(name, payload["VolumesDeleted"]) self.assertGreater(payload["SpaceReclaimed"], 0) - def test_auth_compat(self): - r = requests.post( - PODMAN_URL + "/v1.40/auth", - json={ - "username": "bozo", - "password": "wedontneednopasswords", - "serveraddress": "https://localhost/v1.40/", - }, - ) - self.assertEqual(r.status_code, 404, r.content) - def test_version(self): r = requests.get(PODMAN_URL + "/v1.40/version") self.assertEqual(r.status_code, 200, r.content) diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 4839d66ec..e061a2154 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -39,7 +39,7 @@ var _ = Describe("Podman build", func() { // happy and then clean up after ourselves to make sure that works too. It("podman build and remove basic alpine", func() { podmanTest.AddImageToRWStore(ALPINE) - session := podmanTest.Podman([]string{"build", "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -59,7 +59,7 @@ var _ = Describe("Podman build", func() { It("podman build with logfile", func() { logfile := filepath.Join(podmanTest.TempDir, "logfile") - session := podmanTest.Podman([]string{"build", "--tag", "test", "--logfile", logfile, "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "--tag", "test", "--logfile", logfile, "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -82,7 +82,7 @@ var _ = Describe("Podman build", func() { // If the context directory is pointing at a file and not a directory, // that's a no no, fail out. It("podman build context directory a file", func() { - session := podmanTest.Podman([]string{"build", "build/context_dir_a_file"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/context_dir_a_file"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(125)) }) @@ -90,7 +90,7 @@ var _ = Describe("Podman build", func() { // Check that builds with different values for the squash options // create the appropriate number of layers, then clean up after. It("podman build basic alpine with squash", func() { - session := podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-a", "-t", "test-squash-a:latest", "build/squash"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-a", "-t", "test-squash-a:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -100,7 +100,7 @@ var _ = Describe("Podman build", func() { // Check for two layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(2)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-b", "--squash", "-t", "test-squash-b:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-b", "--squash", "-t", "test-squash-b:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -110,7 +110,7 @@ var _ = Describe("Podman build", func() { // Check for three layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(3)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-c", "--squash", "-t", "test-squash-c:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash", "-t", "test-squash-c:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -120,7 +120,7 @@ var _ = Describe("Podman build", func() { // Check for two layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(2)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "-t", "test-squash-d:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "-t", "test-squash-d:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -162,7 +162,7 @@ var _ = Describe("Podman build", func() { // When session := podmanTest.Podman([]string{ - "build", "-f", targetFile, "-t", "test-locations", + "build", "--pull-never", "-f", targetFile, "-t", "test-locations", }) session.WaitWithDefaultTimeout() @@ -185,7 +185,7 @@ var _ = Describe("Podman build", func() { } targetFile := filepath.Join(targetPath, "idFile") - session := podmanTest.Podman([]string{"build", "build/basicalpine", "--iidfile", targetFile}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine", "--iidfile", targetFile}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) id, _ := ioutil.ReadFile(targetFile) @@ -200,7 +200,7 @@ var _ = Describe("Podman build", func() { It("podman Test PATH in built image", func() { path := "/tmp:/bin:/usr/bin:/usr/sbin" session := podmanTest.Podman([]string{ - "build", "-f", "build/basicalpine/Containerfile.path", "-t", "test-path", + "build", "--pull-never", "-f", "build/basicalpine/Containerfile.path", "-t", "test-path", }) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -225,7 +225,7 @@ RUN printenv http_proxy` dockerfilePath := filepath.Join(podmanTest.TempDir, "Dockerfile") err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755) Expect(err).To(BeNil()) - session := podmanTest.Podman([]string{"build", "--http-proxy", "--file", dockerfilePath, podmanTest.TempDir}) + session := podmanTest.Podman([]string{"build", "--pull-never", "--http-proxy", "--file", dockerfilePath, podmanTest.TempDir}) session.Wait(120) Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("1.2.3.4") @@ -234,7 +234,7 @@ RUN printenv http_proxy` }) It("podman build and check identity", func() { - session := podmanTest.Podman([]string{"build", "-f", "build/basicalpine/Containerfile.path", "--no-cache", "-t", "test", "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/basicalpine/Containerfile.path", "--no-cache", "-t", "test", "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -279,7 +279,7 @@ RUN find /test` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "-f", "Containerfile", targetSubPath}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "-f", "Containerfile", targetSubPath}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("/test/dummy") @@ -321,7 +321,7 @@ RUN find /test` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "-f", "subdir/Containerfile", "."}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "-f", "subdir/Containerfile", "."}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) @@ -445,7 +445,7 @@ RUN [[ -L /test/dummy-symlink ]] && echo SYMLNKOK || echo SYMLNKERR` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", targetSubPath}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", targetSubPath}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("/test/dummy") @@ -475,7 +475,7 @@ RUN grep CapEff /proc/self/status` // When session := podmanTest.Podman([]string{ - "build", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, + "build", "--pull-never", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, }) session.WaitWithDefaultTimeout() @@ -502,7 +502,7 @@ RUN grep CapEff /proc/self/status` // When session := podmanTest.Podman([]string{ - "build", "--isolation", "oci", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "oci", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -510,7 +510,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "chroot", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "chroot", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -518,7 +518,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "rootless", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "rootless", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -526,7 +526,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "bogus", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "bogus", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -540,7 +540,7 @@ RUN echo hello` containerfilePath := filepath.Join(podmanTest.TempDir, "Containerfile") err := ioutil.WriteFile(containerfilePath, []byte(containerfile), 0755) Expect(err).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "--timestamp", "0", "--file", containerfilePath, podmanTest.TempDir}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--timestamp", "0", "--file", containerfilePath, podmanTest.TempDir}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 70ffdebea..9ae56d7ce 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -440,7 +440,7 @@ func (p *PodmanTestIntegration) BuildImage(dockerfile, imageName string, layers dockerfilePath := filepath.Join(p.TempDir, "Dockerfile") err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755) Expect(err).To(BeNil()) - cmd := []string{"build", "--layers=" + layers, "--file", dockerfilePath} + cmd := []string{"build", "--pull-never", "--layers=" + layers, "--file", dockerfilePath} if len(imageName) > 0 { cmd = append(cmd, []string{"-t", imageName}...) } diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 21e006c20..bc7c21785 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -675,7 +675,7 @@ ENTRYPOINT /bin/sleep` Expect(err).To(BeNil()) image := "generatekube:test" - session := podmanTest.Podman([]string{"build", "-f", containerfilePath, "-t", image}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", containerfilePath, "-t", image}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -748,7 +748,7 @@ USER test1` Expect(err).To(BeNil()) image := "generatekube:test" - session := podmanTest.Podman([]string{"build", "-f", containerfilePath, "-t", image}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", containerfilePath, "-t", image}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 490d05699..4e5106731 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -576,23 +576,23 @@ USER bin` }) It("podman run blkio-weight test", func() { - SkipIfRootless("FIXME: This is blowing up because of no /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control file") SkipIfRootlessCgroupsV1("Setting blkio-weight not supported on cgroupv1 for rootless users") - if !CGROUPSV2 { - if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) { - Skip("Kernel does not support blkio.weight") - } - } - if podmanTest.Host.Distribution == "ubuntu" { - Skip("Ubuntu <= 20.10 lacks BFQ scheduler") - } + SkipIfRootless("By default systemd doesn't delegate io to rootless users") if CGROUPSV2 { - // convert linearly from [10-1000] to [1-10000] - session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/io.bfq.weight"}) + if _, err := os.Stat("/sys/fs/cgroup/io.stat"); os.IsNotExist(err) { + Skip("Kernel does not have io.stat") + } + session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/io.bfq.weight"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - Expect(session.OutputToString()).To(ContainSubstring("51")) + // there was a documentation issue in the kernel that reported a different range [1-10000] for the io controller. + // older versions of crun/runc used it. For the time being allow both versions to pass the test. + // FIXME: drop "|51" once all the runtimes we test have the fix in place. + Expect(strings.Replace(session.OutputToString(), "default ", "", 1)).To(MatchRegexp("15|51")) } else { + if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) { + Skip("Kernel does not support blkio.weight") + } session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "cat", "/sys/fs/cgroup/blkio/blkio.weight"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats index 73e807843..679cdc209 100644 --- a/test/system/065-cp.bats +++ b/test/system/065-cp.bats @@ -370,6 +370,7 @@ load helpers is "${lines[0]}" "${randomcontent[0]}" "eval symlink - created container" is "${lines[1]}" "${randomcontent[1]}" "eval symlink - created container" run_podman rm -f cpcontainer + run_podman rmi $cpimage } diff --git a/test/system/070-build.bats b/test/system/070-build.bats index d413b0c10..8f6cdb46b 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -241,11 +241,21 @@ EOF build_arg_implicit+="=$arg_implicit_value" fi + # FIXME FIXME FIXME: 2021-03-15: workaround for #9567 (slow ubuntu 2004): + # we're seeing lots of timeouts in CI. Until/unless #9567 gets fixed, + # let's get CI passing by extending the timeout when remote on ubuntu + local localtimeout=${PODMAN_TIMEOUT} + if is_remote; then + if grep -qi ubuntu /etc/os-release; then + localtimeout=$(( 2 * $localtimeout )) + fi + fi + # cd to the dir, so we test relative paths (important for podman-remote) cd $PODMAN_TMPDIR export arg_explicit="THIS SHOULD BE OVERRIDDEN BY COMMAND LINE!" export arg_implicit=${arg_implicit_value} - run_podman ${MOUNTS_CONF} build \ + PODMAN_TIMEOUT=$localtimeout run_podman ${MOUNTS_CONF} build \ --build-arg arg_explicit=${arg_explicit_value} \ $build_arg_implicit \ --dns-search $nosuchdomain \ @@ -594,34 +604,46 @@ EOF run_podman rmi -a --force } +# Caveat lector: this test was mostly copy-pasted from buildah in #9275. +# It's not entirely clear what it's testing, or if the 'mount' section is +# necessary. @test "build with copy-from referencing the base image" { - skip_if_rootless "cannot mount as rootless" - target=busybox-derived - target_mt=busybox-mt-derived + target=derived + target_mt=derived-mt tmpdir=$PODMAN_TMPDIR/build-test mkdir -p $tmpdir + containerfile1=$tmpdir/Containerfile1 - cat >$containerfile1 <<EOF -FROM quay.io/libpod/busybox AS build -RUN rm -f /bin/paste + cat >$containerfile1 <<EOF +FROM $IMAGE AS build +RUN rm -f /etc/issue USER 1001 -COPY --from=quay.io/libpod/busybox /bin/paste /test/ +COPY --from=$IMAGE /etc/issue /test/ EOF + containerfile2=$tmpdir/Containerfile2 - cat >$containerfile2 <<EOF -FROM quay.io/libpod/busybox AS test -RUN rm -f /bin/nl + cat >$containerfile2 <<EOF +FROM $IMAGE AS test +RUN rm -f /etc/alpine-release FROM quay.io/libpod/alpine AS final -COPY --from=quay.io/libpod/busybox /bin/nl /test/ +COPY --from=$IMAGE /etc/alpine-release /test/ EOF - run_podman build -t ${target} -f ${containerfile1} ${tmpdir} - run_podman build --jobs 4 -t ${target} -f ${containerfile1} ${tmpdir} - run_podman build -t ${target} -f ${containerfile2} ${tmpdir} + # Before the build, $IMAGE's base image should not be present + local base_image=quay.io/libpod/alpine:latest + run_podman 1 image exists $base_image + + run_podman build --jobs 1 -t ${target} -f ${containerfile2} ${tmpdir} run_podman build --no-cache --jobs 4 -t ${target_mt} -f ${containerfile2} ${tmpdir} + # After the build, the base image should exist + run_podman image exists $base_image + # (can only test locally; podman-remote has no image mount command) - if ! is_remote; then + # (can also only test as root; mounting under rootless podman is too hard) + # We perform the test as a conditional, not a 'skip', because there's + # value in testing the above 'build' commands even remote & rootless. + if ! is_remote && ! is_rootless; then run_podman image mount ${target} root_single_job=$output @@ -629,8 +651,21 @@ EOF root_multi_job=$output # Check that both the version with --jobs 1 and --jobs=N have the same number of files - test $(find $root_single_job -type f | wc -l) = $(find $root_multi_job -type f | wc -l) + nfiles_single=$(find $root_single_job -type f | wc -l) + nfiles_multi=$(find $root_multi_job -type f | wc -l) + run_podman image umount ${target_mt} + run_podman image umount ${target} + + is "$nfiles_single" "$nfiles_multi" \ + "Number of files (--jobs=1) == (--jobs=4)" + + # Make sure the number is reasonable + test "$nfiles_single" -gt 50 fi + + # Clean up + run_podman rmi ${target_mt} ${target} ${base_image} + run_podman image prune -f } @test "podman build --logfile test" { diff --git a/test/system/120-load.bats b/test/system/120-load.bats index 936449bdb..95113c4a6 100644 --- a/test/system/120-load.bats +++ b/test/system/120-load.bats @@ -31,6 +31,9 @@ verify_iid_and_name() { invalid=$PODMAN_TMPDIR/invalid echo "I am an invalid file and should cause a podman-load error" > $invalid run_podman 125 load -i $invalid + # podman and podman-remote emit different messages; this is a common string + is "$output" ".*error pulling image: unable to pull .*" \ + "load -i INVALID fails with expected diagnostic" } @test "podman save to pipe and load" { diff --git a/test/system/700-play.bats b/test/system/700-play.bats index e7904f59f..8fa96741c 100644 --- a/test/system/700-play.bats +++ b/test/system/700-play.bats @@ -5,6 +5,20 @@ load helpers +# This is a long ugly way to clean up pods and remove the pause image +function teardown() { + run_podman pod rm -f -a + run_podman rm -f -a + run_podman image list --format '{{.ID}} {{.Repository}}' + while read id name; do + if [[ "$name" =~ /pause ]]; then + run_podman rmi $id + fi + done <<<"$output" + + basic_teardown +} + testYaml=" apiVersion: v1 kind: Pod @@ -24,7 +38,7 @@ spec: value: xterm - name: container value: podman - image: quay.io/libpod/alpine:latest + image: $IMAGE name: test resources: {} securityContext: |