Browse Source

Fix overlay test running on overlay

Overlay tests were failing when /var/tmp was an overlay mount with a misleading message.
Now overlay tests will be skipped when attempting to be run on overlay.
Tests will now use the TMPDIR environment variable instead of only /var/tmp

Fixes #21686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Derek McGowan 9 năm trước cách đây
mục cha
commit
824c72f472

+ 1 - 1
daemon/graphdriver/graphtest/graphtest_unix.go

@@ -67,7 +67,7 @@ func getBaseLoopStats() (*syscall.Stat_t, error) {
 }
 
 func newDriver(t *testing.T, name string) *Driver {
-	root, err := ioutil.TempDir("/var/tmp", "docker-graphtest-")
+	root, err := ioutil.TempDir("", "docker-graphtest-")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 4 - 1
daemon/graphdriver/overlay/overlay.go

@@ -120,7 +120,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
 		backingFs = fsName
 	}
 
-	// check if they are running over btrfs or aufs
+	// check if they are running over btrfs, aufs, zfs or overlay
 	switch fsMagic {
 	case graphdriver.FsMagicBtrfs:
 		logrus.Error("'overlay' is not supported over btrfs.")
@@ -131,6 +131,9 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
 	case graphdriver.FsMagicZfs:
 		logrus.Error("'overlay' is not supported over zfs.")
 		return nil, graphdriver.ErrIncompatibleFS
+	case graphdriver.FsMagicOverlay:
+		logrus.Error("'overlay' is not supported over overlay.")
+		return nil, graphdriver.ErrIncompatibleFS
 	}
 
 	rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)