MCPcopy
hub / github.com/containerd/containerd / TestToHostOverflow

Function TestToHostOverflow

internal/userns/idmap_test.go:182–302  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestToHostOverflow(t *testing.T) {
183 for _, test := range []struct {
184 idmap IDMap
185 user User
186 }{
187 {
188 idmap: IDMap{
189 UidMap: []specs.LinuxIDMapping{
190 {
191 ContainerID: 1<<32 - 1000,
192 HostID: 1000,
193 Size: 10000,
194 },
195 },
196 GidMap: []specs.LinuxIDMapping{
197 {
198 ContainerID: 0,
199 HostID: 1000,
200 Size: 10000,
201 },
202 },
203 },
204 user: User{
205 Uid: 1<<32 - 100,
206 Gid: 0,
207 },
208 },
209 {
210 idmap: IDMap{
211 UidMap: []specs.LinuxIDMapping{
212 {
213 ContainerID: 0,
214 HostID: 1000,
215 Size: 10000,
216 },
217 },
218 GidMap: []specs.LinuxIDMapping{
219 {
220 ContainerID: 1<<32 - 1000,
221 HostID: 1000,
222 Size: 10000,
223 },
224 },
225 },
226 user: User{
227 Uid: 0,
228 Gid: 1<<32 - 100,
229 },
230 },
231 {
232 idmap: IDMap{
233 UidMap: []specs.LinuxIDMapping{
234 {
235 ContainerID: 0,
236 HostID: 1000,
237 Size: 1<<32 - 1,
238 },
239 },

Callers

nothing calls this directly

Calls 2

ToHostMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…