summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-27 06:37:19 -0400
committerGitHub <noreply@github.com>2022-05-27 06:37:19 -0400
commita72b2402c9569028abbff2364f4f40f4728e5688 (patch)
treeef975a49b5004b68c27889b9e7d5653b6fbd9a3d /test/e2e
parentbdcf453118115b5999183e0f4cf48f5e82cda12f (diff)
parent66a56ce05a577913a66c3d3f98c47cbe6cb4a3c0 (diff)
downloadpodman-a72b2402c9569028abbff2364f4f40f4728e5688.tar.gz
podman-a72b2402c9569028abbff2364f4f40f4728e5688.tar.bz2
podman-a72b2402c9569028abbff2364f4f40f4728e5688.zip
Merge pull request #14320 from flouthoc/build-honor-squash-and-layers
build: allow using `cache` explicitly with `--squash-all` using `--layers`
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/build_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index dcdd17143..86dc76116 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -178,6 +178,32 @@ var _ = Describe("Podman build", func() {
Expect(session).Should(Exit(0))
})
+ It("podman build verify explicit cache use with squash-all and --layers", func() {
+ session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "--layers", "-t", "test-squash-d:latest", "build/squash"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"inspect", "--format", "{{.RootFS.Layers}}", "test-squash-d"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ // Check for one layers
+ Expect(strings.Fields(session.OutputToString())).To(HaveLen(1))
+
+ // Second build must use last squashed build from cache
+ session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "--layers", "-t", "test", "build/squash"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ // Test if entire build is used from cache
+ Expect(session.OutputToString()).To(ContainSubstring("Using cache"))
+
+ session = podmanTest.Podman([]string{"inspect", "--format", "{{.RootFS.Layers}}", "test-squash-d"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ // Check for one layers
+ Expect(strings.Fields(session.OutputToString())).To(HaveLen(1))
+
+ })
+
It("podman build Containerfile locations", func() {
// Given
// Switch to temp dir and restore it afterwards