Skip to content

Commit

Permalink
Add negative test
Browse files Browse the repository at this point in the history
  • Loading branch information
gururajsh authored and a-b committed Nov 18, 2024
1 parent 26147d6 commit d4d2e21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions util/clissh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ var _ = Describe("CLI SSH", Serial, FlakeAttempts(9), func() {
})
})

When("the SHA256 fingerprint does not match", func() {
BeforeEach(func() {
sshEndpointFingerprint = "0000000000000000000000000000000000000000000000000000000000000000"
})

It("returns an error'", func() {
err := callback("", addr, TestHostKey.PublicKey())
Expect(err).To(MatchError(MatchRegexp(`Host key verification failed\.`)))
Expect(err).To(MatchError(MatchRegexp("The fingerprint of the received key was \".*\"")))
})
})

When("the base64 SHA256 fingerprint does not match", func() {
BeforeEach(func() {
sshEndpointFingerprint = "0000000000000000000000000000000000000000000"
Expand Down

0 comments on commit d4d2e21

Please sign in to comment.