Search in sources :

Example 1 with MesosCloud

use of org.jenkinsci.plugins.mesos.MesosCloud in project configuration-as-code-plugin by jenkinsci.

the class MesosTest method configure_mesos_cloud.

@Test
@ConfiguredWithReadme("mesos/README.md")
public void configure_mesos_cloud() {
    final MesosCloud cloud = Jenkins.get().clouds.get(MesosCloud.class);
    assertNotNull(cloud);
    assertFalse(cloud.isCheckpoint());
    assertThat(cloud.getCloudID(), is("mesos-name"));
    assertThat(cloud.getCredentialsId(), is("MESOS_CREDENTIALS"));
    assertThat(cloud.getDeclineOfferDuration(), is("600"));
    assertThat(cloud.getDescription(), is("My Mesos Cloud"));
    assertThat(cloud.getFrameworkName(), is("Jenkins Framework"));
    assertThat(cloud.getJenkinsURL(), is("https://jenkins.mesos.cloud"));
    assertThat(cloud.getMaster(), is("1.2.3.4:8000"));
    assertThat(cloud.getRole(), is("*"));
    assertThat(cloud.getSlavesUser(), is("jenkins"));
    assertThat(cloud.getSlavesUser(), is("jenkins"));
    final List<MesosSlaveInfo> slaves = cloud.getSlaveInfos();
    assertThat(slaves, hasSize(1));
    final MesosSlaveInfo slaveInfo = slaves.get(0);
    assertThat(slaveInfo.getLabelString(), is("docker"));
    assertThat(slaveInfo.getContainerInfo().getType(), is("DOCKER"));
    assertThat(slaveInfo.getContainerInfo().getDockerImage(), is("cloudbees/java-with-docker-client:latest"));
    assertThat(slaveInfo.getContainerInfo().getVolumes(), hasSize(2));
    assertThat(slaveInfo.getMinExecutors(), is(1));
    assertThat(slaveInfo.getMaxExecutors(), is(2));
    assertThat(slaveInfo.getMode(), is(Mode.NORMAL));
    assertThat(slaveInfo.getSlaveCpus(), is(0.1));
    assertThat(slaveInfo.getSlaveMem(), is(512));
    assertThat(slaveInfo.getRemoteFSRoot(), is("jenkins"));
    assertThat(slaveInfo.getJnlpArgs(), is(""));
    assertThat(slaveInfo.getSlaveAttributes().toString(), containsString("\"rack\":\"jenkins-build-agents\""));
    assertTrue(slaveInfo.isDefaultSlave());
}
Also used : MesosSlaveInfo(org.jenkinsci.plugins.mesos.MesosSlaveInfo) MesosCloud(org.jenkinsci.plugins.mesos.MesosCloud) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Aggregations

ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)1 MesosCloud (org.jenkinsci.plugins.mesos.MesosCloud)1 MesosSlaveInfo (org.jenkinsci.plugins.mesos.MesosSlaveInfo)1 Test (org.junit.Test)1