YARN-1883. TestRMAdminService fails due to inconsistent entries in UserGroups (Mit Desai via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1582862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Turner Eagles 2014-03-28 19:30:08 +00:00
parent 3f7aa79e58
commit 6d2e1fde63
2 changed files with 14 additions and 6 deletions

View File

@ -48,6 +48,9 @@ Release 2.5.0 - UNRELEASED
YARN-1136. Replace junit.framework.Assert with org.junit.Assert (Chen He YARN-1136. Replace junit.framework.Assert with org.junit.Assert (Chen He
via jeagles) via jeagles)
YARN-1883. TestRMAdminService fails due to inconsistent entries in
UserGroups (Mit Desai via jeagles)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -90,6 +90,9 @@ public void setup() throws IOException {
fs.delete(tmpDir, true); fs.delete(tmpDir, true);
fs.mkdirs(workingPath); fs.mkdirs(workingPath);
fs.mkdirs(tmpDir); fs.mkdirs(tmpDir);
// reset the groups to what it default test settings
MockUnixGroupsMapping.resetGroups();
} }
@After @After
@ -785,12 +788,7 @@ private void uploadDefaultConfiguration() throws IOException {
private static class MockUnixGroupsMapping implements private static class MockUnixGroupsMapping implements
GroupMappingServiceProvider { GroupMappingServiceProvider {
@SuppressWarnings("serial") private static List<String> group = new ArrayList<String>();
private static List<String> group = new ArrayList<String>() {{
add("test_group_A");
add("test_group_B");
add("test_group_C");
}};
@Override @Override
public List<String> getGroups(String user) throws IOException { public List<String> getGroups(String user) throws IOException {
@ -813,6 +811,13 @@ public static void updateGroups() {
group.add("test_group_E"); group.add("test_group_E");
group.add("test_group_F"); group.add("test_group_F");
} }
public static void resetGroups() {
group.clear();
group.add("test_group_A");
group.add("test_group_B");
group.add("test_group_C");
}
} }
} }