use of org.jenkinsci.test.acceptance.po.Slave in project acceptance-test-harness by jenkinsci.
the class LocalSlaveController method install.
@Override
public Future<Slave> install(Jenkins jenkins) {
// Just to make sure the dumb slave is set up properly, we should seed it
// with a FS root and executors
final DumbSlave s = jenkins.slaves.create(DumbSlave.class);
s.asLocal();
s.save();
s.waitUntilOnline();
BasicFuture<Slave> b = new BasicFuture<>(null);
b.completed(s);
return b;
}
use of org.jenkinsci.test.acceptance.po.Slave in project acceptance-test-harness by jenkinsci.
the class ScriptTest method execute_system_script.
@Test
public void execute_system_script() throws Exception {
String output = jenkins.runScript("println Jenkins.instance.displayName;");
assertThat(output, is("Jenkins"));
Slave s = slave.install(jenkins).get();
output = s.runScript("println 6 * 7");
assertThat(output, is("42"));
}
use of org.jenkinsci.test.acceptance.po.Slave in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_slave_resourses.
@Test
public void publish_slave_resourses() throws IOException, InterruptedException, ExecutionException {
DockerContainer dock = container.get();
Resource cpFile = resource("/ftp_plugin/odes.txt");
Slave s = slaves.get().install(jenkins).get();
s.configure();
s.save();
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpFile);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp"), is(true));
assertThat(FileUtils.readFileToString(new File("/tmp/odes.txt")), CoreMatchers.is(cpFile.asText()));
}
use of org.jenkinsci.test.acceptance.po.Slave in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method createSlaveForJob.
/**
* Creates a slave and configures the specified job to run on that slave.
*
* @param job job to run on slave
* @return created slave
*/
public Slave createSlaveForJob(final Job job) {
try {
Slave slave = slaveController.install(jenkins).get();
job.configure();
job.setLabelExpression(slave.getName());
job.save();
return slave;
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException("Can't create Slave", e);
}
}
use of org.jenkinsci.test.acceptance.po.Slave in project acceptance-test-harness by jenkinsci.
the class ExternalWorkspaceManagerPluginTest method setUpNode.
private void setUpNode(String label, String fakeMountingPoint) throws ExecutionException, InterruptedException {
SlaveController controller = new LocalSlaveController();
Slave linuxSlave = controller.install(jenkins).get();
linuxSlave.configure();
linuxSlave.setLabels(label);
ExternalNodeConfig nodeConfig = new ExternalNodeConfig(linuxSlave);
nodeConfig.setConfig(DISK_POOL_ID, DISK_ONE, DISK_TWO, fakeMountingPoint);
linuxSlave.save();
}
Aggregations