use of org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer in project acceptance-test-harness by jenkinsci.
the class PublishOverSSHPluginTest method ssh_key_path_and_key_password_and_exec_publishing.
@Test
public void ssh_key_path_and_key_password_and_exec_publishing() throws IOException {
SshdContainer sshd = docker.get();
Resource cp_file = resource(resourceFilePath);
File sshFile = sshd.getEncryptedPrivateKey();
FreeStyleJob j = jenkins.jobs.create();
jenkins.configure();
this.commonConfigKeyFileAndPassword(sshFile, false);
InstanceSite is = this.instanceConfig(sshd);
this.advancedConfigAllowExec(is, sshd);
jenkins.save();
this.configureJobWithExec(j, cp_file);
j.save();
j.startBuild().shouldSucceed();
sshd.cp(tempCopyFile, tempPath);
sshd.cp(tempCopyFileEcho, tempPath);
assertThat(FileUtils.readFileToString(new File(tempCopyFile)), CoreMatchers.is(cp_file.asText()));
assertThat(FileUtils.readFileToString(new File(tempCopyFileEcho)), CoreMatchers.is("i was here\n"));
}
use of org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer in project acceptance-test-harness by jenkinsci.
the class ScpPluginTest method configure_job_with_scp_key_publishing.
@Test
public void configure_job_with_scp_key_publishing() throws Exception {
SshdContainer sshd = docker.get();
Resource cp_file = resource("/scp_plugin/lorem-ipsum-scp.txt");
FreeStyleJob j = jenkins.jobs.create();
jenkins.configure();
Site s = new ScpGlobalConfig(jenkins).addSite();
{
s.hostname.set(sshd.ipBound(22));
s.port.set(sshd.port(22));
s.username.set("test");
s.keyfile.set(sshd.getPrivateKey().getAbsolutePath());
s.rootRepositoryPath.set("/tmp");
}
jenkins.save();
j.configure();
{
j.copyResource(cp_file);
ScpPublisher sp = j.addPublisher(ScpPublisher.class);
ScpPublisher.Site sps = sp.add();
sps.sourceFile.set("lorem-ipsum-scp.txt");
sps.filePath.set("abc");
}
j.save();
j.startBuild().shouldSucceed();
sshd.cp("/tmp/abc/lorem-ipsum-scp.txt", "/tmp");
assertThat(FileUtils.readFileToString(new File("/tmp/lorem-ipsum-scp.txt")), CoreMatchers.is(cp_file.asText()));
}
use of org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer in project acceptance-test-harness by jenkinsci.
the class PublishOverSSHPluginTest method ssh_password_publishing.
@Test
public void ssh_password_publishing() throws IOException {
SshdContainer sshd = docker.get();
Resource cp_file = resource(resourceFilePath);
File sshFile = sshd.getPrivateKey();
FreeStyleJob j = jenkins.jobs.create();
jenkins.configure();
this.commonConfigKeyText(sshFile, false);
InstanceSite is = this.instanceConfig(sshd);
this.advancedConfigAllowExec(is, sshd);
jenkins.save();
this.configureJobNoExec(j, cp_file);
j.save();
j.startBuild().shouldSucceed();
sshd.cp(tempCopyFile, tempPath);
assertThat(FileUtils.readFileToString(new File(tempCopyFile)), CoreMatchers.is(cp_file.asText()));
}
use of org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer in project acceptance-test-harness by jenkinsci.
the class PublishOverSSHPluginTest method ssh_key_path_and_key_password_publishing.
@Test
public void ssh_key_path_and_key_password_publishing() throws IOException {
SshdContainer sshd = docker.get();
Resource cp_file = resource(resourceFilePath);
File sshFile = sshd.getEncryptedPrivateKey();
FreeStyleJob j = jenkins.jobs.create();
jenkins.configure();
this.commonConfigKeyFileAndPassword(sshFile, false);
InstanceSite is = this.instanceConfig(sshd);
this.advancedConfigAllowExec(is, sshd);
jenkins.save();
this.configureJobNoExec(j, cp_file);
j.save();
j.startBuild().shouldSucceed();
sshd.cp(tempCopyFile, tempPath);
assertThat(FileUtils.readFileToString(new File(tempCopyFile)), CoreMatchers.is(cp_file.asText()));
}
use of org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer in project acceptance-test-harness by jenkinsci.
the class PublishOverSSHPluginTest method ssh_key_path_and_no_password_publishing.
@Test
public void ssh_key_path_and_no_password_publishing() throws IOException {
SshdContainer sshd = docker.get();
Resource cp_file = resource(resourceFilePath);
File sshFile = sshd.getPrivateKey();
FreeStyleJob j = jenkins.jobs.create();
jenkins.configure();
this.commonConfigKeyFile(sshFile, false);
InstanceSite is = this.instanceConfig(sshd);
this.advancedConfigAllowExec(is, sshd);
// delete button
// is.delete.click();
// validate input
// is.validate.click();
jenkins.save();
this.configureJobNoExec(j, cp_file);
j.save();
j.startBuild().shouldSucceed();
sshd.cp(tempCopyFile, tempPath);
assertThat(FileUtils.readFileToString(new File(tempCopyFile)), CoreMatchers.is(cp_file.asText()));
}
Aggregations