Skip to content

Commit

Permalink
skip openssh tests if ssh-keygen is not in PATH
Browse files Browse the repository at this point in the history
This commit adds a PATH lookup to the openSSH tests.
This prevents failing tests on systems with no ssh-keygen
in PATH.

Signed-off-by: Christian Rebischke <chris@shibumi.dev>
  • Loading branch information
shibumi committed Jul 19, 2021
1 parent 5e005eb commit 448fd41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/pki/ssh/sign_test.go
Expand Up @@ -140,6 +140,9 @@ func TestFromOpenSSH(t *testing.T) {
priv: ed25519PrivateKey,
},
} {
if _, err := exec.LookPath("ssh-keygen"); err != nil {
t.Skip("skip TestFromOpenSSH: missing ssh-keygen in PATH")
}
t.Run(tt.name, func(t *testing.T) {
tt := tt

Expand Down Expand Up @@ -193,6 +196,9 @@ func TestToOpenSSH(t *testing.T) {
priv: ed25519PrivateKey,
},
} {
if _, err := exec.LookPath("ssh-keygen"); err != nil {
t.Skip("skip TestToOpenSSH: missing ssh-keygen in PATH")
}
t.Run(tt.name, func(t *testing.T) {
tt := tt
// Test that a signature from here can validate in the CLI.
Expand Down

0 comments on commit 448fd41

Please sign in to comment.