Merge pull request #1103 from AkihiroSuda/fix-testsuite

checkSnapshotterBasic: fix umount
This commit is contained in:
Phil Estes 2017-07-11 08:46:01 -04:00 committed by GitHub
commit 6c21d7ea5b

View File

@ -181,13 +181,14 @@ func checkSnapshotterBasic(ctx context.Context, t *testing.T, snapshotter snapsh
if err := mount.MountAll(mounts, nextnext); err != nil { if err := mount.MountAll(mounts, nextnext); err != nil {
t.Fatalf("failure reason: %+v", err) t.Fatalf("failure reason: %+v", err)
} }
defer testutil.Unmount(t, nextnext)
if err := fstest.CheckDirectoryEqualWithApplier(nextnext, if err := fstest.CheckDirectoryEqualWithApplier(nextnext,
fstest.Apply(initialApplier, diffApplier)); err != nil { fstest.Apply(initialApplier, diffApplier)); err != nil {
testutil.Unmount(t, nextnext)
t.Fatalf("failure reason: %+v", err) t.Fatalf("failure reason: %+v", err)
} }
testutil.Unmount(t, nextnext)
assert.NoError(t, snapshotter.Remove(ctx, nextnext)) assert.NoError(t, snapshotter.Remove(ctx, nextnext))
assert.Error(t, snapshotter.Remove(ctx, committed)) assert.Error(t, snapshotter.Remove(ctx, committed))
assert.NoError(t, snapshotter.Remove(ctx, nextCommitted)) assert.NoError(t, snapshotter.Remove(ctx, nextCommitted))