diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-08 14:18:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 14:18:31 -0500 |
commit | 19507d0ffe8cda0a69f056838556f471fd9e61fa (patch) | |
tree | ab57b09216abd71378a76e9e1d2f44a8cfcb6231 /test | |
parent | 2bf13219f587d769400f26aeaed05930c34ce3d7 (diff) | |
parent | 407e86dcd2d9d08827dc8029e826e6545aa1a994 (diff) | |
download | podman-19507d0ffe8cda0a69f056838556f471fd9e61fa.tar.gz podman-19507d0ffe8cda0a69f056838556f471fd9e61fa.tar.bz2 podman-19507d0ffe8cda0a69f056838556f471fd9e61fa.zip |
Merge pull request #9246 from rhatdan/build
Implement missing arguments for podman build
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/build_test.go | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 71b4c0089..43524298f 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -458,4 +458,55 @@ RUN [[ -L /test/dummy-symlink ]] && echo SYMLNKOK || echo SYMLNKERR` Expect(ok).To(BeTrue()) }) + It("podman build --from, --add-host, --cap-drop, --cap-add", func() { + targetPath, err := CreateTempDirInTempDir() + Expect(err).To(BeNil()) + + containerFile := filepath.Join(targetPath, "Containerfile") + content := `FROM scratch +RUN cat /etc/hosts +RUN grep CapEff /proc/self/status` + + Expect(ioutil.WriteFile(containerFile, []byte(content), 0755)).To(BeNil()) + + defer func() { + Expect(os.RemoveAll(containerFile)).To(BeNil()) + }() + + // When + session := podmanTest.Podman([]string{ + "build", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, + }) + session.WaitWithDefaultTimeout() + + // Then + Expect(session.ExitCode()).To(Equal(0)) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("alpine")) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("testhost")) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("0000000000000400")) + }) + + It("podman build --arch", func() { + targetPath, err := CreateTempDirInTempDir() + Expect(err).To(BeNil()) + + containerFile := filepath.Join(targetPath, "Containerfile") + Expect(ioutil.WriteFile(containerFile, []byte("FROM alpine"), 0755)).To(BeNil()) + + defer func() { + Expect(os.RemoveAll(containerFile)).To(BeNil()) + }() + + // When + session := podmanTest.Podman([]string{ + "build", "--arch", "arm64", targetPath, + }) + session.WaitWithDefaultTimeout() + + // Then + Expect(session.ExitCode()).To(Equal(0)) + }) }) |