Search in sources :

Example 1 with OpenstackBuildWrapper

use of org.jenkinsci.test.acceptance.plugins.openstack.OpenstackBuildWrapper in project acceptance-test-harness by jenkinsci.

the class OpenstackCloudPluginTest method usePerBuildInstance.

@Test
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { MACHINE_USERNAME, "/openstack_plugin/unsafe" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void usePerBuildInstance() {
    configureCloudInit("cloud-init");
    configureProvisioning("SSH", "unused");
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    OpenstackBuildWrapper bw = job.addBuildWrapper(OpenstackBuildWrapper.class);
    bw.cloud(CLOUD_NAME);
    bw.template(CLOUD_DEFAULT_TEMPLATE);
    bw.count(1);
    // Wait a little for the other machine to start responding
    job.addShellStep("while ! ping -c 1 \"$JCLOUDS_IPS\"; do :; done");
    job.save();
    job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
}
Also used : OpenstackBuildWrapper(org.jenkinsci.test.acceptance.plugins.openstack.OpenstackBuildWrapper) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) TestActivation(org.jenkinsci.test.acceptance.junit.TestActivation)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 OpenstackBuildWrapper (org.jenkinsci.test.acceptance.plugins.openstack.OpenstackBuildWrapper)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1 Test (org.junit.Test)1