summaryrefslogtreecommitdiff
path: root/test/e2e/build_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-07 10:03:43 -0400
committerGitHub <noreply@github.com>2021-04-07 10:03:43 -0400
commitf44645aad6822aee27c241f2f0f43bdbc652dc0a (patch)
treedc9e06d86e4fefcea8a8d3d653b9ec9a74b0232c /test/e2e/build_test.go
parent0e67053b9a26f20e5ccbffdcc5e7a84254ca16b8 (diff)
parent48b4b665b1c0c3ebab8007e0c39bb3aab6f3c414 (diff)
downloadpodman-f44645aad6822aee27c241f2f0f43bdbc652dc0a.tar.gz
podman-f44645aad6822aee27c241f2f0f43bdbc652dc0a.tar.bz2
podman-f44645aad6822aee27c241f2f0f43bdbc652dc0a.zip
Merge pull request #9962 from edsantiago/podman_remote_arch
Handle podman-remote --arch, --platform, --os
Diffstat (limited to 'test/e2e/build_test.go')
-rw-r--r--test/e2e/build_test.go38
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"))
+
+ })
})