Skip to content

Commit 9574140

Browse files
authored
test: mount directory
1 parent 3a3a9e6 commit 9574140

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

deviceplugin/path_test.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,38 @@ func TestDiscoverPaths(t *testing.T) {
309309
out: []device{},
310310
err: nil,
311311
},
312+
{
313+
name: "mount directory",
314+
ds: &DeviceSpec{
315+
Name: "input",
316+
Groups: []*Group{
317+
{
318+
Paths: []*Path{
319+
{
320+
Path: "/dev/input",
321+
Type: MountPathType,
322+
},
323+
},
324+
},
325+
},
326+
},
327+
fs: fstest.MapFS{
328+
"dev/input/event0": {},
329+
"dev/input/event1": {},
330+
"dev/input/event2": {},
331+
},
332+
out: []device{
333+
{
334+
mounts: []*v1beta1.Mount{
335+
{
336+
ContainerPath: "/dev/input",
337+
HostPath: "/dev/input",
338+
},
339+
},
340+
},
341+
},
342+
err: nil,
343+
},
312344
} {
313345
t.Run(tc.name, func(t *testing.T) {
314346
tc.ds.Default()

0 commit comments

Comments
 (0)