use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class ActiveDirectoryTest method configure_active_directory.
@Test
@ConfiguredWithCode(value = "ActiveDirectoryTest.yml")
public void configure_active_directory() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
final ActiveDirectorySecurityRealm realm = (ActiveDirectorySecurityRealm) jenkins.getSecurityRealm();
assertEquals(1, realm.domains.size());
final ActiveDirectoryDomain domain = realm.domains.get(0);
assertEquals("acme", domain.name);
assertEquals("admin", domain.bindName);
assertEquals("ADMIN123", domain.bindPassword.getPlainText());
assertEquals("ad1.acme.com:123,ad2.acme.com:456", domain.servers);
assertTrue(realm.removeIrrelevantGroups);
assertTrue(realm.startTls);
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class AgentProtocolsTest method configure_agent_protocols.
@Test
@ConfiguredWithCode(value = "AgentProtocolsTest.yml")
public void configure_agent_protocols() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
final Set<String> agentProtocols = Arrays.stream(new String[] { "JNLP4-connect", "Ping" }).collect(Collectors.toSet());
assertEquals(agentProtocols, jenkins.getAgentProtocols());
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class DockerCloudTest method configure_docker_cloud.
@Test
@ConfiguredWithCode("DockerCloudTest.yml")
public void configure_docker_cloud() throws Exception {
final DockerCloud docker = DockerCloud.getCloudByName("docker");
assertNotNull(docker);
assertNotNull(docker.getDockerApi());
assertNotNull(docker.getDockerApi().getDockerHost());
assertEquals("unix:///var/run/docker.sock", docker.getDockerApi().getDockerHost().getUri());
final DockerTemplate template = docker.getTemplate("jenkins/slave");
checkTemplate(template, "docker-agent", "jenkins", "/home/jenkins/agent", "10");
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class DockerCloudTest method update_docker_cloud.
@Test
@ConfiguredWithCode("DockerCloudTest/update_docker_cloud/DockerCloudTest1.yml")
public void update_docker_cloud() throws Exception {
DockerCloud docker = DockerCloud.getCloudByName("docker");
assertNotNull(docker);
assertNotNull(docker.getDockerApi());
assertNotNull(docker.getDockerApi().getDockerHost());
assertEquals("unix:///var/run/docker.sock", docker.getDockerApi().getDockerHost().getUri());
DockerTemplate template = docker.getTemplate(Label.get("docker-agent"));
checkTemplate(template, "docker-agent", "jenkins", "/home/jenkins/agent", "10");
TestConfiguration.withCode("DockerCloudTest/update_docker_cloud/DockerCloudTest2.yml").configure(getClass());
docker = DockerCloud.getCloudByName("docker");
assertNotNull(docker);
assertNotNull(docker.getDockerApi());
assertNotNull(docker.getDockerApi().getDockerHost());
assertEquals("unix:///var/run/docker.sock", docker.getDockerApi().getDockerHost().getUri());
template = docker.getTemplate(Label.get("docker-agent"));
checkTemplate(template, "docker-agent", "jenkins", "/home/jenkins/agent", "10");
template = docker.getTemplate(Label.get("generic"));
checkTemplate(template, "generic", "jenkins", "/home/jenkins/agent2", "5");
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class SeedJobTest method configure_seed_job.
@Test
@ConfiguredWithCode("SeedJobTest.yml")
public void configure_seed_job() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
final TopLevelItem test = jenkins.getItem("configuration-as-code");
assertNotNull(test);
assertTrue(test instanceof WorkflowMultiBranchProject);
}
Aggregations