mirror of
https://github.com/containers/podman.git
synced 2025-10-25 18:25:59 +08:00
Restart service when CONTAINERS_CONF changes
Service needs to be restarted in order to read the CONTAINERS_CONF file. Not resetting this can lead to lots of flakes, since the test will use whatever the host system has to be set in it's containers.conf. Fixes: https://github.com/containers/podman/issues/9286 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -332,6 +332,9 @@ var _ = Describe("Podman run", func() {
|
|||||||
It("podman run user capabilities test", func() {
|
It("podman run user capabilities test", func() {
|
||||||
// We need to ignore the containers.conf on the test distribution for this test
|
// We need to ignore the containers.conf on the test distribution for this test
|
||||||
os.Setenv("CONTAINERS_CONF", "/dev/null")
|
os.Setenv("CONTAINERS_CONF", "/dev/null")
|
||||||
|
if IsRemote() {
|
||||||
|
podmanTest.RestartRemoteService()
|
||||||
|
}
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "--user", "bin", ALPINE, "grep", "CapBnd", "/proc/self/status"})
|
session := podmanTest.Podman([]string{"run", "--rm", "--user", "bin", ALPINE, "grep", "CapBnd", "/proc/self/status"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -424,6 +427,9 @@ var _ = Describe("Podman run", func() {
|
|||||||
It("podman run user capabilities test with image", func() {
|
It("podman run user capabilities test with image", func() {
|
||||||
// We need to ignore the containers.conf on the test distribution for this test
|
// We need to ignore the containers.conf on the test distribution for this test
|
||||||
os.Setenv("CONTAINERS_CONF", "/dev/null")
|
os.Setenv("CONTAINERS_CONF", "/dev/null")
|
||||||
|
if IsRemote() {
|
||||||
|
podmanTest.RestartRemoteService()
|
||||||
|
}
|
||||||
dockerfile := `FROM busybox
|
dockerfile := `FROM busybox
|
||||||
USER bin`
|
USER bin`
|
||||||
podmanTest.BuildImage(dockerfile, "test", "false")
|
podmanTest.BuildImage(dockerfile, "test", "false")
|
||||||
|
|||||||
Reference in New Issue
Block a user