Add temporary failure condition in client test

Introduce a new `FailTemp` property to simulate a temporary failure during the DATA transmission phase in tests. This helps ensure better coverage and handling of specific error conditions.
This commit is contained in:
Winni Neessen 2024-10-28 17:31:11 +01:00
parent 2f3809f33e
commit 7d670a1f24
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -3559,6 +3559,7 @@ type serverProps struct {
FailOnQuit bool FailOnQuit bool
FailOnReset bool FailOnReset bool
FailOnSTARTTLS bool FailOnSTARTTLS bool
FailTemp bool
FeatureSet string FeatureSet string
ListenPort int ListenPort int
SSLListener bool SSLListener bool
@ -3720,6 +3721,10 @@ func handleTestServerConnection(connection net.Conn, t *testing.T, props *server
writeLine("500 5.0.0 Error during DATA transmission") writeLine("500 5.0.0 Error during DATA transmission")
break break
} }
if props.FailTemp {
writeLine("451 4.3.0 Error: fail on DATA close")
break
}
writeLine("250 2.0.0 Ok: queued as 1234567890") writeLine("250 2.0.0 Ok: queued as 1234567890")
break break
} }