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
via jeagles)
YARN-1883. TestRMAdminService fails due to inconsistent entries in
UserGroups (Mit Desai via jeagles)
OPTIMIZATIONS
BUG FIXES

View File

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