From 1d405076e6b69dfec41366a4c0e8bc113f71a62b Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Tue, 17 Jan 2023 14:38:37 +0100 Subject: [PATCH] Other(test): Fix integration test steps --- tests/ctx_test.go | 4 ++-- tests/features/imap/auth.feature | 8 ++++---- tests/features/smtp/auth.feature | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/ctx_test.go b/tests/ctx_test.go index 8bee3b9d..0c9db06c 100644 --- a/tests/ctx_test.go +++ b/tests/ctx_test.go @@ -155,7 +155,7 @@ func (t *testCtx) replace(value string) string { return t.userUUIDByName[name] }) - // Replace [addr:EMAIL] with a unique address for the email EMAIL. + // Replace [alias:EMAIL] with a unique address for the email EMAIL. value = regexp.MustCompile(`\[alias:(\w+)\]`).ReplaceAllStringFunc(value, func(match string) string { email := regexp.MustCompile(`\[alias:(\w+)\]`).FindStringSubmatch(match)[1] @@ -167,7 +167,7 @@ func (t *testCtx) replace(value string) string { return t.addrUUIDByName[email] }) - // Replace {upper:VALUE} with VALUE in uppercase. + // Replace {toUpper:VALUE} with VALUE in uppercase. value = regexp.MustCompile(`\{toUpper:([^}]+)\}`).ReplaceAllStringFunc(value, func(match string) string { return strings.ToUpper(regexp.MustCompile(`\{toUpper:([^}].+)\}`).FindStringSubmatch(match)[1]) }) diff --git a/tests/features/imap/auth.feature b/tests/features/imap/auth.feature index 9adc36c6..d839a3bc 100644 --- a/tests/features/imap/auth.feature +++ b/tests/features/imap/auth.feature @@ -1,12 +1,12 @@ Feature: A user can authenticate an IMAP client Background: Given there exists an account with username "[user:user]" and password "password" - And there exists an account with username "[user2:user2]" and password "password2" + And there exists an account with username "[user:user2]" and password "password2" And the account "[user:user]" has additional address "[alias:alias]@[domain]" - And the account "[user2:user2]" has additional disabled address "[alias2:alias2]@[domain]" + And the account "[user:user2]" has additional disabled address "[alias:alias2]@[domain]" And bridge starts And the user logs in with username "[user:user]" and password "password" - And the user logs in with username "[user2:user2]" and password "password2" + And the user logs in with username "[user:user2]" and password "password2" Scenario: IMAP client can authenticate successfully When user "[user:user]" connects IMAP client "1" @@ -20,7 +20,7 @@ Feature: A user can authenticate an IMAP client Given user "[user:user]" connects and authenticates IMAP client "1" with address "[alias:alias]@[domain]" Scenario: IMAP client can not authenticate successfully with disable address - Given user "[user2:user2]" connects and can not authenticate IMAP client "1" with address "[alias2:alias2]@[domain]" + Given user "[user:user2]" connects and can not authenticate IMAP client "1" with address "[alias:alias2]@[domain]" Scenario: IMAP client can authenticate successfully When user "[user:user]" connects IMAP client "1" diff --git a/tests/features/smtp/auth.feature b/tests/features/smtp/auth.feature index ea7afd5b..56a20993 100644 --- a/tests/features/smtp/auth.feature +++ b/tests/features/smtp/auth.feature @@ -1,14 +1,14 @@ Feature: A user can authenticate an SMTP client Background: Given there exists an account with username "[user:user]" and password "password" - And there exists an account with username "[user2:user2]" and password "password2" + And there exists an account with username "[user:user2]" and password "password2" And there exists a disabled account with username "[user3:user3]" and password "password3" And the account "[user:user]" has additional address "[alias:alias]@[domain]" - And the account "[user2:user2]" has additional disabled address "[alias2:alias2]@[domain]" + And the account "[user:user2]" has additional disabled address "[alias:alias2]@[domain]" And the account "[user3:user3]" has additional address "[alias3:alias3]@[domain]" And bridge starts And the user logs in with username "[user:user]" and password "password" - And the user logs in with username "[user2:user2]" and password "password2" + And the user logs in with username "[user:user2]" and password "password2" And the user logs in with username "[user3:user3]" and password "password3" Scenario: SMTP client can authenticate successfully @@ -33,7 +33,7 @@ Feature: A user can authenticate an SMTP client Then it succeeds Scenario: SMTP client can not authenticate with disabled address - When user "[user2:user2]" connects and authenticates SMTP client "1" with address "[alias2:alias2]@[domain]" + When user "[user:user2]" connects and authenticates SMTP client "1" with address "[alias:alias2]@[domain]" Then it fails Scenario: SMTP Logs out user @@ -44,7 +44,7 @@ Feature: A user can authenticate an SMTP client Scenario: SMTP client can authenticate two users When user "[user:user]" connects SMTP client "1" Then SMTP client "1" can authenticate - When user "[user2:user2]" connects SMTP client "2" + When user "[user:user2]" connects SMTP client "2" Then SMTP client "2" can authenticate @ignore-live