YARN-852. Merging change r1494733 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1494735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2013-06-19 18:54:50 +00:00
parent 84e902a0d3
commit e597eaf136
2 changed files with 17 additions and 7 deletions

View File

@ -660,6 +660,9 @@ Release 2.1.0-beta - UNRELEASED
YARN-597. TestFSDownload fails on Windows due to dependencies on YARN-597. TestFSDownload fails on Windows due to dependencies on
tar/gzip/jar tools. (Ivan Mitic via acmurthy) tar/gzip/jar tools. (Ivan Mitic via acmurthy)
YARN-852. TestAggregatedLogFormat.testContainerLogsFileAccess fails on
Windows. (Chuan Liu via cnauroth)
YARN-795. Fair scheduler queue metrics should subtract allocated vCores from YARN-795. Fair scheduler queue metrics should subtract allocated vCores from
available vCores. (ywskycn via tucu) available vCores. (ywskycn via tucu)

View File

@ -206,27 +206,34 @@ public class TestAggregatedLogFormat {
sb.append(line); sb.append(line);
} }
line = sb.toString(); line = sb.toString();
String expectedOwner = ugi.getShortUserName();
if (Path.WINDOWS) {
final String adminsGroupString = "Administrators";
if (Arrays.asList(ugi.getGroupNames()).contains(adminsGroupString)) {
expectedOwner = adminsGroupString;
}
}
String stdoutFile1 = String stdoutFile1 =
StringUtils.join( StringUtils.join(
Path.SEPARATOR, File.separator,
Arrays.asList(new String[] { Arrays.asList(new String[] {
srcFileRoot.toUri().toString(), workDir.getAbsolutePath(), "srcFiles",
testContainerId1.getApplicationAttemptId().getApplicationId() testContainerId1.getApplicationAttemptId().getApplicationId()
.toString(), testContainerId1.toString(), stderr })); .toString(), testContainerId1.toString(), stderr }));
String message1 = String message1 =
"Owner '" + ugi.getShortUserName() + "' for path " + stdoutFile1 "Owner '" + expectedOwner + "' for path " + stdoutFile1
+ " did not match expected owner '" + randomUser + "'"; + " did not match expected owner '" + randomUser + "'";
String stdoutFile2 = String stdoutFile2 =
StringUtils.join( StringUtils.join(
Path.SEPARATOR, File.separator,
Arrays.asList(new String[] { Arrays.asList(new String[] {
srcFileRoot.toUri().toString(), workDir.getAbsolutePath(), "srcFiles",
testContainerId1.getApplicationAttemptId().getApplicationId() testContainerId1.getApplicationAttemptId().getApplicationId()
.toString(), testContainerId1.toString(), stdout })); .toString(), testContainerId1.toString(), stdout }));
String message2 = String message2 =
"Owner '" + ugi.getShortUserName() + "' for path " "Owner '" + expectedOwner + "' for path "
+ stdoutFile2 + " did not match expected owner '" + stdoutFile2 + " did not match expected owner '"
+ ugi.getShortUserName() + "'"; + ugi.getShortUserName() + "'";