use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class JdkTest method autoinstallJdk.
@Test
@TestActivation({ "ORACLE_LOGIN", "ORACLE_PASSWORD" })
public void autoinstallJdk() {
final String login = System.getProperty("JdkTest.ORACLE_LOGIN");
final String passwd = System.getProperty("JdkTest.ORACLE_PASSWORD");
ToolInstallation.waitForUpdates(jenkins, JdkInstallation.class);
JdkInstallation jdk = ToolInstallation.addTool(jenkins, JdkInstallation.class);
jdk.name.set("jdk_1.8.0");
jdk.installVersion("jdk-8u141-oth-JPR");
jdk.getPage().save();
jdk.setCredentials(login, passwd);
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.addShellStep("java -version");
job.save();
int tenMinutes = 600000;
job.startBuild().waitUntilFinished(tenMinutes).shouldSucceed().shouldContainsConsoleOutput("Installing JDK jdk-8u141-oth-JPR").shouldContainsConsoleOutput("Downloading JDK from http://download.oracle.com");
}
use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionJnlpSlave.
// The test will fail when test host is not reachable from openstack machine for obvious reasons
@Test
// TODO: JENKINS-30784 Do not bother with credentials for jnlp slaves
@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 provisionJnlpSlave() {
configureCloudInit("cloud-init-jnlp");
configureProvisioning("JNLP", "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 sshSlaveShouldSurviveRestart.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void sshSlaveShouldSurviveRestart() {
assumeTrue("This test requires a restartable Jenkins", jenkins.canRestart());
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.addShellStep("uname -a");
job.save();
Node created = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().getNode();
jenkins.restart();
Node reconnected = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().getNode();
assertEquals(created, reconnected);
Slave slave = ((Slave) reconnected);
slave.open();
slave.clickLink("Schedule Termination");
waitFor(slave, pageObjectDoesNotExist(), 1000);
}
use of org.jenkinsci.test.acceptance.junit.TestActivation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionSshSlaveWithPasswdAuth.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void provisionSshSlaveWithPasswdAuth() {
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 useSingleUseSlave.
@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 useSingleUseSlave() {
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.addBuildWrapper(OpenstackOneOffSlave.class);
job.save();
Build build = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
assertTrue(build.getNode().isTemporarillyOffline());
}
Aggregations