use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionSshSlave.
@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 provisionSshSlave() {
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.save();
job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
}
use of org.jenkinsci.test.acceptance.junit.TestActivation 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();
}
use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method scheduleMatrixWithoutLabel.
@Test
@Issue("JENKINS-29998")
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { MACHINE_USERNAME, "/openstack_plugin/unsafe" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
@WithPlugins("matrix-project")
public void scheduleMatrixWithoutLabel() {
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
jenkins.configure();
jenkins.getConfigPage().numExecutors.set(0);
jenkins.save();
MatrixProject job = jenkins.jobs.create(MatrixProject.class);
job.configure();
job.save();
MatrixBuild pb = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().as(MatrixBuild.class);
assertThat(pb.getNode(), equalTo((Node) jenkins));
MatrixRun cb = pb.getConfiguration("default");
assertThat(cb.getNode(), not(equalTo((Node) jenkins)));
}
use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionSshSlaveWithPasswdAuthRetryOnFailedAuth.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void provisionSshSlaveWithPasswdAuthRetryOnFailedAuth() {
configureCloudInit("cloud-init-authfix");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.save();
job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
}
Aggregations