Skip to content

Commit 5bb3159

Browse files
authored
Merge pull request #1 from kolyshkin/nosrc-test
mountinfo: add "empty source" test case
2 parents 07b9aaa + fe469f7 commit 5bb3159

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mountinfo/mountinfo_linux_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,12 @@ func TestParseMountinfoExtraCases(t *testing.T) {
616616
valid: true,
617617
exp: &Info{Mountpoint: "/mnt/point", Fstype: "aufs", Source: "none", Optional: "shared:123 extra:tag what:ever"},
618618
},
619+
{
620+
name: "empty source field (kernel < 5.1 bug)",
621+
entry: `279 23 0:108 / /tmp/bb rw,relatime - tmpfs rw`,
622+
valid: true,
623+
exp: &Info{Mountpoint: "/tmp/bb", Fstype: "tmpfs", Source: "", VfsOpts: "rw"},
624+
},
619625
}
620626

621627
for _, tc := range testcases {

0 commit comments

Comments
 (0)