fuseoverlayfs_test.go 2.2 KB

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