Skip to content

Commit

Permalink
cri/server: Add userns tests in PodSandboxStatus
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
  • Loading branch information
rata committed Feb 7, 2024
1 parent 6c356a5 commit 06ed897
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/cri/server/sandbox_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ func TestPodSandboxStatus(t *testing.T) {
id = "test-id"
ip = "10.10.10.10"
)
idmap := []*runtime.IDMapping{
{
ContainerId: 0,
HostId: 100,
Length: 1,
},
}
additionalIPs := []string{"8.8.8.8", "2001:db8:85a3::8a2e:370:7334"}
createdAt := time.Now()
config := &runtime.PodSandboxConfig{
Expand All @@ -46,6 +53,11 @@ func TestPodSandboxStatus(t *testing.T) {
Network: runtime.NamespaceMode_NODE,
Pid: runtime.NamespaceMode_CONTAINER,
Ipc: runtime.NamespaceMode_POD,
UsernsOptions: &runtime.UserNamespace{
Uids: idmap,
Gids: idmap,
Mode: runtime.NamespaceMode_POD,
},
},
},
},
Expand Down Expand Up @@ -80,6 +92,11 @@ func TestPodSandboxStatus(t *testing.T) {
Network: runtime.NamespaceMode_NODE,
Pid: runtime.NamespaceMode_CONTAINER,
Ipc: runtime.NamespaceMode_POD,
UsernsOptions: &runtime.UserNamespace{
Uids: idmap,
Gids: idmap,
Mode: runtime.NamespaceMode_POD,
},
},
},
},
Expand Down

0 comments on commit 06ed897

Please sign in to comment.