diff options
-rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 7 | ||||
-rw-r--r-- | CONTRIBUTING.md | 4 | ||||
-rw-r--r-- | test/e2e/exec_test.go | 28 | ||||
-rw-r--r-- | troubleshooting.md | 6 |
4 files changed, 28 insertions, 17 deletions
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..568cf7240 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +<!-- +Thanks for sending a pull request! + +Please make sure you've read our contributing guidelines and how to submit a pull request (https://github.com/containers/podman/blob/master/CONTRIBUTING.md#submitting-pull-requests). + +In case you're only changing docs, make sure to prefix the pull-request title with "[CI:DOCS]". That will prevent functional tests from running and save time and energy. +--> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 308c7b197..1d2c26750 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,6 +157,10 @@ when the PR is merged. PRs will be approved by an [approver][owners] listed in [`OWNERS`](OWNERS). +In case you're only changing docs, make sure to prefix the PR title with +"[CI:DOCS]". That will prevent functional tests from running and save time and +energy. + ### Describe your Changes in Commit Messages Describe your problem. Whether your patch is a one-line bug fix or 5000 lines diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index a698cd4b3..f61f52589 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -87,14 +87,12 @@ var _ = Describe("Podman exec", func() { session := podmanTest.Podman([]string{"exec", "--env", "FOO=BAR", "test1", "printenv", "FOO"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ := session.GrepString("BAR") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(Equal("BAR")) session = podmanTest.Podman([]string{"exec", "--env", "PATH=/bin", "test1", "printenv", "PATH"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ = session.GrepString("/bin") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(Equal("/bin")) }) It("podman exec os.Setenv env", func() { @@ -107,8 +105,7 @@ var _ = Describe("Podman exec", func() { session := podmanTest.Podman([]string{"exec", "--env", "FOO", "test1", "printenv", "FOO"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ := session.GrepString("BAR") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(Equal("BAR")) os.Unsetenv("FOO") }) @@ -142,8 +139,7 @@ var _ = Describe("Podman exec", func() { session := podmanTest.Podman([]string{"exec", "--interactive", "--tty", "test1", "/usr/bin/stty", "--all"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ := session.GrepString(" onlcr") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(ContainSubstring(" onlcr")) }) It("podman exec simple command with user", func() { @@ -199,14 +195,12 @@ var _ = Describe("Podman exec", func() { session := podmanTest.Podman([]string{"exec", "--workdir", "/tmp", "test1", "pwd"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ := session.GrepString("/tmp") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(Equal("/tmp")) session = podmanTest.Podman([]string{"exec", "-w", "/tmp", "test1", "pwd"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ = session.GrepString("/tmp") - Expect(match).Should(BeTrue()) + Expect(session.OutputToString()).To(Equal("/tmp")) }) It("podman exec missing working directory test", func() { @@ -280,7 +274,7 @@ var _ = Describe("Podman exec", func() { exec := podmanTest.Podman([]string{"exec", "-ti", ctrName2, "id"}) exec.WaitWithDefaultTimeout() Expect(exec.ExitCode()).To(Equal(0)) - Expect(strings.Contains(exec.OutputToString(), fmt.Sprintf("%s(%s)", gid, groupName))).To(BeTrue()) + Expect(exec.OutputToString()).To(ContainSubstring(fmt.Sprintf("%s(%s)", gid, groupName))) }) It("podman exec preserves container groups with --user and --group-add", func() { @@ -300,9 +294,9 @@ RUN useradd -u 1000 auser` exec.WaitWithDefaultTimeout() Expect(exec.ExitCode()).To(Equal(0)) output := exec.OutputToString() - Expect(strings.Contains(output, "4000(first)")).To(BeTrue()) - Expect(strings.Contains(output, "4001(second)")).To(BeTrue()) - Expect(strings.Contains(output, "1000(auser)")).To(BeTrue()) + Expect(output).To(ContainSubstring("4000(first)")) + Expect(output).To(ContainSubstring("4001(second)")) + Expect(output).To(ContainSubstring("1000(auser)")) // Kill the container just so the test does not take 15 seconds to stop. kill := podmanTest.Podman([]string{"kill", ctrName}) @@ -323,7 +317,7 @@ RUN useradd -u 1000 auser` data := podmanTest.InspectContainer(ctrName) Expect(len(data)).To(Equal(1)) Expect(len(data[0].ExecIDs)).To(Equal(1)) - Expect(strings.Contains(exec1.OutputToString(), data[0].ExecIDs[0])).To(BeTrue()) + Expect(exec1.OutputToString()).To(ContainSubstring(data[0].ExecIDs[0])) exec2 := podmanTest.Podman([]string{"exec", "-t", "-i", ctrName, "ps", "-a"}) exec2.WaitWithDefaultTimeout() diff --git a/troubleshooting.md b/troubleshooting.md index c42afb642..2e0abae21 100644 --- a/troubleshooting.md +++ b/troubleshooting.md @@ -680,3 +680,9 @@ file `/etc/systemd/system/user@.service.d/delegate.conf` with the contents: After logging out and loggin back in, you should have permission to set CPU limits. + +### 26) `exec container process '/bin/sh': Exec format error` (or another binary than `bin/sh`) + +This can happen when running a container from an image for another architecture than the one you are running on. + +For example, if a remote repository only has, and thus send you, a `linux/arm64` _OS/ARCH_ but you run on `linux/amd64` (as happened in https://github.com/openMF/community-app/issues/3323 due to https://github.com/timbru31/docker-ruby-node/issues/564). |