use of org.ow2.proactive.resourcemanager.authentication.RMAuthentication in project scheduling by ow2-proactive.
the class SchedulerStarter method startResourceManager.
private static void startResourceManager(final int numberLocalNodes, final int nodeTimeoutValue) {
final Thread rmStarter = new Thread() {
public void run() {
try {
// Starting a local RM using default deployment descriptor
RMFactory.setOsJavaProperty();
LOGGER.info("Starting the resource manager...");
RMAuthentication rmAuth = RMFactory.startLocal();
if (numberLocalNodes > 0) {
addLocalNodes(rmAuth, numberLocalNodes, nodeTimeoutValue);
}
LOGGER.info("The resource manager with " + numberLocalNodes + " local nodes created on " + rmAuth.getHostURL());
} catch (AlreadyBoundException abe) {
LOGGER.error("The resource manager already exists on local host", abe);
System.exit(4);
} catch (Exception aoce) {
LOGGER.error("Unable to create local resource manager", aoce);
System.exit(5);
}
}
};
rmStarter.start();
}
use of org.ow2.proactive.resourcemanager.authentication.RMAuthentication in project scheduling by ow2-proactive.
the class AuthenticationTest method loginScenarios.
@Test
public void loginScenarios() throws Exception {
RMAuthentication auth = rmHelper.getRMAuth();
rmHelper.disconnect();
loginAsAdmin(auth);
loginAsUser(auth);
loginIncorrectAdminPassword(auth);
loginIncorrectUserPassword(auth);
}
use of org.ow2.proactive.resourcemanager.authentication.RMAuthentication in project scheduling by ow2-proactive.
the class AuthenticationTest method loginIncorrectAdminPassword.
private void loginIncorrectAdminPassword(RMAuthentication auth) throws KeyException {
// negative
log("Test 3");
log("Trying to authorized with incorrect user name and password");
try {
Credentials cred = Credentials.createCredentials(new CredData(TestUsers.DEMO.username, "b"), auth.getPublicKey());
auth.login(cred);
fail("Error: successful authentication");
} catch (LoginException e) {
log("Passed: expected error " + e.getMessage());
}
}
use of org.ow2.proactive.resourcemanager.authentication.RMAuthentication in project scheduling by ow2-proactive.
the class AuthenticationTest method loginAsUser.
private void loginAsUser(RMAuthentication auth) throws LoginException, KeyException {
log("Test 2");
log("Trying to authorized with correct user name and password");
Credentials cred = Credentials.createCredentials(new CredData(TestUsers.USER.username, TestUsers.USER.password), auth.getPublicKey());
ResourceManager user = auth.login(cred);
user.disconnect().getBooleanValue();
log("Passed: successful authentication");
}
use of org.ow2.proactive.resourcemanager.authentication.RMAuthentication in project scheduling by ow2-proactive.
the class RMProxyUserInterfaceTest method createRMCachingProxyUserInterface.
private RMListenerProxy createRMCachingProxyUserInterface() throws Exception {
RMListenerProxy proxyUserInterface = PAActiveObject.newActive(RMListenerProxy.class, new Object[] {});
final RMAuthentication auth = rmHelper.getRMAuth();
final PublicKey pubKey = auth.getPublicKey();
final Credentials adminCreds = Credentials.createCredentials(new CredData(TestUsers.TEST.username, TestUsers.TEST.password), pubKey);
proxyUserInterface.init(RMTHelper.getLocalUrl(), adminCreds);
return proxyUserInterface;
}
Aggregations