Resources.FitNesseRoot.PlugIns.SshFixture.UserGuide.Options.EndpointOptions.PublicKey.wiki Maven / Gradle / Ivy
---
Test
---
!1 !-SshFixture-! public key
This option is used to define the public-key file path or content. If option content does not match a file path, is evaluated as a file content. In default implementation (jsch session) public key will be evaluated only if private key is set. In test implementation (dummy session) this option is ignored. Other behaviours can be implemented with [[!-CustomSession-!][ definitions
!define PRIVATE_KEY {/path/to/my/private/key/file}
!define PUBLIC_KEY {/path/to/my/public/key/file}
*!
|script |ssh client |ssh-fitnesse.dev |
|add option|PRIVATE_KEY|with value|${PRIVATE_KEY}|
|add option|PUBLIC_KEY |with value|${PUBLIC_KEY} |
|open connection |
|execute |echo foobar |
|check |output |foobar |
|close connection |
!***> code
{{{!-
|import |
|com.github.gun88.fitnesse.fixture.ssh|
!define PRIVATE_KEY {/path/to/my/private/key/file}
!define PUBLIC_KEY {/path/to/my/public/key/file}
|script |ssh client |ssh-fitnesse.dev |
|add option|PRIVATE_KEY|with value|${PRIVATE_KEY}|
|add option|PUBLIC_KEY |with value|${PUBLIC_KEY} |
|open connection |
|execute |echo foobar |
|check |output |foobar |
|close connection |
!define TEST_SYSTEM {slim}
!path ${jsch.jar.path}
!path ${sshFixture.jar.path}
-!}}}
Note: if !-SshFixture-! is not installed as a plugin, remember to set or replace properties: jsch.jar.path, sshFixture.jar.path; with actual paths.
Note: In this example the connection was built via username and password, that are set in plain text in table header. Click [[here][ definitions
!define PRIVATE_KEY {/path/to/my/private/key/file}
!define PUBLIC_KEY { {{{ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcH6TBaVlq...}}} }
*!
|script |ssh client |ssh-fitnesse.dev |
|add option|PRIVATE_KEY|with value|${PRIVATE_KEY}|
|add option|PUBLIC_KEY |with value|${PUBLIC_KEY} |
|open connection |
|execute |echo foobar |
|check |output |foobar |
|close connection |
!***> code
{{{!-
|import |
|com.github.gun88.fitnesse.fixture.ssh|
!define PRIVATE_KEY {/path/to/my/private/key/file}
!define PUBLIC_KEY { {{{ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcH6TBaVlq...}}} }
|script |ssh client |ssh-fitnesse.dev |
|add option|PRIVATE_KEY|with value|${PRIVATE_KEY}|
|add option|PUBLIC_KEY |with value|${PUBLIC_KEY} |
|open connection |
|execute |echo foobar |
|check |output |foobar |
|close connection |
!define TEST_SYSTEM {slim}
!path ${jsch.jar.path}
!path ${sshFixture.jar.path}
-!}}}
Note: if !-SshFixture-! is not installed as a plugin, remember to set or replace properties: jsch.jar.path, sshFixture.jar.path; with actual paths.
Note: In this example the connection was built via username and password, that are set in plain text in table header. Click [[here][