diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-05 10:10:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 10:10:41 +0000 |
commit | ffc8d654924b50dcf80dd6a1a1b63cd2e9d3e55e (patch) | |
tree | 8d41b9a3a775c99e6ac0a1cbdba53e5198878ab1 /test | |
parent | 773eead54e2e0877e92d5871625a6cc32c582d30 (diff) | |
parent | efe1176dd90ea38742c53c8588fbc83e6b9aefd6 (diff) | |
download | podman-ffc8d654924b50dcf80dd6a1a1b63cd2e9d3e55e.tar.gz podman-ffc8d654924b50dcf80dd6a1a1b63cd2e9d3e55e.tar.bz2 podman-ffc8d654924b50dcf80dd6a1a1b63cd2e9d3e55e.zip |
Merge pull request #14827 from flouthoc/specgen-run-support-manifest
specgen,run: support running container from valid manifest list using `--platform`
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/build/Containerfile.with-platform | 1 | ||||
-rw-r--r-- | test/e2e/run_test.go | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/build/Containerfile.with-platform b/test/e2e/build/Containerfile.with-platform new file mode 100644 index 000000000..3bb585a0a --- /dev/null +++ b/test/e2e/build/Containerfile.with-platform @@ -0,0 +1 @@ +FROM --platform=$TARGETPLATFORM alpine diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 42b01bdcc..2aa5a78db 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -73,6 +73,28 @@ var _ = Describe("Podman run", func() { Expect(session.OutputToString()).To(ContainSubstring("graphRootMounted=1")) }) + It("podman run from manifest list", func() { + session := podmanTest.Podman([]string{"manifest", "create", "localhost/test:latest"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"build", "-f", "build/Containerfile.with-platform", "--platform", "linux/amd64,linux/arm64", "--manifest", "localhost/test:latest"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"run", "--platform", "linux/arm64", "localhost/test", "uname", "-a"}) + session.WaitWithDefaultTimeout() + exitCode := session.ExitCode() + // CI could either support requested platform or not, if it supports then output should contain `aarch64` + // if not run should fail with a very specific error i.e `Exec format error` anything other than this should + // be marked as failure of test. + if exitCode == 0 { + Expect(session.OutputToString()).To(ContainSubstring("aarch64")) + } else { + Expect(session.ErrorToString()).To(ContainSubstring("Exec format error")) + } + }) + It("podman run a container based on a complex local image name", func() { imageName := strings.TrimPrefix(nginx, "quay.io/") session := podmanTest.Podman([]string{"run", imageName, "ls"}) |