diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-09 14:58:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 14:58:28 -0500 |
commit | 6db3e9bfeb39e26bf6c211328c77bd847ff140f5 (patch) | |
tree | 2baa1845c8d5ebe92f0772ba3116e81b6ab03251 /test/system | |
parent | da062b5bd03dd88060eb91c7d02936d5e7427cb9 (diff) | |
parent | 0154f9e9b3d158dce901c9f19261714660a2f27b (diff) | |
download | podman-6db3e9bfeb39e26bf6c211328c77bd847ff140f5.tar.gz podman-6db3e9bfeb39e26bf6c211328c77bd847ff140f5.tar.bz2 podman-6db3e9bfeb39e26bf6c211328c77bd847ff140f5.zip |
Merge pull request #8653 from rhatdan/buildah
Honor the --layers flag
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/070-build.bats | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 59da503a6..8e9a2d613 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -381,6 +381,48 @@ a${random3}z" run_podman rmi -f build_test } +@test "podman build --layers test" { + rand_content=$(random_string 50) + tmpdir=$PODMAN_TMPDIR/build-test + run mkdir -p $tmpdir + containerfile=$tmpdir/Containerfile + cat >$containerfile <<EOF +FROM $IMAGE +RUN echo $rand_content +EOF + + # Build twice to make sure second time uses cache + run_podman build -t build_test $tmpdir + if [[ "$output" =~ "Using cache" ]]; then + is "$output" "[no instance of 'Using cache']" "no cache used" + fi + + run_podman build -t build_test $tmpdir + is "$output" ".*cache" "used cache" + + run_podman build -t build_test --layers=true $tmpdir + is "$output" ".*cache" "used cache" + + run_podman build -t build_test --layers=false $tmpdir + if [[ "$output" =~ "Using cache" ]]; then + is "$output" "[no instance of 'Using cache']" "no cache used" + fi + + BUILDAH_LAYERS=false run_podman build -t build_test $tmpdir + if [[ "$output" =~ "Using cache" ]]; then + is "$output" "[no instance of 'Using cache']" "no cache used" + fi + + BUILDAH_LAYERS=false run_podman build -t build_test --layers=1 $tmpdir + is "$output" ".*cache" "used cache" + + BUILDAH_LAYERS=1 run_podman build -t build_test --layers=false $tmpdir + if [[ "$output" =~ "Using cache" ]]; then + is "$output" "[no instance of 'Using cache']" "no cache used" + fi + + run_podman rmi -a --force +} function teardown() { # A timeout or other error in 'build' can leave behind stale images |