diff --git a/pam/integration-tests/native_test.go b/pam/integration-tests/native_test.go index e6af3a8e5..d90e75b20 100644 --- a/pam/integration-tests/native_test.go +++ b/pam/integration-tests/native_test.go @@ -163,7 +163,7 @@ func TestNativeAuthenticate(t *testing.T) { tape: "switch_local_broker", tapeSettings: []tapeSetting{{vhsHeight, 700}}, clientOptions: clientOptions{PamUser: "user-integration-switch-broker"}, - tapeVariables: map[string]string{"AUTHD_TAPE_FINAL_WAIT_PATTERN": ""}, + tapeVariables: map[string]string{"AUTHD_TAPE_FINAL_WAIT_PATTERN": `>\n`}, }, "Authenticate user and add it to local group": { tape: "local_group", diff --git a/pam/integration-tests/testdata/tapes/cli/bad_password.tape b/pam/integration-tests/testdata/tapes/cli/bad_password.tape index 9ba7016b3..f1d7b2d95 100644 --- a/pam/integration-tests/testdata/tapes/cli/bad_password.tape +++ b/pam/integration-tests/testdata/tapes/cli/bad_password.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-needs-reset" -Wait /Username: user-needs-reset$/ +Wait /Username: user-needs-reset\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/form_with_button.tape b/pam/integration-tests/testdata/tapes/cli/form_with_button.tape index 148c4f332..826f7dc67 100644 --- a/pam/integration-tests/testdata/tapes/cli/form_with_button.tape +++ b/pam/integration-tests/testdata/tapes/cli/form_with_button.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-form-w-button" -Wait /Username: user-integration-form-w-button$/ +Wait /Username: user-integration-form-w-button\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/local_broker.tape b/pam/integration-tests/testdata/tapes/cli/local_broker.tape index f074e6614..bc3421bbd 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_broker.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-local-broker" -Wait /Username: user-local-broker$/ +Wait /Username: user-local-broker\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/local_group.tape b/pam/integration-tests/testdata/tapes/cli/local_group.tape index a0ccb23a6..7c87ee520 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_group.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_group.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-local-groups" -Wait /Username: user-local-groups$/ +Wait /Username: user-local-groups\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/local_user.tape b/pam/integration-tests/testdata/tapes/cli/local_user.tape index 3d3a8beac..6f20d31a3 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_user.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "root" -Wait /Username: root$/ +Wait /Username: root\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape b/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape index 1c3a58f4c..f8080890b 100644 --- a/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape +++ b/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-needs-reset-integration-mandatory" -Wait /Username: user-needs-reset-integration-mandatory$/ +Wait /Username: user-needs-reset-integration-mandatory\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/max_attempts.tape b/pam/integration-tests/testdata/tapes/cli/max_attempts.tape index 1aeb9c27f..8aff6b19d 100644 --- a/pam/integration-tests/testdata/tapes/cli/max_attempts.tape +++ b/pam/integration-tests/testdata/tapes/cli/max_attempts.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-max-attempts" -Wait /Username: user-integration-max-attempts$/ +Wait /Username: user-integration-max-attempts\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape b/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape index a97386fab..e8234f452 100644 --- a/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape +++ b/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-mfa" -Wait /Username: user-mfa$/ +Wait /Username: user-mfa\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/mfa_reset_pwquality_auth.tape b/pam/integration-tests/testdata/tapes/cli/mfa_reset_pwquality_auth.tape index cadc6c91a..ddc9cd126 100644 --- a/pam/integration-tests/testdata/tapes/cli/mfa_reset_pwquality_auth.tape +++ b/pam/integration-tests/testdata/tapes/cli/mfa_reset_pwquality_auth.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-mfa-with-reset" -Wait /Username: user-mfa-with-reset$/ +Wait /Username: user-mfa-with-reset\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/optional_password_reset_skip.tape b/pam/integration-tests/testdata/tapes/cli/optional_password_reset_skip.tape index 731a3ea9b..2bf0ef389 100644 --- a/pam/integration-tests/testdata/tapes/cli/optional_password_reset_skip.tape +++ b/pam/integration-tests/testdata/tapes/cli/optional_password_reset_skip.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-can-reset" -Wait /Username: user-can-reset$/ +Wait /Username: user-can-reset\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape b/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape index f83ddaccf..a2cb9196e 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-max-attempts" -Wait /Username: user-integration-max-attempts$/ +Wait /Username: user-integration-max-attempts\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape b/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape index 601536f7b..b780efd99 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-bad-password" -Wait /Username: user-integration-bad-password$/ +Wait /Username: user-integration-bad-password\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape b/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape index 161bc55e9..d135dd3ac 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-local-broker" -Wait /Username: user-local-broker$/ +Wait /Username: user-local-broker\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape b/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape index 730cfd4f5..93274db90 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-mfa" -Wait /Username: user-mfa$/ +Wait /Username: user-mfa\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape b/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape index bebeda120..2d29548de 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-same-new-password" -Wait /Username: user-integration-same-new-password$/ +Wait /Username: user-integration-same-new-password\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape b/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape index 8f3e0431c..786439963 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-wrong-confirmation" -Wait /Username: user-integration-wrong-confirmation$/ +Wait /Username: user-integration-wrong-confirmation\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape b/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape index fff6a80c6..a21e8fd30 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-invalid-new-password" -Wait /Username: user-integration-invalid-new-password$/ +Wait /Username: user-integration-invalid-new-password\n/ Show Hide @@ -69,12 +69,12 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-invalid-new-password" -Wait /Username: user-integration-invalid-new-password$/ +Wait /Username: user-integration-invalid-new-password\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape b/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape index 70d03b744..32ce69ffa 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-sigint" -Wait /Username: user-integration-sigint$/ +Wait /Username: user-integration-sigint\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape b/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape index 5a2adc92e..2d291160d 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user1" -Wait /Username: user1$/ +Wait /Username: user1\n/ Show Hide @@ -52,12 +52,12 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_LOGIN_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user1" -Wait+Screen /Username: user1\n/ +Wait /Username: user1\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape b/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape index c00423da2..4d912c99e 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-unexistent" -Wait /Username: user-unexistent$/ +Wait /Username: user-unexistent\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/qr_code_quick_regenerate.tape b/pam/integration-tests/testdata/tapes/cli/qr_code_quick_regenerate.tape index a37796be2..9fe043ed3 100644 --- a/pam/integration-tests/testdata/tapes/cli/qr_code_quick_regenerate.tape +++ b/pam/integration-tests/testdata/tapes/cli/qr_code_quick_regenerate.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-qrcode-static-regenerate" -Wait /Username: user-integration-qrcode-static-regenerate$/ +Wait /Username: user-integration-qrcode-static-regenerate\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/remember_broker_and_mode.tape b/pam/integration-tests/testdata/tapes/cli/remember_broker_and_mode.tape index 5f0e36cb6..4b4498066 100644 --- a/pam/integration-tests/testdata/tapes/cli/remember_broker_and_mode.tape +++ b/pam/integration-tests/testdata/tapes/cli/remember_broker_and_mode.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-remember-mode" -Wait /Username: user-integration-remember-mode$/ +Wait /Username: user-integration-remember-mode\n/ Show Hide @@ -43,12 +43,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-remember-mode" -Wait /Username: user-integration-remember-mode$/ +Wait /Username: user-integration-remember-mode\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/sigint.tape b/pam/integration-tests/testdata/tapes/cli/sigint.tape index 6a92b7999..535409304 100644 --- a/pam/integration-tests/testdata/tapes/cli/sigint.tape +++ b/pam/integration-tests/testdata/tapes/cli/sigint.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-sigint" -Wait /Username: user-integration-sigint$/ +Wait /Username: user-integration-sigint\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/simple_auth.tape b/pam/integration-tests/testdata/tapes/cli/simple_auth.tape index 33b38f8f1..e8265d51e 100644 --- a/pam/integration-tests/testdata/tapes/cli/simple_auth.tape +++ b/pam/integration-tests/testdata/tapes/cli/simple_auth.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user1" -Wait /Username: user1$/ +Wait /Username: user1\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/simple_auth_empty_user.tape b/pam/integration-tests/testdata/tapes/cli/simple_auth_empty_user.tape index ad364496c..d2c41addc 100644 --- a/pam/integration-tests/testdata/tapes/cli/simple_auth_empty_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/simple_auth_empty_user.tape @@ -2,29 +2,29 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-not-empty" -Wait+Screen /Username: user-integration-not-empty\n/ +Wait /Username: user-integration-not-empty\n/ Show Hide Backspace 26 -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Escape Backspace Type "user-integration-was-empty" -Wait+Screen /Username: user-integration-was-empty\n/ +Wait /Username: user-integration-was-empty\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/simple_auth_with_unsupported_args.tape b/pam/integration-tests/testdata/tapes/cli/simple_auth_with_unsupported_args.tape index d45fd45c4..0ee9b44d2 100644 --- a/pam/integration-tests/testdata/tapes/cli/simple_auth_with_unsupported_args.tape +++ b/pam/integration-tests/testdata/tapes/cli/simple_auth_with_unsupported_args.tape @@ -1,12 +1,12 @@ Hide Type "${AUTHD_TEST_TAPE_COMMAND} invalid_flag=foo bar" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user2" -Wait /Username: user2$/ +Wait /Username: user2\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape b/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape index a96b51843..2bd75db69 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-switch-mode" -Wait /Username: user-integration-switch-mode$/ +Wait /Username: user-integration-switch-mode\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape b/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape index 5c3b97463..7217497af 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-integration-switch-broker" -Wait /Username: user-integration-switch-broker$/ +Wait /Username: user-integration-switch-broker\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/switch_username.tape b/pam/integration-tests/testdata/tapes/cli/switch_username.tape index ff244b70d..c48e24524 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_username.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_username.tape @@ -2,13 +2,13 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Escape Type "user-integration-switch-username" -Wait /Username: user-integration-switch-username$/ +Wait /Username: user-integration-switch-username\n/ Show Hide @@ -18,11 +18,11 @@ Show Hide Escape -Wait /Username: user-integration-switch-username$/ +Wait /Username: user-integration-switch-username\n/ Backspace 15 -Wait /Username: user-integration-$/ +Wait /Username: user-integration-\n/ Type "username-switched" -Wait /Username: user-integration-username-switched$/ +Wait /Username: user-integration-username-switched\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape b/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape index ab45f1d79..4c27a2ad7 100644 --- a/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape @@ -2,12 +2,12 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide Type "user-unexistent" -Wait /Username: user-unexistent$/ +Wait /Username: user-unexistent\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/cancel_key_user.tape b/pam/integration-tests/testdata/tapes/native/cancel_key_user.tape index ddd8d2d77..26ea776af 100644 --- a/pam/integration-tests/testdata/tapes/native/cancel_key_user.tape +++ b/pam/integration-tests/testdata/tapes/native/cancel_key_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/local_broker.tape b/pam/integration-tests/testdata/tapes/native/local_broker.tape index e839fd471..b1e18e2f7 100644 --- a/pam/integration-tests/testdata/tapes/native/local_broker.tape +++ b/pam/integration-tests/testdata/tapes/native/local_broker.tape @@ -1,5 +1,5 @@ Hide -Wait />$/ +Wait /^>\n/ Type "${AUTHD_TEST_TAPE_COMMAND}" Enter Wait+Prompt /Choose your provider/ diff --git a/pam/integration-tests/testdata/tapes/native/local_ssh.tape b/pam/integration-tests/testdata/tapes/native/local_ssh.tape index f6a848fb6..19463c678 100644 --- a/pam/integration-tests/testdata/tapes/native/local_ssh.tape +++ b/pam/integration-tests/testdata/tapes/native/local_ssh.tape @@ -1,5 +1,5 @@ Hide -Wait />$/ +Wait /^>\n/ Type "${AUTHD_TEST_TAPE_COMMAND}" Enter Wait diff --git a/pam/integration-tests/testdata/tapes/native/local_user.tape b/pam/integration-tests/testdata/tapes/native/local_user.tape index 3aeb2d6a6..ca9725b08 100644 --- a/pam/integration-tests/testdata/tapes/native/local_user.tape +++ b/pam/integration-tests/testdata/tapes/native/local_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/local_user_preset.tape b/pam/integration-tests/testdata/tapes/native/local_user_preset.tape index f6a848fb6..19463c678 100644 --- a/pam/integration-tests/testdata/tapes/native/local_user_preset.tape +++ b/pam/integration-tests/testdata/tapes/native/local_user_preset.tape @@ -1,5 +1,5 @@ Hide -Wait />$/ +Wait /^>\n/ Type "${AUTHD_TEST_TAPE_COMMAND}" Enter Wait diff --git a/pam/integration-tests/testdata/tapes/native/passwd_auth_fail.tape b/pam/integration-tests/testdata/tapes/native/passwd_auth_fail.tape index 4f49236cd..79d5e58b4 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_auth_fail.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_auth_fail.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_bad_password.tape b/pam/integration-tests/testdata/tapes/native/passwd_bad_password.tape index 6c0c94819..4b3980a2a 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_bad_password.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_bad_password.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_local_broker.tape b/pam/integration-tests/testdata/tapes/native/passwd_local_broker.tape index 680c6dbb4..5bcef4a62 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_local_broker.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_local_broker.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_mfa.tape b/pam/integration-tests/testdata/tapes/native/passwd_mfa.tape index 47069136e..311caf1ab 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_mfa.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_mfa.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_not_changed.tape b/pam/integration-tests/testdata/tapes/native/passwd_not_changed.tape index eb9ed782c..066e908c9 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_not_changed.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_not_changed.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_not_confirmed.tape b/pam/integration-tests/testdata/tapes/native/passwd_not_confirmed.tape index 1b5aa0240..99ca51657 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_not_confirmed.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_not_confirmed.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_rejected.tape b/pam/integration-tests/testdata/tapes/native/passwd_rejected.tape index 00b5c58be..ecf7ed728 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_rejected.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_rejected.tape @@ -1,7 +1,7 @@ Hide Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide @@ -56,7 +56,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_sigint.tape b/pam/integration-tests/testdata/tapes/native/passwd_sigint.tape index af2d211f9..0d3c4e0f5 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_sigint.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_sigint.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_simple.tape b/pam/integration-tests/testdata/tapes/native/passwd_simple.tape index 5cf9e0591..9a2957464 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_simple.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_simple.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide @@ -40,7 +40,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_LOGIN_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/passwd_unexistent_user.tape b/pam/integration-tests/testdata/tapes/native/passwd_unexistent_user.tape index 9bea9e0e3..3bae0d7d4 100644 --- a/pam/integration-tests/testdata/tapes/native/passwd_unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/native/passwd_unexistent_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/remember_broker_and_mode.tape b/pam/integration-tests/testdata/tapes/native/remember_broker_and_mode.tape index f5177b5e7..82de5e157 100644 --- a/pam/integration-tests/testdata/tapes/native/remember_broker_and_mode.tape +++ b/pam/integration-tests/testdata/tapes/native/remember_broker_and_mode.tape @@ -1,4 +1,5 @@ Hide +Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter Wait+Prompt /Choose your provider/ @@ -38,6 +39,7 @@ Show ClearTerminal Hide +Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter Wait+Prompt /Choose action/ diff --git a/pam/integration-tests/testdata/tapes/native/simple_auth_with_user_selection.tape b/pam/integration-tests/testdata/tapes/native/simple_auth_with_user_selection.tape index 3d66c9a61..7161b2c49 100644 --- a/pam/integration-tests/testdata/tapes/native/simple_auth_with_user_selection.tape +++ b/pam/integration-tests/testdata/tapes/native/simple_auth_with_user_selection.tape @@ -2,13 +2,13 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide Type "" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/native/switch_username.tape b/pam/integration-tests/testdata/tapes/native/switch_username.tape index 1f6d2c32a..0e98531b5 100644 --- a/pam/integration-tests/testdata/tapes/native/switch_username.tape +++ b/pam/integration-tests/testdata/tapes/native/switch_username.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide @@ -17,7 +17,7 @@ Show Hide Type "r" Enter -Wait /Username:$/ +Wait /Username:/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape b/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape index 63f328dd5..c17c9f250 100644 --- a/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape +++ b/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait+Screen /Password:[\n]*$/ +Wait /Password:/ Show Sleep ${AUTHD_SLEEP_DEFAULT} diff --git a/pam/integration-tests/testdata/tapes/ssh/simple_auth_with_shell.tape b/pam/integration-tests/testdata/tapes/ssh/simple_auth_with_shell.tape index 7b9a95404..7b8b8eb50 100644 --- a/pam/integration-tests/testdata/tapes/ssh/simple_auth_with_shell.tape +++ b/pam/integration-tests/testdata/tapes/ssh/simple_auth_with_shell.tape @@ -14,7 +14,7 @@ Show Hide Type "goodpass" Enter -Wait /^\$/ +Wait /\$\n/ Show Hide @@ -25,7 +25,7 @@ Show Hide Type '[ -n "${SSH_CONNECTION}" ] && echo "Inside SSH"' Enter -Wait /^\$/ +Wait /\$\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape b/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape index 63f328dd5..c17c9f250 100644 --- a/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait+Screen /Password:[\n]*$/ +Wait /Password:/ Show Sleep ${AUTHD_SLEEP_DEFAULT} diff --git a/pam/integration-tests/vhs-helpers_test.go b/pam/integration-tests/vhs-helpers_test.go index ac5335ada..c083fabc8 100644 --- a/pam/integration-tests/vhs-helpers_test.go +++ b/pam/integration-tests/vhs-helpers_test.go @@ -78,6 +78,8 @@ var ( `(?m)\$\{?(AUTHD_SLEEP_[A-Z_]+)\}?(\s?([*/]+)\s?([\d.]+))?(.*)$`) vhsEmptyLinesRegex = regexp.MustCompile(`(?m)((^\n^\n)+(^\n)?|^\n)(^─+$)`) + // vhsWaitRegex ensures proper debug on Wait /Pattern/ command. + vhsWaitRegex = regexp.MustCompile(`(?m)^\s?Wait(\+Line)?(@[^\s]+)?[ ]+(/(.*)/|(.*))$`) // vhsWaitForPromptRegex adds support for Wait+Prompt /Pattern/ command. vhsWaitForPromptRegex = regexp.MustCompile(`(?m)^\s?Wait\+Prompt(@[^\s]+)?\s+(/(.*)/|(.*))$`) // vhsWaitForNth adds support for Wait+Nth(X) /Pattern/ command, where X is the @@ -369,6 +371,8 @@ func evaluateTapeVariables(t *testing.T, tapeString string, td tapeData) string tapeString = strings.ReplaceAll(tapeString, variable, v) } + tapeString = vhsWaitRegex.ReplaceAllString(tapeString, + `Wait+Screen$2 /(^|[\n]+)[^\n]*$4$5[^\n]*[\n]*$$/`) tapeString = vhsWaitForPromptRegex.ReplaceAllString(tapeString, `Wait+Screen$1 /$3$4:\n>[\n]*$$/`) tapeString = vhsWaitForNth.ReplaceAllString(tapeString,