diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-04-03 06:36:51 -0400 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2021-04-07 05:00:16 -0600 |
commit | b68106703e8929c2ba313fd580032ea5bf43ccf2 (patch) | |
tree | 59f6794e8b464b49d745a75b6aaca51e946b250d /test/e2e | |
parent | 68269a0ee11f4683cdd8e36b85a58a1975aeb8e7 (diff) | |
download | podman-b68106703e8929c2ba313fd580032ea5bf43ccf2.tar.gz podman-b68106703e8929c2ba313fd580032ea5bf43ccf2.tar.bz2 podman-b68106703e8929c2ba313fd580032ea5bf43ccf2.zip |
Handle podman-remote --arch, --platform, --os
Podman remote should be able to handle remote specification of
arches.
Requires: https://github.com/containers/buildah/pull/3116
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/build_test.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 4f337116e..6255690b1 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -566,4 +566,42 @@ RUN echo hello`, ALPINE) Expect(session.OutputToString()).To(ContainSubstring("(user)")) Expect(session.OutputToString()).To(ContainSubstring("(elapsed)")) }) + + It("podman build --arch --os flag", func() { + containerfile := `FROM scratch` + containerfilePath := filepath.Join(podmanTest.TempDir, "Containerfile") + err := ioutil.WriteFile(containerfilePath, []byte(containerfile), 0755) + Expect(err).To(BeNil()) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--arch", "foo", "--os", "bar", "--file", containerfilePath, podmanTest.TempDir}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + inspect := podmanTest.Podman([]string{"image", "inspect", "--format", "{{ .Architecture }}", "test"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.OutputToString()).To(Equal("foo")) + + inspect = podmanTest.Podman([]string{"image", "inspect", "--format", "{{ .Os }}", "test"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.OutputToString()).To(Equal("bar")) + + }) + + It("podman build --os windows flag", func() { + containerfile := `FROM scratch` + containerfilePath := filepath.Join(podmanTest.TempDir, "Containerfile") + err := ioutil.WriteFile(containerfilePath, []byte(containerfile), 0755) + Expect(err).To(BeNil()) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--os", "windows", "--file", containerfilePath, podmanTest.TempDir}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + inspect := podmanTest.Podman([]string{"image", "inspect", "--format", "{{ .Architecture }}", "test"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.OutputToString()).To(Equal(runtime.GOARCH)) + + inspect = podmanTest.Podman([]string{"image", "inspect", "--format", "{{ .Os }}", "test"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.OutputToString()).To(Equal("windows")) + + }) }) |