diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-24 13:34:25 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-24 13:43:32 +0900 |
| commit | b989a4601a386561103715187fde9400ad5b4e72 (patch) | |
| tree | d4693c7d454064bf3ab505c29da7502e46915b4b /test/sandbox/assert.go | |
| parent | a11237b15848cc99d117ca6eb832eed0c92c64ec (diff) | |
test/sandbox: fail on mismatched mount entry
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox/assert.go')
| -rw-r--r-- | test/sandbox/assert.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sandbox/assert.go b/test/sandbox/assert.go index c7d3ca40..f5d9e391 100644 --- a/test/sandbox/assert.go +++ b/test/sandbox/assert.go @@ -50,6 +50,7 @@ func (t *T) MustCheck(want *TestCase) { } if want.Mount != nil { + var fail bool m := mustParseMountinfo(t.MountsPath) i := 0 for ent := range m.Entries() { @@ -57,6 +58,7 @@ func (t *T) MustCheck(want *TestCase) { fatalf("got more than %d entries", i) } if !ent.EqualWithIgnore(want.Mount[i], "//ignore") { + fail = true printf("[FAIL] %s", ent) } else { printf("[ OK ] %s", ent) @@ -67,6 +69,10 @@ func (t *T) MustCheck(want *TestCase) { if err := m.Err(); err != nil { fatalf("%v", err) } + + if fail { + fatalf("[FAIL] some mount points did not match") + } } else { printf("[SKIP] skipping mounts check") } |
