UtilsForTests.setUpConfigFile(queueConfProps, queueConfigFile);
//Create a new configuration to be used with QueueManager
JobConf conf = new JobConf();
QueueManager queueManager = new QueueManager(conf);
UserGroupInformation ugi = UserGroupInformation.
createUserForTesting("user1", new String [] {"group1"});
//Job Submission should fail because ugi to be used is set to blank.
assertFalse("User Job Submission Succeeded before refresh.",
queueManager.hasAccess("default", QueueACL.SUBMIT_JOB, ugi));
assertFalse("User Job Submission Succeeded before refresh.",
queueManager.hasAccess("q1", QueueACL.SUBMIT_JOB, ugi));
assertFalse("User Job Submission Succeeded before refresh.",
queueManager.hasAccess("q2", QueueACL.SUBMIT_JOB, ugi));
//Test job submission as alternate user.
UserGroupInformation alternateUgi =
UserGroupInformation.createUserForTesting("u1", new String[]{"user"});
assertTrue("Alternate User Job Submission failed before refresh.",
queueManager.hasAccess("q2", QueueACL.SUBMIT_JOB, alternateUgi));
//Set acl for user1.