mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-21 17:46:48 +00:00
GODT-1159 SMTP server not restarting after restored internet
- [x] write tests to check that IMAP and SMTP servers are closed when there is no internet - [x] always create new go-smtp instance during listenAndServe(int)
This commit is contained in:
@ -24,6 +24,8 @@ import (
|
||||
func SMTPChecksFeatureContext(s *godog.Suite) {
|
||||
s.Step(`^SMTP response is "([^"]*)"$`, smtpResponseIs)
|
||||
s.Step(`^SMTP response to "([^"]*)" is "([^"]*)"$`, smtpResponseNamedIs)
|
||||
s.Step(`^SMTP client is logged out`, smtpClientIsLoggedOut)
|
||||
s.Step(`^SMTP client "([^"]*)" is logged out`, smtpClientNamedIsLoggedOut)
|
||||
}
|
||||
|
||||
func smtpResponseIs(expectedResponse string) error {
|
||||
@ -39,3 +41,13 @@ func smtpResponseNamedIs(clientID, expectedResponse string) error {
|
||||
}
|
||||
return ctx.GetTestingError()
|
||||
}
|
||||
|
||||
func smtpClientIsLoggedOut() error {
|
||||
return smtpClientNamedIsLoggedOut("smtp")
|
||||
}
|
||||
|
||||
func smtpClientNamedIsLoggedOut(clientName string) error {
|
||||
res := ctx.GetSMTPClient(clientName).SendCommands("HELO loggedOut.com")
|
||||
res.AssertError("read response failed:")
|
||||
return ctx.GetTestingError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user