Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mount/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/moby/sys/mount
go 1.14

require (
github.com/moby/sys/mountinfo v0.1.0
github.com/moby/sys/mountinfo v0.3.1
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860
)
5 changes: 3 additions & 2 deletions mount/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
github.com/moby/sys/mountinfo v0.1.0 h1:r8vMRbMAFEAfiNptYVokP+nfxPJzvRuia5e2vzXtENo=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.3.1 h1:R+C9GycEzoR3GdwQ7mANRhJORnVDJiRkf0JMY82MeI0=
github.com/moby/sys/mountinfo v0.3.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860 h1:YEu4SMq7D0cmT7CBbXfcH0NZeuChAXwsHe/9XueUO6o=
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
18 changes: 9 additions & 9 deletions mount/mounter_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
// Use parent info as the defaults
p := mnts[mi.Parent]
pOpts := make(map[string]struct{})
if p.Opts != "" {
for _, opt := range strings.Split(p.Opts, ",") {
if p.Options != "" {
for _, opt := range strings.Split(p.Options, ",") {
pOpts[clean(opt)] = struct{}{}
}
}
Expand All @@ -166,9 +166,9 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
}
}

// Validate Opts
if mi.Opts != "" {
for _, opt := range strings.Split(mi.Opts, ",") {
// Validate Options
if mi.Options != "" {
for _, opt := range strings.Split(mi.Options, ",") {
opt = clean(opt)
if !has(wantedOpts, opt) && !has(pOpts, opt) && opt != "relatime" {
t.Errorf("unexpected mount option %q, expected %q", opt, opts)
Expand All @@ -177,7 +177,7 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
}
}
for opt := range wantedOpts {
t.Errorf("missing mount option %q, found %q", opt, mi.Opts)
t.Errorf("missing mount option %q, found %q", opt, mi.Options)
}

// Validate Optional
Expand All @@ -196,8 +196,8 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {

// Validate VFS if set
if vfs != "" {
if mi.VfsOpts != "" {
for _, opt := range strings.Split(mi.VfsOpts, ",") {
if mi.VFSOptions != "" {
for _, opt := range strings.Split(mi.VFSOptions, ",") {
opt = clean(opt)
if !has(wantedVFS, opt) && opt != "seclabel" { // can be added by selinux
t.Errorf("unexpected vfs option %q, expected %q", opt, vfs)
Expand All @@ -206,7 +206,7 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
}
}
for opt := range wantedVFS {
t.Errorf("missing vfs option %q, found %q", opt, mi.VfsOpts)
t.Errorf("missing vfs option %q, found %q", opt, mi.VFSOptions)
}
}

Expand Down