Skip to content

Commit 06ed897

Browse files
committed
cri/server: Add userns tests in PodSandboxStatus
Signed-off-by: Rodrigo Campos <[email protected]>
1 parent 6c356a5 commit 06ed897

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

internal/cri/server/sandbox_status_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ func TestPodSandboxStatus(t *testing.T) {
3131
id = "test-id"
3232
ip = "10.10.10.10"
3333
)
34+
idmap := []*runtime.IDMapping{
35+
{
36+
ContainerId: 0,
37+
HostId: 100,
38+
Length: 1,
39+
},
40+
}
3441
additionalIPs := []string{"8.8.8.8", "2001:db8:85a3::8a2e:370:7334"}
3542
createdAt := time.Now()
3643
config := &runtime.PodSandboxConfig{
@@ -46,6 +53,11 @@ func TestPodSandboxStatus(t *testing.T) {
4653
Network: runtime.NamespaceMode_NODE,
4754
Pid: runtime.NamespaceMode_CONTAINER,
4855
Ipc: runtime.NamespaceMode_POD,
56+
UsernsOptions: &runtime.UserNamespace{
57+
Uids: idmap,
58+
Gids: idmap,
59+
Mode: runtime.NamespaceMode_POD,
60+
},
4961
},
5062
},
5163
},
@@ -80,6 +92,11 @@ func TestPodSandboxStatus(t *testing.T) {
8092
Network: runtime.NamespaceMode_NODE,
8193
Pid: runtime.NamespaceMode_CONTAINER,
8294
Ipc: runtime.NamespaceMode_POD,
95+
UsernsOptions: &runtime.UserNamespace{
96+
Uids: idmap,
97+
Gids: idmap,
98+
Mode: runtime.NamespaceMode_POD,
99+
},
83100
},
84101
},
85102
},

0 commit comments

Comments
 (0)