|
@@ -605,7 +605,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
throws Exception {
|
|
|
this.conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDir.getAbsolutePath());
|
|
|
File aNewFile = new File(String.valueOf("tmp"+System.currentTimeMillis()));
|
|
|
- this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
|
|
|
+ this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
|
|
|
aNewFile.getAbsolutePath());
|
|
|
|
|
|
LogAggregationService logAggregationService = spy(
|
|
@@ -622,6 +622,28 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
aNewFile.delete(); //housekeeping
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testRemoteRootLogDirIsCreatedWithCorrectGroupOwner()
|
|
|
+ throws IOException {
|
|
|
+ this.conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDir.getAbsolutePath());
|
|
|
+ Path aNewFile = new Path(String.valueOf("tmp"+System.currentTimeMillis()));
|
|
|
+ this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR, aNewFile.getName());
|
|
|
+
|
|
|
+ LogAggregationService logAggregationService = new LogAggregationService(
|
|
|
+ dispatcher, this.context, this.delSrvc, super.dirsHandler);
|
|
|
+ logAggregationService.init(this.conf);
|
|
|
+ logAggregationService.verifyAndCreateRemoteLogDir(this.conf);
|
|
|
+
|
|
|
+ String targetGroup =
|
|
|
+ UserGroupInformation.getLoginUser().getPrimaryGroupName();
|
|
|
+ FileSystem fs = FileSystem.get(this.conf);
|
|
|
+ FileStatus fileStatus = fs.getFileStatus(aNewFile);
|
|
|
+ Assert.assertEquals("The new aggregate file is not successfully created",
|
|
|
+ fileStatus.getGroup(), targetGroup);
|
|
|
+
|
|
|
+ fs.delete(aNewFile, true);
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testAppLogDirCreation() throws Exception {
|
|
|
final String logSuffix = "logs";
|