adjust unit tests for wrapped ssh
Adjust unit test to refelct the new struct for the local ssh method.
@@ -26,12 +26,12 @@ var _ = Describe("Wrapped SSH", func() {
It("with SSH username", func() {
ssh.options = SSHOptions{SshUsername: "testuser"}
sshTarget := ssh.buildSSHTarget(fakeKind, fakeNamespace, fakeName)
- Expect(sshTarget).To(Equal("testuser@fake-kind/fake-name.fake-ns"))
+ Expect(sshTarget[0]).To(Equal("testuser@fake-kind/fake-name.fake-ns"))
})
It("without SSH username", func() {
sshTarget := ssh.buildSSHTarget(fakeKind, fakeNamespace, fakeName)
- Expect(sshTarget).To(Equal("fake-kind/fake-name.fake-ns"))
+ Expect(sshTarget[0]).To(Equal("fake-kind/fake-name.fake-ns"))
})
})
@@ -47,10 +47,10 @@ var _ = Describe("Wrapped SSH", func() {
It("runLocalCommandClient", func() {
runCommand = func(cmd *exec.Cmd) error {
Expect(cmd).ToNot(BeNil())
- Expect(cmd.Args).To(HaveLen(3))
+ Expect(cmd.Args).To(HaveLen(4))
Expect(cmd.Args[0]).To(Equal("ssh"))
- Expect(cmd.Args[1]).To(Equal(ssh.buildProxyCommandOption(fakeKind, fakeNamespace, fakeName)))
- Expect(cmd.Args[2]).To(Equal(ssh.buildSSHTarget(fakeKind, fakeNamespace, fakeName)))
+ Expect(cmd.Args[2]).To(Equal(ssh.buildProxyCommandOption(fakeKind, fakeNamespace, fakeName)))
+ Expect(cmd.Args[3]).To(Equal(ssh.buildSSHTarget(fakeKind, fakeNamespace, fakeName)[0]))
return nil
}
