github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs_test.go (about) 1 //go:build linux 2 3 package fuseoverlayfs // import "github.com/Prakhar-Agarwal-byte/moby/daemon/graphdriver/fuse-overlayfs" 4 5 import ( 6 "testing" 7 8 "github.com/Prakhar-Agarwal-byte/moby/daemon/graphdriver" 9 "github.com/Prakhar-Agarwal-byte/moby/daemon/graphdriver/graphtest" 10 "github.com/Prakhar-Agarwal-byte/moby/pkg/archive" 11 ) 12 13 func init() { 14 // Do not sure chroot to speed run time and allow archive 15 // errors or hangs to be debugged directly from the test process. 16 untar = archive.UntarUncompressed 17 graphdriver.ApplyUncompressedLayer = archive.ApplyUncompressedLayer 18 } 19 20 // This avoids creating a new driver for each test if all tests are run 21 // Make sure to put new tests between TestFUSEOverlayFSSetup and TestFUSEOverlayFSTeardown 22 func TestFUSEOverlayFSSetup(t *testing.T) { 23 graphtest.GetDriver(t, driverName) 24 } 25 26 func TestFUSEOverlayFSCreateEmpty(t *testing.T) { 27 graphtest.DriverTestCreateEmpty(t, driverName) 28 } 29 30 func TestFUSEOverlayFSCreateBase(t *testing.T) { 31 graphtest.DriverTestCreateBase(t, driverName) 32 } 33 34 func TestFUSEOverlayFSCreateSnap(t *testing.T) { 35 graphtest.DriverTestCreateSnap(t, driverName) 36 } 37 38 func TestFUSEOverlayFS128LayerRead(t *testing.T) { 39 graphtest.DriverTestDeepLayerRead(t, 128, driverName) 40 } 41 42 func TestFUSEOverlayFSTeardown(t *testing.T) { 43 graphtest.PutDriver(t) 44 } 45 46 // Benchmarks should always setup new driver 47 48 func BenchmarkExists(b *testing.B) { 49 graphtest.DriverBenchExists(b, driverName) 50 } 51 52 func BenchmarkGetEmpty(b *testing.B) { 53 graphtest.DriverBenchGetEmpty(b, driverName) 54 } 55 56 func BenchmarkDiffBase(b *testing.B) { 57 graphtest.DriverBenchDiffBase(b, driverName) 58 } 59 60 func BenchmarkDiffSmallUpper(b *testing.B) { 61 graphtest.DriverBenchDiffN(b, 10, 10, driverName) 62 } 63 64 func BenchmarkDiff10KFileUpper(b *testing.B) { 65 graphtest.DriverBenchDiffN(b, 10, 10000, driverName) 66 } 67 68 func BenchmarkDiff10KFilesBottom(b *testing.B) { 69 graphtest.DriverBenchDiffN(b, 10000, 10, driverName) 70 } 71 72 func BenchmarkDiffApply100(b *testing.B) { 73 graphtest.DriverBenchDiffApplyN(b, 100, driverName) 74 } 75 76 func BenchmarkDiff20Layers(b *testing.B) { 77 graphtest.DriverBenchDeepLayerDiff(b, 20, driverName) 78 } 79 80 func BenchmarkRead20Layers(b *testing.B) { 81 graphtest.DriverBenchDeepLayerRead(b, 20, driverName) 82 }