Search in sources :

Example 1 with OpenstackCloud

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

the class OpenstackCloudPluginTest method configureProvisioning.

private void configureProvisioning(String type, String labels) {
    jenkins.configure();
    OpenstackCloud cloud = addCloud(jenkins.getConfigPage()).associateFloatingIp(FIP_POOL_NAME);
    cloud.instanceCap(3);
    OpenstackSlaveTemplate template = cloud.addSlaveTemplate();
    template.name(CLOUD_DEFAULT_TEMPLATE);
    template.labels(labels);
    template.hardwareId(HARDWARE_ID);
    template.networkId(NETWORK_ID);
    template.imageId(IMAGE_ID);
    template.credentials(MACHINE_USERNAME);
    template.slaveType(type);
    template.userData(CLOUD_INIT_NAME);
    template.keyPair(KEY_PAIR_NAME);
    template.fsRoot("/tmp/jenkins");
    jenkins.save();
}
Also used : OpenstackCloud(org.jenkinsci.test.acceptance.plugins.openstack.OpenstackCloud) OpenstackSlaveTemplate(org.jenkinsci.test.acceptance.plugins.openstack.OpenstackSlaveTemplate)

Example 2 with OpenstackCloud

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

the class OpenstackCloudPluginTest method testConnection.

@Test
public void testConnection() {
    JenkinsConfig config = jenkins.getConfigPage();
    config.configure();
    OpenstackCloud cloud = addCloud(config);
    FormValidation val = cloud.testConnection();
    assertThat(val, FormValidation.reports(OK, "Connection succeeded!"));
}
Also used : OpenstackCloud(org.jenkinsci.test.acceptance.plugins.openstack.OpenstackCloud) FormValidation(org.jenkinsci.test.acceptance.po.FormValidation) JenkinsConfig(org.jenkinsci.test.acceptance.po.JenkinsConfig) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

OpenstackCloud (org.jenkinsci.test.acceptance.plugins.openstack.OpenstackCloud)2 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 OpenstackSlaveTemplate (org.jenkinsci.test.acceptance.plugins.openstack.OpenstackSlaveTemplate)1 FormValidation (org.jenkinsci.test.acceptance.po.FormValidation)1 JenkinsConfig (org.jenkinsci.test.acceptance.po.JenkinsConfig)1 Test (org.junit.Test)1