Search in sources :

Example 6 with TeamCitySshKey

use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.

the class SshAuthenticationTest method ssh_git_rsa_uploaded_key.

@Test(dataProvider = "true,false")
public void ssh_git_rsa_uploaded_key(boolean nativeOperationsEnabled) throws Exception {
    final File key = dataFile("keys/id_rsa");
    do_ssh_test(nativeOperationsEnabled, true, "ssh://git@%s:%s/home/git/repo.git", "", new TeamCitySshKey("test_key", Files.readAllBytes(key.toPath()), false), "keys/id_rsa.pub", b -> b.withAuthMethod(AuthenticationMethod.TEAMCITY_SSH_KEY).withTeamCitySshKey("test_key"));
}
Also used : TeamCitySshKey(jetbrains.buildServer.ssh.TeamCitySshKey) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File) Test(org.testng.annotations.Test)

Example 7 with TeamCitySshKey

use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.

the class SshAuthenticationTest method ssh_git_ecdsa_native_decrypted_uploaded_key.

public void ssh_git_ecdsa_native_decrypted_uploaded_key() throws Exception {
    final File key = dataFile("keys/id_ecdsa_encrypted");
    do_ssh_test(true, false, "ssh://git@%s:%s/home/git/repo.git", "", new TeamCitySshKey("test_key", Files.readAllBytes(key.toPath()), true), "keys/id_ecdsa_encrypted.pub", b -> b.withAuthMethod(AuthenticationMethod.TEAMCITY_SSH_KEY).withTeamCitySshKey("test_key").withPassphrase("12345"));
}
Also used : TeamCitySshKey(jetbrains.buildServer.ssh.TeamCitySshKey) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File)

Example 8 with TeamCitySshKey

use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.

the class SshAuthenticationTest method ssh_git_rsa_native_decrypted_uploaded_key.

public void ssh_git_rsa_native_decrypted_uploaded_key() throws Exception {
    final File key = dataFile("keys/id_rsa_encrypted");
    do_ssh_test(true, false, "ssh://git@%s:%s/home/git/repo.git", "", new TeamCitySshKey("test_key", Files.readAllBytes(key.toPath()), true), "keys/id_rsa_encrypted.pub", b -> b.withAuthMethod(AuthenticationMethod.TEAMCITY_SSH_KEY).withTeamCitySshKey("test_key").withPassphrase("12345"));
}
Also used : TeamCitySshKey(jetbrains.buildServer.ssh.TeamCitySshKey) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File)

Example 9 with TeamCitySshKey

use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.

the class SshAuthenticationTest method ssh_git_ecdsa_uploaded_key.

@Test(dataProvider = "true,false")
public void ssh_git_ecdsa_uploaded_key(boolean nativeOperationsEnabled) throws Exception {
    final File key = dataFile("keys/id_ecdsa");
    do_ssh_test(nativeOperationsEnabled, true, "ssh://git@%s:%s/home/git/repo.git", "", new TeamCitySshKey("test_key", Files.readAllBytes(key.toPath()), false), "keys/id_ecdsa.pub", b -> b.withAuthMethod(AuthenticationMethod.TEAMCITY_SSH_KEY).withTeamCitySshKey("test_key"));
}
Also used : TeamCitySshKey(jetbrains.buildServer.ssh.TeamCitySshKey) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File) Test(org.testng.annotations.Test)

Example 10 with TeamCitySshKey

use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.

the class SshAuthenticationTest method ssh_git_rsa_encrypted_uploaded_key.

@Test(dataProvider = "true,false")
public void ssh_git_rsa_encrypted_uploaded_key(boolean nativeOperationsEnabled) throws Exception {
    final File key = dataFile("keys/id_rsa_encrypted");
    do_ssh_test(nativeOperationsEnabled, true, "ssh://git@%s:%s/home/git/repo.git", "", new TeamCitySshKey("test_key", Files.readAllBytes(key.toPath()), true), "keys/id_rsa_encrypted.pub", b -> b.withAuthMethod(AuthenticationMethod.TEAMCITY_SSH_KEY).withTeamCitySshKey("test_key").withPassphrase("12345"));
}
Also used : TeamCitySshKey(jetbrains.buildServer.ssh.TeamCitySshKey) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File) Test(org.testng.annotations.Test)

Aggregations

TeamCitySshKey (jetbrains.buildServer.ssh.TeamCitySshKey)11 File (java.io.File)8 GitTestUtil.dataFile (jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile)7 Test (org.testng.annotations.Test)6 IOException (java.io.IOException)2 VcsException (jetbrains.buildServer.vcs.VcsException)2 VcsRoot (jetbrains.buildServer.vcs.VcsRoot)2 URIish (org.eclipse.jgit.transport.URIish)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 SystemInfo (com.intellij.openapi.util.SystemInfo)1 JSch (com.jcraft.jsch.JSch)1 Files (java.nio.file.Files)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Callable (java.util.concurrent.Callable)1 Collectors (java.util.stream.Collectors)1 BaseTestCase (jetbrains.buildServer.BaseTestCase)1