summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-05-18 11:34:13 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-05-23 13:59:05 +0200
commit633d5f1f8b8844d6e2fb3e2593768360c889ed76 (patch)
treed4af0146efdb6a9444414aa7e36d650cafa864d4 /test
parent769e777656e62172ccdd1b98989627d6dae57a96 (diff)
downloadpodman-633d5f1f8b8844d6e2fb3e2593768360c889ed76.tar.gz
podman-633d5f1f8b8844d6e2fb3e2593768360c889ed76.tar.bz2
podman-633d5f1f8b8844d6e2fb3e2593768360c889ed76.zip
fix --init with /dev bind mount
The init binary until now has been bind-mounted to /dev/init which breaks when bind-mounting to /dev. Instead mount the init to /run/podman-init. The reasoning for using /run is that it is already used for other runtime data such as secrets. Fixes: #14251 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 182ae1888..828e92170 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -13,6 +13,7 @@ import (
"time"
"github.com/containers/common/pkg/cgroups"
+ "github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/rootless"
. "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage/pkg/stringid"
@@ -286,19 +287,20 @@ var _ = Describe("Podman run", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
conData := result.InspectContainerToJSON()
- Expect(conData[0]).To(HaveField("Path", "/dev/init"))
+ Expect(conData[0]).To(HaveField("Path", define.ContainerInitPath))
Expect(conData[0].Config.Annotations).To(HaveKeyWithValue("io.podman.annotations.init", "TRUE"))
})
It("podman run a container with --init and --init-path", func() {
- session := podmanTest.Podman([]string{"run", "--name", "test", "--init", "--init-path", "/usr/libexec/podman/catatonit", ALPINE, "ls"})
+ // Also bind-mount /dev (#14251).
+ session := podmanTest.Podman([]string{"run", "-v", "/dev:/dev", "--name", "test", "--init", "--init-path", "/usr/libexec/podman/catatonit", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
result := podmanTest.Podman([]string{"inspect", "test"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
conData := result.InspectContainerToJSON()
- Expect(conData[0]).To(HaveField("Path", "/dev/init"))
+ Expect(conData[0]).To(HaveField("Path", define.ContainerInitPath))
Expect(conData[0].Config.Annotations).To(HaveKeyWithValue("io.podman.annotations.init", "TRUE"))
})