github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs_test.go (about)

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