use of org.ow2.proactive.scheduler.common.Scheduler in project scheduling by ow2-proactive.
the class TestRMProxy method setUp.
@BeforeClass
public static void setUp() throws Exception {
if (TestScheduler.isStarted()) {
SchedulerTHelper.log("Killing previous scheduler.");
TestScheduler.kill();
}
rmHelper = new RMTHelper();
rmHelper.getResourceManager();
user1Credentials = Credentials.createCredentials(new CredData("admin", "admin"), rmHelper.getRMAuth().getPublicKey());
user2Credentials = Credentials.createCredentials(new CredData("demo", "demo"), rmHelper.getRMAuth().getPublicKey());
rmHelper.createNodeSource(nsName, NODES_NUMBER);
}
use of org.ow2.proactive.scheduler.common.Scheduler in project scheduling by ow2-proactive.
the class TestRMProxy method checkSchedulerProxy.
private void checkSchedulerProxy(RMProxiesManager proxiesManager) {
log("Check scheduler proxy");
RMProxy proxy = proxiesManager.getRmProxy();
assertEquals(proxy.getState().getFreeNodesNumber(), NODES_NUMBER);
assertTrue(proxy.isActive().getBooleanValue());
}
use of org.ow2.proactive.scheduler.common.Scheduler in project scheduling by ow2-proactive.
the class TestRMReconnectionWhileRunning method testTaskIsNotStuckRunning.
/**
* This case checks that even if exception was trown in main Scheduler loop it will not cause that jobId is running forever.
* @throws Exception
*/
@Test
public void testTaskIsNotStuckRunning() throws Exception {
ProActiveConfiguration.load();
RMFactory.setOsJavaProperty();
schedulerHelper = new SchedulerTHelper(false, true);
schedulerHelper.createNodeSource("local", 3);
schedulerHelper.getSchedulerInterface().changePolicy("functionaltests.rm.PolicyWhichThrowsExceptions");
JobId jobId = schedulerHelper.submitJob(new File(runningJob.toURI()).getAbsolutePath());
JobId jobId2 = schedulerHelper.submitJob(new File(runningJob1.toURI()).getAbsolutePath());
JobId jobId3 = schedulerHelper.submitJob(new File(runningJob2.toURI()).getAbsolutePath());
schedulerHelper.waitForEventTaskRunning(jobId, "running_task_for20s");
schedulerHelper.waitForEventJobFinished(jobId2);
schedulerHelper.waitForEventJobFinished(jobId3);
assertJobFinished(jobId2);
assertJobFinished(jobId3);
assertJobFinished(jobId);
}
use of org.ow2.proactive.scheduler.common.Scheduler in project scheduling by ow2-proactive.
the class TestRunAsMeLinuxNone method testRunAsMe.
@Test
public void testRunAsMe() throws Exception {
// connect to the scheduler using the runasme account
Scheduler scheduler = schedulerHelper.getSchedulerInterface(username, password, null);
JobId jobid = schedulerHelper.testJobSubmission(scheduler, JobFactory.getFactory().createJob(new File(jobDescriptor.toURI()).getAbsolutePath()), false, true);
for (Map.Entry<String, TaskResult> entry : scheduler.getJobResult(jobid).getAllResults().entrySet()) {
if (entry.getKey().contains("RunAsMeTask")) {
Assert.assertTrue("RunAsMe task should display in the logs the correct system user", entry.getValue().getOutput().getStdoutLogs().contains(username));
}
}
}
use of org.ow2.proactive.scheduler.common.Scheduler in project scheduling by ow2-proactive.
the class TestRunAsMeLinuxPwd method testRunAsMe.
@Test
public void testRunAsMe() throws Exception {
// connect to the scheduler using the runasme account
Scheduler scheduler = schedulerHelper.getSchedulerInterface(username, password, null);
JobId jobid = schedulerHelper.testJobSubmission(scheduler, JobFactory.getFactory().createJob(new File(jobDescriptor.toURI()).getAbsolutePath()), false, true);
for (Map.Entry<String, TaskResult> entry : scheduler.getJobResult(jobid).getAllResults().entrySet()) {
if (entry.getKey().contains("RunAsMeTask")) {
Assert.assertTrue("RunAsMe task should display in the logs the correct system user", entry.getValue().getOutput().getStdoutLogs().contains(username));
}
}
}
Aggregations