From b3c5352386c2bb6c46d0f2232bad9e84e53e8d27 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 19 Jan 2023 10:33:30 +0900 Subject: rootless: support `--ipc=host` Fix issue 44294 Co-authored-by: Sebastiaan van Stijn Signed-off-by: Akihiro Suda --- integration/container/ipcmode_linux_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'integration') diff --git a/integration/container/ipcmode_linux_test.go b/integration/container/ipcmode_linux_test.go index 49141ce58e..61d30b3360 100644 --- a/integration/container/ipcmode_linux_test.go +++ b/integration/container/ipcmode_linux_test.go @@ -115,7 +115,7 @@ func TestIpcModePrivate(t *testing.T) { // also exists on the host. func TestIpcModeShareable(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon) - skip.If(t, testEnv.IsRootless, "cannot test /dev/shm in rootless") + skip.If(t, testEnv.IsRootless, "no support for --ipc=shareable in rootless") testIpcNonePrivateShareable(t, "shareable", true, true) } @@ -191,7 +191,6 @@ func TestAPIIpcModeShareableAndContainer(t *testing.T) { func TestAPIIpcModeHost(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon) skip.If(t, testEnv.IsUserNamespace) - skip.If(t, testEnv.IsRootless, "cannot test /dev/shm in rootless") cfg := containertypes.Config{ Image: "busybox", @@ -263,7 +262,7 @@ func testDaemonIpcPrivateShareable(t *testing.T, mustBeShared bool, arg ...strin // TestDaemonIpcModeShareable checks that --default-ipc-mode shareable works as intended. func TestDaemonIpcModeShareable(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon) - skip.If(t, testEnv.IsRootless, "cannot test /dev/shm in rootless") + skip.If(t, testEnv.IsRootless, "no support for --ipc=shareable in rootless") testDaemonIpcPrivateShareable(t, true, "--default-ipc-mode", "shareable") } @@ -277,9 +276,9 @@ func TestDaemonIpcModePrivate(t *testing.T) { // used to check if an IpcMode given in config works as intended func testDaemonIpcFromConfig(t *testing.T, mode string, mustExist bool) { - skip.If(t, testEnv.IsRootless, "cannot test /dev/shm in rootless") config := `{"default-ipc-mode": "` + mode + `"}` - file := fs.NewFile(t, "test-daemon-ipc-config", fs.WithContent(config)) + // WithMode is needed for rootless + file := fs.NewFile(t, "test-daemon-ipc-config", fs.WithContent(config), fs.WithMode(0o644)) defer file.Remove() testDaemonIpcPrivateShareable(t, mustExist, "--config-file", file.Path()) @@ -295,6 +294,7 @@ func TestDaemonIpcModePrivateFromConfig(t *testing.T) { // TestDaemonIpcModeShareableFromConfig checks that "default-ipc-mode: shareable" config works as intended. func TestDaemonIpcModeShareableFromConfig(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon) + skip.If(t, testEnv.IsRootless, "no support for --ipc=shareable in rootless") testDaemonIpcFromConfig(t, "shareable", true) } -- cgit v1.2.1