diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-02-08 14:34:01 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-02-16 06:48:35 -0500 |
commit | 690c02f602eae68335192a202ba01c8097abf111 (patch) | |
tree | 596bca2f3936085464bface72d0affaafa1d4e78 /test | |
parent | ac9a048b59ebcbdfd2cb7abb50a97981892bd6b6 (diff) | |
download | podman-690c02f602eae68335192a202ba01c8097abf111.tar.gz podman-690c02f602eae68335192a202ba01c8097abf111.tar.bz2 podman-690c02f602eae68335192a202ba01c8097abf111.zip |
Add missing params for podman-remote build
Fixes: https://github.com/containers/podman/issues/9290
Currently we still have hard coded --isolation=chroot for podman-remote build.
Implement missing arguments for podman build
Implements
--jobs, --disable-compression, --excludes
Fixes:
MaxPullPushRetries
RetryDuration
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/build_test.go | 27 | ||||
-rw-r--r-- | test/e2e/prune_test.go | 1 | ||||
-rw-r--r-- | test/system/070-build.bats | 39 |
3 files changed, 64 insertions, 3 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 9bab4c926..bdd35db8f 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -489,7 +489,7 @@ RUN grep CapEff /proc/self/status` To(ContainElement("0000000000000400")) }) - It("podman build --arch", func() { + It("podman build --isolation && --arch", func() { targetPath, err := CreateTempDirInTempDir() Expect(err).To(BeNil()) @@ -502,11 +502,34 @@ RUN grep CapEff /proc/self/status` // When session := podmanTest.Podman([]string{ - "build", "--arch", "arm64", targetPath, + "build", "--isolation", "oci", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() + // Then + Expect(session.ExitCode()).To(Equal(0)) + // When + session = podmanTest.Podman([]string{ + "build", "--isolation", "chroot", "--arch", "arm64", targetPath, + }) + session.WaitWithDefaultTimeout() // Then Expect(session.ExitCode()).To(Equal(0)) + + // When + session = podmanTest.Podman([]string{ + "build", "--isolation", "rootless", "--arch", "arm64", targetPath, + }) + session.WaitWithDefaultTimeout() + // Then + Expect(session.ExitCode()).To(Equal(0)) + + // When + session = podmanTest.Podman([]string{ + "build", "--isolation", "bogus", "--arch", "arm64", targetPath, + }) + session.WaitWithDefaultTimeout() + // Then + Expect(session.ExitCode()).To(Equal(125)) }) }) diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go index f84312103..f19627170 100644 --- a/test/e2e/prune_test.go +++ b/test/e2e/prune_test.go @@ -111,7 +111,6 @@ var _ = Describe("Podman prune", func() { It("podman image prune dangling images", func() { podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") - none := podmanTest.Podman([]string{"images", "-a"}) none.WaitWithDefaultTimeout() Expect(none.ExitCode()).To(Equal(0)) diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 7a42a4c18..3ae95b5f5 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -453,6 +453,45 @@ EOF run_podman rmi -a --force } +@test "build with copy-from referencing the base image" { + skip_if_rootless "cannot mount as rootless" + target=busybox-derived + target_mt=busybox-mt-derived + 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 +USER 1001 +COPY --from=quay.io/libpod/busybox /bin/paste /test/ +EOF + containerfile2=$tmpdir/Containerfile2 + cat >$containerfile2 <<EOF +FROM quay.io/libpod/busybox AS test +RUN rm -f /bin/nl +FROM quay.io/libpod/alpine AS final +COPY --from=quay.io/libpod/busybox /bin/nl /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} + run_podman build --no-cache --jobs 4 -t ${target_mt} -f ${containerfile2} ${tmpdir} + + # (can only test locally; podman-remote has no image mount command) + if ! is_remote; then + run_podman image mount ${target} + root_single_job=$output + + run_podman image mount ${target_mt} + 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) + fi +} + @test "podman build --logfile test" { tmpdir=$PODMAN_TMPDIR/build-test mkdir -p $tmpdir |