Adjust overlay tests to expect "index=off"

When running tests on any modern distro, this assumption will work. If
we need to make it work with kernels where we don't append this option
it will require some more involved changes.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
Phil Estes 2020-11-19 10:59:40 -05:00
parent 027ee569a3
commit 85d9fe3e8c
No known key found for this signature in database
GPG Key ID: 0F386284C03A1162

View File

@ -174,6 +174,7 @@ func testOverlayOverlayMount(t *testing.T, newSnapshotter testsuite.SnapshotterF
lower = "lowerdir=" + getParents(ctx, o, root, "/tmp/layer2")[0] lower = "lowerdir=" + getParents(ctx, o, root, "/tmp/layer2")[0]
) )
for i, v := range []string{ for i, v := range []string{
"index=off",
work, work,
upper, upper,
lower, lower,
@ -334,12 +335,12 @@ func testOverlayView(t *testing.T, newSnapshotter testsuite.SnapshotterFunc) {
if m.Source != "overlay" { if m.Source != "overlay" {
t.Errorf("mount source should be overlay but received %q", m.Source) t.Errorf("mount source should be overlay but received %q", m.Source)
} }
if len(m.Options) != 1 { if len(m.Options) != 2 {
t.Errorf("expected 1 mount option but got %d", len(m.Options)) t.Errorf("expected 1 additional mount option but got %d", len(m.Options))
} }
lowers := getParents(ctx, o, root, "/tmp/view2") lowers := getParents(ctx, o, root, "/tmp/view2")
expected = fmt.Sprintf("lowerdir=%s:%s", lowers[0], lowers[1]) expected = fmt.Sprintf("lowerdir=%s:%s", lowers[0], lowers[1])
if m.Options[0] != expected { if m.Options[1] != expected {
t.Errorf("expected option %q but received %q", expected, m.Options[0]) t.Errorf("expected option %q but received %q", expected, m.Options[0])
} }
} }