diff options
author | Hironori Shiina <Hironori.Shiina@fujitsu.com> | 2020-12-22 21:48:07 -0500 |
---|---|---|
committer | Hironori Shiina <Hironori.Shiina@fujitsu.com> | 2020-12-22 21:48:07 -0500 |
commit | d61887037df6b7a4449b49145cdfd7941ab2d874 (patch) | |
tree | 255e3a47a63468f618ce868b6a0b56041ec029ee /test/system/070-build.bats | |
parent | 07663f74c48d11732a3330248f837d5abf86fe9c (diff) | |
download | podman-d61887037df6b7a4449b49145cdfd7941ab2d874.tar.gz podman-d61887037df6b7a4449b49145cdfd7941ab2d874.tar.bz2 podman-d61887037df6b7a4449b49145cdfd7941ab2d874.zip |
Fix podman build --logfile
A opened file object of a logfile gets lost because the variable
`logfile` is redefined in a `if` block. This fix stops redefining
the variable.
Signed-off-by: Hironori Shiina <Hironori.Shiina@fujitsu.com>
Diffstat (limited to 'test/system/070-build.bats')
-rw-r--r-- | test/system/070-build.bats | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 8e9a2d613..048cf535d 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -424,6 +424,23 @@ EOF run_podman rmi -a --force } +@test "podman build --logfile test" { + tmpdir=$PODMAN_TMPDIR/build-test + mkdir -p $tmpdir + tmpbuilddir=$tmpdir/build + mkdir -p $tmpbuilddir + dockerfile=$tmpbuilddir/Dockerfile + cat >$dockerfile <<EOF +FROM $IMAGE +EOF + + run_podman build -t build_test --format=docker --logfile=$tmpdir/logfile $tmpbuilddir + run cat $tmpdir/logfile + is "$output" ".*STEP 2: COMMIT" "COMMIT seen in log" + + 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 |