Search in sources :

Example 1 with JavaGitContainer

use of org.jenkinsci.test.acceptance.docker.fixtures.JavaGitContainer in project acceptance-test-harness by jenkinsci.

the class AbstractAnalysisTest method createDockerAgent.

/**
 * Creates an agent in a Docker container.
 *
 * @return the new agent ready for new builds
 */
protected DumbSlave createDockerAgent() {
    DumbSlave agent = jenkins.slaves.create(DumbSlave.class);
    agent.setExecutors(1);
    agent.remoteFS.set("/tmp/");
    SshSlaveLauncher launcher = agent.setLauncher(SshSlaveLauncher.class);
    JavaGitContainer container = getDockerContainer();
    launcher.host.set(container.ipBound(22));
    launcher.port(container.port(22));
    launcher.setSshHostKeyVerificationStrategy(SshSlaveLauncher.NonVerifyingKeyVerificationStrategy.class);
    launcher.selectCredentials(CREDENTIALS_ID);
    agent.save();
    agent.waitUntilOnline();
    assertThat(agent.isOnline(), is(true));
    return agent;
}
Also used : SshSlaveLauncher(org.jenkinsci.test.acceptance.plugins.ssh_slaves.SshSlaveLauncher) JavaGitContainer(org.jenkinsci.test.acceptance.docker.fixtures.JavaGitContainer) DumbSlave(org.jenkinsci.test.acceptance.po.DumbSlave)

Aggregations

JavaGitContainer (org.jenkinsci.test.acceptance.docker.fixtures.JavaGitContainer)1 SshSlaveLauncher (org.jenkinsci.test.acceptance.plugins.ssh_slaves.SshSlaveLauncher)1 DumbSlave (org.jenkinsci.test.acceptance.po.DumbSlave)1