aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'test/sandbox')
-rw-r--r--test/sandbox/assert.go2
-rw-r--r--test/sandbox/mount.go12
2 files changed, 13 insertions, 1 deletions
diff --git a/test/sandbox/assert.go b/test/sandbox/assert.go
index 8e446268..fff26047 100644
--- a/test/sandbox/assert.go
+++ b/test/sandbox/assert.go
@@ -60,7 +60,7 @@ func MustAssertMounts(name, hostMountsFile, wantFile string) {
if i == len(want) {
fatalf("got more than %d entries", i)
}
- if *e != want[i] {
+ if !e.Is(&want[i]) {
fatalf("entry %d\n got: %s\nwant: %s", i,
e, &want[i])
}
diff --git a/test/sandbox/mount.go b/test/sandbox/mount.go
index 9c279f87..9a3b58c9 100644
--- a/test/sandbox/mount.go
+++ b/test/sandbox/mount.go
@@ -37,6 +37,18 @@ func (e *Mntent) String() string {
e.FSName, e.Dir, e.Type, e.Opts, e.Freq, e.Passno)
}
+func (e *Mntent) Is(want *Mntent) bool {
+ if want == nil {
+ return e == nil
+ }
+ return (e.FSName == want.FSName || want.FSName == "\x00") &&
+ (e.Dir == want.Dir || want.Dir == "\x00") &&
+ (e.Type == want.Type || want.Type == "\x00") &&
+ (e.Opts == want.Opts || want.Opts == "\x00") &&
+ (e.Freq == want.Freq || want.Freq == -1) &&
+ (e.Passno == want.Passno || want.Passno == -1)
+}
+
func IterMounts(name string, f func(e *Mntent)) error {
m := new(mounts)
m.p = name