use of org.ow2.proactive.resourcemanager.frontend.ResourceManager in project scheduling by ow2-proactive.
the class TestRMProxy method requestWithExtraNodes.
private void requestWithExtraNodes(RMProxy proxy, ResourceManager rm) throws Exception {
log("Request NodeSet with extra nodes");
TopologyDescriptor topology = TopologyDescriptor.SINGLE_HOST_EXCLUSIVE;
Criteria criteria = new Criteria(1);
criteria.setTopology(topology);
NodeSet nodeSet = proxy.getNodes(criteria);
PAFuture.waitFor(nodeSet);
assertEquals(1, nodeSet.size());
Assert.assertNotNull("Extra nodes are expected", nodeSet.getExtraNodes());
assertEquals(NODES_NUMBER - 1, nodeSet.getExtraNodes().size());
assertEquals(0, rm.getState().getFreeNodesNumber());
proxy.releaseNodes(nodeSet);
waitWhenNodesAreReleased(NODES_NUMBER);
assertEquals(NODES_NUMBER, rm.getState().getFreeNodesNumber());
}
use of org.ow2.proactive.resourcemanager.frontend.ResourceManager in project scheduling by ow2-proactive.
the class TestRMProxy method requestReleaseAllNodes.
private void requestReleaseAllNodes(RMProxy proxy, ResourceManager rm) throws Exception {
log("Request and release all nodes");
List<NodeSet> nodeSets = new ArrayList<>();
for (int i = 0; i < NODES_NUMBER; i++) {
nodeSets.add(proxy.getNodes(new Criteria(1)));
}
for (NodeSet nodeSet : nodeSets) {
waitWhenNodeSetAcquired(nodeSet, 1);
proxy.releaseNodes(nodeSet);
}
waitWhenNodesAreReleased(NODES_NUMBER);
assertEquals(NODES_NUMBER, rm.getState().getFreeNodesNumber());
}
use of org.ow2.proactive.resourcemanager.frontend.ResourceManager in project scheduling by ow2-proactive.
the class TestRMProxy method testSplitNodeSet.
private void testSplitNodeSet(RMProxy proxy, ResourceManager rm) throws Exception {
log("Request as single NodeSet, release it as two NodeSets");
NodeSet nodeSet = proxy.getNodes(new Criteria(3));
waitWhenNodeSetAcquired(nodeSet, 3);
assertEquals(NODES_NUMBER - 3, rm.getState().getFreeNodesNumber());
NodeSet nodeSet1 = new NodeSet();
nodeSet1.add(nodeSet.remove(0));
NodeSet nodeSet2 = new NodeSet();
nodeSet2.add(nodeSet.remove(0));
nodeSet2.add(nodeSet.remove(0));
proxy.releaseNodes(nodeSet1);
waitWhenNodesAreReleased(1);
assertEquals(NODES_NUMBER - 2, rm.getState().getFreeNodesNumber());
proxy.releaseNodes(nodeSet2);
waitWhenNodesAreReleased(2);
assertEquals(NODES_NUMBER, rm.getState().getFreeNodesNumber());
}
use of org.ow2.proactive.resourcemanager.frontend.ResourceManager in project scheduling by ow2-proactive.
the class NodeRecoveryTest method startKillStartRM.
/**
* This method tests performance of node recovery using local infrastructure.
*
* @throws Exception
*/
public void startKillStartRM() throws Exception {
ProActiveConfiguration.load();
rmHelper = new RMTHelper();
rmHelper.startRM(RM_CONFIGURATION_START);
assertTrue(PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean());
assertTrue(rmHelper.isRMStarted());
ResourceManager resourceManager = rmHelper.getResourceManager();
assertEquals(0, resourceManager.getState().getAllNodes().size());
rmHelper.createNodeSourceWithInfiniteTimeout(RMConstants.DEFAULT_STATIC_SOURCE_NAME, nodesNumber);
assertEquals(nodesNumber, resourceManager.getState().getAllNodes().size());
RecoverInfrastructureTestHelper.killRmWithStrongSigKill();
rmHelper.startRM(RM_CONFIGURATION_RESTART);
resourceManager = rmHelper.getResourceManager();
assertEquals(nodesNumber, resourceManager.getState().getAllNodes().size());
}
use of org.ow2.proactive.resourcemanager.frontend.ResourceManager 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");
}
Aggregations