Search in sources :

Example 1 with TestActivation

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");
}
Also used : JdkInstallation(org.jenkinsci.test.acceptance.po.JdkInstallation) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) TestActivation(org.jenkinsci.test.acceptance.junit.TestActivation)

Example 2 with TestActivation

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();
}
Also used : 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)

Example 3 with TestActivation

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);
}
Also used : Slave(org.jenkinsci.test.acceptance.po.Slave) OpenstackOneOffSlave(org.jenkinsci.test.acceptance.plugins.openstack.OpenstackOneOffSlave) Node(org.jenkinsci.test.acceptance.po.Node) 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)

Example 4 with TestActivation

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();
}
Also used : 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)

Example 5 with TestActivation

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());
}
Also used : MatrixBuild(org.jenkinsci.test.acceptance.po.MatrixBuild) Build(org.jenkinsci.test.acceptance.po.Build) 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)9 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)9 Test (org.junit.Test)9 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)8 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)8 MatrixBuild (org.jenkinsci.test.acceptance.po.MatrixBuild)2 Node (org.jenkinsci.test.acceptance.po.Node)2 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 OpenstackBuildWrapper (org.jenkinsci.test.acceptance.plugins.openstack.OpenstackBuildWrapper)1 OpenstackOneOffSlave (org.jenkinsci.test.acceptance.plugins.openstack.OpenstackOneOffSlave)1 Build (org.jenkinsci.test.acceptance.po.Build)1 JdkInstallation (org.jenkinsci.test.acceptance.po.JdkInstallation)1 MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)1 MatrixRun (org.jenkinsci.test.acceptance.po.MatrixRun)1 Slave (org.jenkinsci.test.acceptance.po.Slave)1 Issue (org.jvnet.hudson.test.Issue)1