From 898f57c4c1c2abf14bc9fb000653b1e6634c10bf Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 4 Jan 2021 11:15:28 +0100 Subject: systemd: make rundir always accessible so that the PIDFile can be accessed also without being in the rootless user namespace. Closes: https://github.com/containers/podman/issues/8506 Signed-off-by: Giuseppe Scrivano --- test/e2e/systemd_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go index 48294943b..ce2a718df 100644 --- a/test/e2e/systemd_test.go +++ b/test/e2e/systemd_test.go @@ -131,6 +131,21 @@ WantedBy=multi-user.target Expect(conData[0].Config.SystemdMode).To(BeTrue()) }) + It("podman create container with --uidmap and conmon PidFile accessible", func() { + ctrName := "testCtrUidMap" + run := podmanTest.Podman([]string{"run", "-d", "--uidmap=0:1:1000", "--name", ctrName, ALPINE, "top"}) + run.WaitWithDefaultTimeout() + Expect(run.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"inspect", "--format", "{{.ConmonPidFile}}", ctrName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + pidFile := strings.TrimSuffix(session.OutputToString(), "\n") + _, err := ioutil.ReadFile(pidFile) + Expect(err).To(BeNil()) + }) + It("podman create container with systemd=always triggers systemd mode", func() { ctrName := "testCtr" run := podmanTest.Podman([]string{"create", "--name", ctrName, "--systemd", "always", ALPINE}) -- cgit v1.2.3-54-g00ecf From 8c6bbfbc42b5299e6d4ad5f8f9efa757234162db Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 4 Jan 2021 11:17:16 +0100 Subject: test: fix variable name Signed-off-by: Giuseppe Scrivano --- test/e2e/systemd_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go index ce2a718df..49ab3b8ed 100644 --- a/test/e2e/systemd_test.go +++ b/test/e2e/systemd_test.go @@ -13,10 +13,10 @@ import ( var _ = Describe("Podman systemd", func() { var ( - tempdir string - err error - podmanTest *PodmanTestIntegration - systemd_unit_file string + tempdir string + err error + podmanTest *PodmanTestIntegration + systemdUnitFile string ) BeforeEach(func() { @@ -27,7 +27,7 @@ var _ = Describe("Podman systemd", func() { podmanTest = PodmanTestCreate(tempdir) podmanTest.Setup() podmanTest.SeedImages() - systemd_unit_file = `[Unit] + systemdUnitFile = `[Unit] Description=redis container [Service] Restart=always @@ -50,7 +50,7 @@ WantedBy=multi-user.target SkipIfRootless("rootless can not write to /etc") SkipIfContainerized("test does not have systemd as pid 1") - sys_file := ioutil.WriteFile("/etc/systemd/system/redis.service", []byte(systemd_unit_file), 0644) + sys_file := ioutil.WriteFile("/etc/systemd/system/redis.service", []byte(systemdUnitFile), 0644) Expect(sys_file).To(BeNil()) defer func() { stop := SystemExec("bash", []string{"-c", "systemctl stop redis"}) -- cgit v1.2.3-54-g00ecf