Skip to content

Commit f494bef

Browse files
committed
mountinfo: TestParseMountinfoExtraCases: add check for Optional field
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent ed1c474 commit f494bef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mountinfo/mountinfo_linux_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ func TestParseMountinfoExtraCases(t *testing.T) {
649649
name: "one optional field",
650650
entry: `251 15 0:3573 / /mnt/point rw,relatime shared:123 - aufs none rw`,
651651
valid: true,
652-
exp: &Info{Mountpoint: "/mnt/point", FSType: "aufs", Source: "none", Optional: "shared:123 extra:tag what:ever"},
652+
exp: &Info{Mountpoint: "/mnt/point", FSType: "aufs", Source: "none", Optional: "shared:123"},
653653
},
654654
{
655655
name: "extra optional fields", // which we carefully gather
@@ -696,6 +696,9 @@ func TestParseMountinfoExtraCases(t *testing.T) {
696696
if tc.exp.Source != "" && tc.exp.Source != i.Source {
697697
t.Errorf("expected src %s, got %s", tc.exp.Source, i.Source)
698698
}
699+
if tc.exp.Optional != "" && tc.exp.Optional != i.Optional {
700+
t.Errorf("expected optional %s, got %s", tc.exp.Optional, i.Optional)
701+
}
699702
})
700703
}
701704
}

0 commit comments

Comments
 (0)