Search in sources :

Example 1 with InstanceSite

use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite 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"));
}
Also used : SshdContainer(org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) File(java.io.File) InstanceSite(org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite) Test(org.junit.Test)

Example 2 with InstanceSite

use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite 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()));
}
Also used : SshdContainer(org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) File(java.io.File) InstanceSite(org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite) Test(org.junit.Test)

Example 3 with InstanceSite

use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite 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()));
}
Also used : SshdContainer(org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) File(java.io.File) InstanceSite(org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite) Test(org.junit.Test)

Example 4 with InstanceSite

use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite 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()));
}
Also used : SshdContainer(org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) File(java.io.File) InstanceSite(org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite) Test(org.junit.Test)

Example 5 with InstanceSite

use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite in project acceptance-test-harness by jenkinsci.

the class PublishOverSSHPluginTest method ssh_key_text_and_no_password_publishing.

@Test
public void ssh_key_text_and_no_password_publishing() throws IOException {
    SshdContainer sshd = docker.get();
    Resource cp_file = resource(resourceFilePath);
    FreeStyleJob j = jenkins.jobs.create();
    jenkins.configure();
    this.commonConfigPassword("test", 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()));
}
Also used : SshdContainer(org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) File(java.io.File) InstanceSite(org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite) Test(org.junit.Test)

Aggregations

File (java.io.File)5 SshdContainer (org.jenkinsci.test.acceptance.docker.fixtures.SshdContainer)5 InstanceSite (org.jenkinsci.test.acceptance.plugins.publish_over.PublishOverSSHGlobalConfig.InstanceSite)5 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)5 Test (org.junit.Test)5