}
func TestContainerInitDNS(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp, err := ioutil.TempDir("", "docker-container-test-")
if err != nil {
t.Fatal(err)
}
func testInit(dir string, t testing.TB) graphdriver.Driver {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
d, err := Init(dir, nil, nil, nil)
if err != nil {
if err == graphdriver.ErrNotSupported {
"github.com/docker/docker/daemon/graphdriver/graphtest"
)
-func init() {
+func shortSkip(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+}
+
+// This avoids creating a new driver for each test if all tests are run
+// Make sure to put new tests between TestDevmapperSetup and TestDevmapperTeardown
+func TestDevmapperSetup(t *testing.T) {
+ shortSkip(t)
+
// Reduce the size the the base fs and loopback for the tests
defaultDataLoopbackSize = 300 * 1024 * 1024
defaultMetaDataLoopbackSize = 200 * 1024 * 1024
defaultBaseFsSize = 300 * 1024 * 1024
defaultUdevSyncOverride = true
if err := graphtest.InitLoopbacks(); err != nil {
- panic(err)
+ t.Fatal(err)
}
-}
-// This avoids creating a new driver for each test if all tests are run
-// Make sure to put new tests between TestDevmapperSetup and TestDevmapperTeardown
-func TestDevmapperSetup(t *testing.T) {
graphtest.GetDriver(t, "devicemapper")
}
func TestDevmapperCreateEmpty(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateEmpty(t, "devicemapper")
}
func TestDevmapperCreateBase(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateBase(t, "devicemapper")
}
func TestDevmapperCreateSnap(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateSnap(t, "devicemapper")
}
func TestDevmapperTeardown(t *testing.T) {
+ shortSkip(t)
+
graphtest.PutDriver(t)
}
func TestDevmapperReduceLoopBackSize(t *testing.T) {
+ shortSkip(t)
+
tenMB := int64(10 * 1024 * 1024)
testChangeLoopBackSize(t, -tenMB, defaultDataLoopbackSize, defaultMetaDataLoopbackSize)
}
func TestDevmapperIncreaseLoopBackSize(t *testing.T) {
+ shortSkip(t)
+
tenMB := int64(10 * 1024 * 1024)
testChangeLoopBackSize(t, tenMB, defaultDataLoopbackSize+tenMB, defaultMetaDataLoopbackSize+tenMB)
}
func testChangeLoopBackSize(t *testing.T, delta, expectDataSize, expectMetaDataSize int64) {
+ shortSkip(t)
+
driver := graphtest.GetDriver(t, "devicemapper").(*graphtest.Driver).Driver.(*graphdriver.NaiveDiffDriver).ProtoDriver.(*Driver)
defer graphtest.PutDriver(t)
// make sure data or metadata loopback size are the default size
// Make sure devices.Lock() has been release upon return from cleanupDeletedDevices() function
func TestDevmapperLockReleasedDeviceDeletion(t *testing.T) {
+ shortSkip(t)
+
driver := graphtest.GetDriver(t, "devicemapper").(*graphtest.Driver).Driver.(*graphdriver.NaiveDiffDriver).ProtoDriver.(*Driver)
defer graphtest.PutDriver(t)
// This avoids creating a new driver for each test if all tests are run
// Make sure to put new tests between TestOverlaySetup and TestOverlayTeardown
func TestOverlaySetup(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
graphtest.GetDriver(t, "overlay")
}
func TestOverlayCreateEmpty(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
graphtest.DriverTestCreateEmpty(t, "overlay")
}
func TestOverlayCreateBase(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
graphtest.DriverTestCreateBase(t, "overlay")
}
func TestOverlayCreateSnap(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
graphtest.DriverTestCreateSnap(t, "overlay")
}
"github.com/docker/docker/pkg/reexec"
)
-func init() {
- reexec.Init()
+func shortSkip(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
}
// This avoids creating a new driver for each test if all tests are run
// Make sure to put new tests between TestVfsSetup and TestVfsTeardown
func TestVfsSetup(t *testing.T) {
+ shortSkip(t)
+
+ reexec.Init()
+
graphtest.GetDriver(t, "vfs")
}
func TestVfsCreateEmpty(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateEmpty(t, "vfs")
}
func TestVfsCreateBase(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateBase(t, "vfs")
}
func TestVfsCreateSnap(t *testing.T) {
+ shortSkip(t)
+
graphtest.DriverTestCreateSnap(t, "vfs")
}
func TestVfsTeardown(t *testing.T) {
+ shortSkip(t)
+
graphtest.PutDriver(t)
}
}
func TestUntarPath(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmpFolder, err := ioutil.TempDir("", "docker-archive-test")
if err != nil {
t.Fatal(err)
}
func TestCopyWithTarInexistentDestWillCreateIt(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tempFolder, err := ioutil.TempDir("", "docker-archive-test")
if err != nil {
t.Fatal(nil)
if runtime.GOOS == "windows" {
t.Skip("hardlinks on Windows")
}
+
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
for i, headers := range [][]*tar.Header{
{
{
}
func TestTarWithBlockCharFifo(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
origin, err := ioutil.TempDir("", "docker-test-tar-hardlink")
if err != nil {
t.Fatal(err)
// TestTarUntarWithXattr is Unix as Lsetxattr is not supported on Windows
func TestTarUntarWithXattr(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
origin, err := ioutil.TempDir("", "docker-test-untar-origin")
if err != nil {
t.Fatal(err)
}
func TestChangesWithChanges(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
// TODO Windows. There may be a way of running this, but turning off for now
// as createSampleDir uses symlinks.
if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" {
t.Skip("symlinks on Windows")
}
+
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
baseLayer, err := ioutil.TempDir("", "docker-changes-test.")
defer os.RemoveAll(baseLayer)
const pluginAddress = "authzplugin.sock"
func TestAuthZRequestPluginError(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
server := authZPluginTestServer{t: t}
go server.start()
defer server.stop()
}
func TestAuthZRequestPlugin(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
server := authZPluginTestServer{t: t}
go server.start()
defer server.stop()
}
func TestAuthZResponsePlugin(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
server := authZPluginTestServer{t: t}
go server.start()
defer server.stop()
reexec.Init()
}
+func shortSkip(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+}
+
func TestChrootTarUntar(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootTarUntar")
if err != nil {
t.Fatal(err)
// gh#10426: Verify the fix for having a huge excludes list (like on `docker load` with large # of
// local images)
func TestChrootUntarWithHugeExcludesList(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootUntarHugeExcludes")
if err != nil {
t.Fatal(err)
}
func TestChrootUntarEmptyArchive(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootUntarEmptyArchive")
if err != nil {
t.Fatal(err)
}
func TestChrootTarUntarWithSymlink(t *testing.T) {
+ shortSkip(t)
+
// TODO Windows: Figure out why this is failing
if runtime.GOOS == "windows" {
t.Skip("Failing on Windows")
}
func TestChrootCopyWithTar(t *testing.T) {
+ shortSkip(t)
+
// TODO Windows: Figure out why this is failing
if runtime.GOOS == "windows" {
t.Skip("Failing on Windows")
}
func TestChrootCopyFileWithTar(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootCopyFileWithTar")
if err != nil {
t.Fatal(err)
}
func TestChrootUntarPath(t *testing.T) {
+ shortSkip(t)
+
// TODO Windows: Figure out why this is failing
if runtime.GOOS == "windows" {
t.Skip("Failing on Windows")
}
func TestChrootUntarEmptyArchiveFromSlowReader(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootUntarEmptyArchiveFromSlowReader")
if err != nil {
t.Fatal(err)
}
func TestChrootApplyEmptyArchiveFromSlowReader(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootApplyEmptyArchiveFromSlowReader")
if err != nil {
t.Fatal(err)
}
func TestChrootApplyDotDotFile(t *testing.T) {
+ shortSkip(t)
+
tmpdir, err := ioutil.TempDir("", "docker-TestChrootApplyDotDotFile")
if err != nil {
t.Fatal(err)
}
func TestMkdirAllAs(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
dirName, err := ioutil.TempDir("", "mkdirall")
if err != nil {
t.Fatalf("Couldn't create temp dir: %v", err)
}
func TestMkdirAllNewAs(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
dirName, err := ioutil.TempDir("", "mkdirnew")
if err != nil {
}
func TestMkdirAs(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
dirName, err := ioutil.TempDir("", "mkdir")
if err != nil {
}
func TestMounted(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
}
func TestMountReadonly(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
}
func TestGetMounts(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
mounts, err := GetMounts()
if err != nil {
t.Fatal(err)
// nothing is propagated in or out
func TestSubtreePrivate(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
// Testing that when a target is a shared mount,
// then child mounts propagate to the source
func TestSubtreeShared(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
// testing that mounts to a shared source show up in the slave target,
// and that mounts into a slave target do _not_ show up in the shared source
func TestSubtreeSharedSlave(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
}
func TestSubtreeUnbindable(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmp := path.Join(os.TempDir(), "mount-tests")
if err := os.MkdirAll(tmp, 0777); err != nil {
t.Fatal(err)
)
func TestReadProcBool(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
tmpDir, err := ioutil.TempDir("", "test-sysinfo-proc")
if err != nil {
t.Fatal(err)
)
func TestRemove(t *testing.T) {
+ if testing.Short() { t.Skip("Skipping privileged test in short mode")
+ }
+
// TODO Windows: Investigate why this test fails on Windows under CI
// but passes locally.
if runtime.GOOS == "windows" {
}
func TestInitializeWithVolumes(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
rootDir, err := ioutil.TempDir("", "local-volume-test")
if err != nil {
t.Fatal(err)
}
func TestCreate(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
rootDir, err := ioutil.TempDir("", "local-volume-test")
if err != nil {
t.Fatal(err)
}
func TestCreateWithOpts(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping privileged test in short mode")
+ }
+
if runtime.GOOS == "windows" {
t.Skip()
}