use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class ForemanNodeSharingPluginTest method testProvision.
/**
* Test that we can provision, build and release.
* @throws Exception if occurs.
*/
@Test
public void testProvision() throws Exception {
jenkins.save();
FreeStyleJob job1 = createAndConfigureJob(jobLabelExpression1);
FreeStyleJob job2 = createAndConfigureJob(jobLabelExpression2);
Build b1 = job1.scheduleBuild();
job2.scheduleBuild();
b1.waitUntilFinished(PROVISION_TIMEOUT);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class ForemanNodeSharingPluginTest method testProvisionAfterRestart.
/**
* Test that we can provision after a restart, build and release.
* @throws Exception if occurs.
*/
@Test
public void testProvisionAfterRestart() throws Exception {
jenkins.save();
FreeStyleJob job1 = createAndConfigureJob(jobLabelExpression1);
FreeStyleJob job2 = createAndConfigureJob(jobLabelExpression2);
Build b = job1.scheduleBuild();
job2.scheduleBuild();
jenkins.restart();
b.waitUntilFinished(PROVISION_TIMEOUT);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_without_empty_directory.
@Test
public void publish_without_empty_directory() throws IOException {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
File tmpDir = createTempDirectory();
File nestedEmptyDir = new File(tmpDir + "/empty");
nestedEmptyDir.mkdir();
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt);
j.copyFile(tmpDir);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("empty/,odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(!dock.cp("/tmp/dockertmp/empty", "/tmp/"), is(true));
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_date_format.
@Test
public void publish_with_date_format() {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().remoteDirectorySDF.check();
fps.getDefaultTransfer().remoteDirectory.set("yyyyMMddHH");
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHH");
Date date = new Date();
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/" + dateFormat.format(date) + "/odes.txt", "/tmp/"), is(true));
assertThat(new File("/tmp/odes.txt").exists(), is(true));
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_flatten_files.
@Test
public void publish_with_flatten_files() {
DockerContainer dock = container.get();
Resource cpDir = resource("/ftp_plugin/");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyDir(cpDir);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().flatten.check();
fps.getDefaultTransfer().sourceFile.set("flat/odes.txt,odes.txt");
}
j.save();
j.startBuild().shouldBeUnstable();
}
Aggregations