public virtual void TestGetFullDirs() { Configuration conf = new YarnConfiguration(); conf.Set(CommonConfigurationKeys.FsPermissionsUmaskKey, "077"); FileContext localFs = FileContext.GetLocalFSFileContext(conf); string localDir1 = new FilePath(testDir, "localDir1").GetPath(); string localDir2 = new FilePath(testDir, "localDir2").GetPath(); string logDir1 = new FilePath(testDir, "logDir1").GetPath(); string logDir2 = new FilePath(testDir, "logDir2").GetPath(); Path localDir1Path = new Path(localDir1); Path logDir1Path = new Path(logDir1); FsPermission dirPermissions = new FsPermission((short)0x108); localFs.Mkdir(localDir1Path, dirPermissions, true); localFs.Mkdir(logDir1Path, dirPermissions, true); conf.Set(YarnConfiguration.NmLocalDirs, localDir1 + "," + localDir2); conf.Set(YarnConfiguration.NmLogDirs, logDir1 + "," + logDir2); conf.SetFloat(YarnConfiguration.NmMaxPerDiskUtilizationPercentage, 0.0f); LocalDirsHandlerService dirSvc = new LocalDirsHandlerService(); dirSvc.Init(conf); NUnit.Framework.Assert.AreEqual(0, dirSvc.GetLocalDirs().Count); NUnit.Framework.Assert.AreEqual(0, dirSvc.GetLogDirs().Count); NUnit.Framework.Assert.AreEqual(1, dirSvc.GetDiskFullLocalDirs().Count); NUnit.Framework.Assert.AreEqual(1, dirSvc.GetDiskFullLogDirs().Count); FileUtils.DeleteDirectory(new FilePath(localDir1)); FileUtils.DeleteDirectory(new FilePath(localDir2)); FileUtils.DeleteDirectory(new FilePath(logDir1)); FileUtils.DeleteDirectory(new FilePath(logDir1)); dirSvc.Close(); }