Skip to content

Commit

Permalink
probes, Fail on Login error
Browse files Browse the repository at this point in the history
The following functions do not fail when loginTo function fails:
- StartTCPServer
- StartHTTPServer
- StartHTTPServerWithSourceIp

Adding Expect accordingly.

Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi committed Jun 8, 2022
1 parent b44232e commit affa2dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/vmi_servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ func (s server) composeNetcatServerCommand(port int, extraArgs ...string) string
}

func StartTCPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction) {
loginTo(vmi)
ExpectWithOffset(1, loginTo(vmi)).To(Succeed())
TCPServer.Start(vmi, port)
}

func StartHTTPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction) {
loginTo(vmi)
ExpectWithOffset(1, loginTo(vmi)).To(Succeed())
HTTPServer.Start(vmi, port)
}

func StartHTTPServerWithSourceIp(vmi *v1.VirtualMachineInstance, port int, sourceIP string, loginTo console.LoginToFunction) {
loginTo(vmi)
ExpectWithOffset(1, loginTo(vmi)).To(Succeed())
HTTPServer.Start(vmi, port, fmt.Sprintf("-s %s", sourceIP))
}

Expand Down

0 comments on commit affa2dd

Please sign in to comment.