github.com/rawahars/moby@v24.0.4+incompatible/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs_test.go (about)

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