github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/daemon/graphdriver/overlay/overlay_test.go (about)

     1  // +build linux
     2  
     3  package overlay // import "github.com/demonoid81/moby/daemon/graphdriver/overlay"
     4  
     5  import (
     6  	"testing"
     7  
     8  	"github.com/demonoid81/moby/daemon/graphdriver"
     9  	"github.com/demonoid81/moby/daemon/graphdriver/graphtest"
    10  	"github.com/demonoid81/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  	graphdriver.ApplyUncompressedLayer = archive.ApplyUncompressedLayer
    17  }
    18  
    19  // This avoids creating a new driver for each test if all tests are run
    20  // Make sure to put new tests between TestOverlaySetup and TestOverlayTeardown
    21  func TestOverlaySetup(t *testing.T) {
    22  	graphtest.GetDriver(t, "overlay")
    23  }
    24  
    25  func TestOverlayCreateEmpty(t *testing.T) {
    26  	graphtest.DriverTestCreateEmpty(t, "overlay")
    27  }
    28  
    29  func TestOverlayCreateBase(t *testing.T) {
    30  	graphtest.DriverTestCreateBase(t, "overlay")
    31  }
    32  
    33  func TestOverlayCreateSnap(t *testing.T) {
    34  	graphtest.DriverTestCreateSnap(t, "overlay")
    35  }
    36  
    37  func TestOverlay50LayerRead(t *testing.T) {
    38  	graphtest.DriverTestDeepLayerRead(t, 50, "overlay")
    39  }
    40  
    41  // Fails due to bug in calculating changes after apply
    42  // likely related to https://github.com/demonoid81/moby/issues/21555
    43  func TestOverlayDiffApply10Files(t *testing.T) {
    44  	t.Skipf("Fails to compute changes after apply intermittently")
    45  	graphtest.DriverTestDiffApply(t, 10, "overlay")
    46  }
    47  
    48  func TestOverlayChanges(t *testing.T) {
    49  	t.Skipf("Fails to compute changes intermittently")
    50  	graphtest.DriverTestChanges(t, "overlay")
    51  }
    52  
    53  func TestOverlayTeardown(t *testing.T) {
    54  	graphtest.PutDriver(t)
    55  }
    56  
    57  // Benchmarks should always setup new driver
    58  
    59  func BenchmarkExists(b *testing.B) {
    60  	graphtest.DriverBenchExists(b, "overlay")
    61  }
    62  
    63  func BenchmarkGetEmpty(b *testing.B) {
    64  	graphtest.DriverBenchGetEmpty(b, "overlay")
    65  }
    66  
    67  func BenchmarkDiffBase(b *testing.B) {
    68  	graphtest.DriverBenchDiffBase(b, "overlay")
    69  }
    70  
    71  func BenchmarkDiffSmallUpper(b *testing.B) {
    72  	graphtest.DriverBenchDiffN(b, 10, 10, "overlay")
    73  }
    74  
    75  func BenchmarkDiff10KFileUpper(b *testing.B) {
    76  	graphtest.DriverBenchDiffN(b, 10, 10000, "overlay")
    77  }
    78  
    79  func BenchmarkDiff10KFilesBottom(b *testing.B) {
    80  	graphtest.DriverBenchDiffN(b, 10000, 10, "overlay")
    81  }
    82  
    83  func BenchmarkDiffApply100(b *testing.B) {
    84  	graphtest.DriverBenchDiffApplyN(b, 100, "overlay")
    85  }
    86  
    87  func BenchmarkDiff20Layers(b *testing.B) {
    88  	graphtest.DriverBenchDeepLayerDiff(b, 20, "overlay")
    89  }
    90  
    91  func BenchmarkRead20Layers(b *testing.B) {
    92  	graphtest.DriverBenchDeepLayerRead(b, 20, "overlay")
    93  }