summaryrefslogtreecommitdiff
path: root/test/e2e/build_test.go
diff options
context:
space:
mode:
authorSujil02 <sushah@redhat.com>2020-03-12 10:46:44 -0400
committerSujil02 <sushah@redhat.com>2020-03-19 16:32:02 -0400
commit5efa6dae905c65ea8a73565318e5f274c5eb825c (patch)
tree0848b155723236cccc325dc6daa93174a8b0dc73 /test/e2e/build_test.go
parent45e7cbfef65d0379af19264c5fa90e1ae9ccb74a (diff)
downloadpodman-5efa6dae905c65ea8a73565318e5f274c5eb825c.tar.gz
podman-5efa6dae905c65ea8a73565318e5f274c5eb825c.tar.bz2
podman-5efa6dae905c65ea8a73565318e5f274c5eb825c.zip
Implemented --iidfile for podman commit
Added flag to Write the image ID to the file with podman commit command. Fix to issue #5461 Signed-off-by: Sujil02 <sushah@redhat.com>
Diffstat (limited to 'test/e2e/build_test.go')
-rw-r--r--test/e2e/build_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index 240ef1627..8b03e9386 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -152,4 +152,27 @@ var _ = Describe("Podman build", func() {
Expect(strings.Fields(session.OutputToString())).
To(ContainElement("scratch"))
})
+
+ It("podman build basic alpine and print id to external file", func() {
+
+ // Switch to temp dir and restore it afterwards
+ cwd, err := os.Getwd()
+ Expect(err).To(BeNil())
+ Expect(os.Chdir(os.TempDir())).To(BeNil())
+ defer Expect(os.Chdir(cwd)).To(BeNil())
+
+ targetPath := filepath.Join(os.TempDir(), "dir")
+ targetFile := filepath.Join(targetPath, "idFile")
+
+ session := podmanTest.PodmanNoCache([]string{"build", "build/basicalpine", "--iidfile", targetFile})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ id, _ := ioutil.ReadFile(targetFile)
+
+ // Verify that id is correct
+ inspect := podmanTest.PodmanNoCache([]string{"inspect", string(id)})
+ inspect.WaitWithDefaultTimeout()
+ data := inspect.InspectImageJSON()
+ Expect(data[0].ID).To(Equal(string(id)))
+ })
})