overlay: add Supported() checker
This function is not called during plugin initialization (#2140), but should be useful for downstream projects that uses overlayfs snapshotter as a Go library. Benchmark result on Ubuntu 17.10, GCE n1-standard-4: BenchmarkOverlaySupportedOnExt4-4 100 20490598 ns/op BenchmarkOverlayUnsupportedOnFType0XFS-4 30000 39316 ns/op BenchmarkOverlaySupportedOnFType1XFS-4 100 19287083 ns/op BenchmarkOverlayUnsupportedOnFAT-4 100 14217772 ns/op i.e. the overhead is typically about 20 msec on this machine. Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -28,7 +28,7 @@ import (
|
||||
)
|
||||
|
||||
// Unmount unmounts a given mountPoint and sets t.Error if it fails
|
||||
func Unmount(t *testing.T, mountPoint string) {
|
||||
func Unmount(t testing.TB, mountPoint string) {
|
||||
t.Log("unmount", mountPoint)
|
||||
err := mount.UnmountAll(mountPoint, umountflags)
|
||||
assert.NilError(t, err)
|
||||
|
Reference in New Issue
Block a user