adjust F2B test

This commit is contained in:
georglauterbach 2024-01-02 00:36:14 +01:00
parent aa0a16b4c9
commit aa6d0c5071
No known key found for this signature in database
GPG Key ID: F367F7C43C118578
1 changed files with 8 additions and 2 deletions

View File

@ -73,8 +73,14 @@ function teardown_file() {
@test "ban ip on multiple failed login" {
CONTAINER1_IP=$(_get_container_ip "${CONTAINER1_NAME}")
# Trigger a ban by failing to login twice:
CONTAINER_NAME=${CONTAINER2_NAME} _nc_wrapper 'auth/smtp-auth-login-wrong.txt' "${CONTAINER1_IP} 465"
CONTAINER_NAME=${CONTAINER2_NAME} _nc_wrapper 'auth/smtp-auth-login-wrong.txt' "${CONTAINER1_IP} 465"
CONTAINER_NAME=${CONTAINER2_NAME} _send_email --server ${CONTAINER1_IP} --ehlo mail --port 465 --auth LOGIN --auth-user user1@localhost.localdomain --auth-password wrongpassword
assert_failure
assert_output --partial 'authentication failed'
assert_output --partial 'No authentication type succeeded'
CONTAINER_NAME=${CONTAINER2_NAME} _send_email --server ${CONTAINER1_IP} --ehlo mail --port 465 --auth LOGIN --auth-user user1@localhost.localdomain --auth-password wrongpassword
assert_failure
assert_output --partial 'authentication failed'
assert_output --partial 'No authentication type succeeded'
# Checking that CONTAINER2_IP is banned in "${CONTAINER1_NAME}"
CONTAINER2_IP=$(_get_container_ip "${CONTAINER2_NAME}")