tomicooler commented on a change in pull request #3857:
URL: https://github.com/apache/hadoop/pull/3857#discussion_r787533285
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java
##########
@@ -331,25 +338,23 @@ public void
testQueueSubmitWithACLsEnabledWithQueueMapping()
csConf.set(PREFIX + "root.test.acl_submit_applications", "test");
csConf.set(PREFIX + "root.test.acl_administer_queue", "test");
- asContext.setQueue("test");
-
MockRM newMockRM = new MockRM(csConf);
RMContext newMockRMContext = newMockRM.getRMContext();
-
newMockRMContext.setQueuePlacementManager(createMockPlacementManager("test",
"test", null));
+ newMockRMContext.setQueuePlacementManager(
+ createMockPlacementManager("test", "root.test", null));
TestRMAppManager newAppMonitor = createAppManager(newMockRMContext, conf);
- newAppMonitor.submitApplication(asContext, "test");
- RMApp app = newMockRMContext.getRMApps().get(appId);
- Assert.assertNotNull("app should not be null", app);
- Assert.assertEquals("the queue should be placed on 'test' queue", "test",
app.getQueue());
-
- try {
- asContext.setApplicationId(appId = MockApps.newAppID(2));
- newAppMonitor.submitApplication(asContext, "test1");
- Assert.fail("should fail since test1 does not have permission to submit
to queue");
- } catch(YarnException e) {
- assertTrue(e.getCause() instanceof AccessControlException);
- }
+ ApplicationSubmissionContext submission =
createAppSubmissionContext(MockApps.newAppID(1));
+ submission.setQueue("oldQueue");
+ verifyAppSubmission(submission,
+ newAppMonitor,
+ newMockRMContext,
+ "test",
+ "root.test");
+
+ verifyAppSubmissionFailure(newAppMonitor,
+ createAppSubmissionContext(MockApps.newAppID(2)),
+ "test1");
}
@Test
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]