diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-20 11:45:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 11:45:32 +0100 |
commit | ccc30c606e843d5c98e2c62a3b393a61e60976b2 (patch) | |
tree | dd1696a5da35d21d0b5a2fb1bd384eab630c0738 /test/e2e/build_test.go | |
parent | d927b43350a079c05f54e984838b851bcc2e5931 (diff) | |
parent | 5efa6dae905c65ea8a73565318e5f274c5eb825c (diff) | |
download | podman-ccc30c606e843d5c98e2c62a3b393a61e60976b2.tar.gz podman-ccc30c606e843d5c98e2c62a3b393a61e60976b2.tar.bz2 podman-ccc30c606e843d5c98e2c62a3b393a61e60976b2.zip |
Merge pull request #5539 from sujil02/issue-5461
Implemented --iidfile for podman commit
Diffstat (limited to 'test/e2e/build_test.go')
-rw-r--r-- | test/e2e/build_test.go | 23 |
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))) + }) }) |