diff --git a/pam/integration-tests/testdata/tapes/cli/bad_password.tape b/pam/integration-tests/testdata/tapes/cli/bad_password.tape index aa4abb61d..1b3f8d7ea 100644 --- a/pam/integration-tests/testdata/tapes/cli/bad_password.tape +++ b/pam/integration-tests/testdata/tapes/cli/bad_password.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 abf9a6f81..eab5722fa 100644 --- a/pam/integration-tests/testdata/tapes/cli/form_with_button.tape +++ b/pam/integration-tests/testdata/tapes/cli/form_with_button.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 88933dd31..05b603aad 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_broker.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 e4b7a8520..72e9b72b5 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_group.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_group.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 28572f381..49e3cafc0 100644 --- a/pam/integration-tests/testdata/tapes/cli/local_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/local_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 fb6c35d04..383a27831 100644 --- a/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape +++ b/pam/integration-tests/testdata/tapes/cli/mandatory_password_reset.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 34b0103e2..b0cf411c1 100644 --- a/pam/integration-tests/testdata/tapes/cli/max_attempts.tape +++ b/pam/integration-tests/testdata/tapes/cli/max_attempts.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 48b374b9b..321d9c3d8 100644 --- a/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape +++ b/pam/integration-tests/testdata/tapes/cli/mfa_auth.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 85ebf9aef..452310624 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,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 593c5d66c..62aefbd28 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,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 ce2317214..1a507fd2d 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 61044f477..5fda5b3b7 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_bad_password.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 d47e6337e..01cda3138 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_local_broker.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 41d19da71..0f4f951a2 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 098b38901..517dc9f82 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_not_changed.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 78773ef3d..086a88578 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_not_confirmed.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 21c29fb5c..1611fae5d 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_rejected.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide @@ -66,7 +66,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 9a8cfc4f8..370fc7184 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_sigint.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 692d71b2b..1476720ba 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_simple.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide @@ -49,7 +49,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_LOGIN_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 346f7475c..df5da976e 100644 --- a/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/passwd_unexistent_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 a683f1278..83a18d891 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,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 01a7145ac..3d4439087 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,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide @@ -40,7 +40,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide diff --git a/pam/integration-tests/testdata/tapes/cli/sigint.tape b/pam/integration-tests/testdata/tapes/cli/sigint.tape index d3a202d33..7b1f61e28 100644 --- a/pam/integration-tests/testdata/tapes/cli/sigint.tape +++ b/pam/integration-tests/testdata/tapes/cli/sigint.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 f4e47589e..6381045fb 100644 --- a/pam/integration-tests/testdata/tapes/cli/simple_auth.tape +++ b/pam/integration-tests/testdata/tapes/cli/simple_auth.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 a6bc30680..68f6b8d45 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,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide @@ -11,12 +11,12 @@ 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 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 e2c3a5914..f0d19e9fd 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,7 +1,7 @@ Hide Type "${AUTHD_TEST_TAPE_COMMAND} invalid_flag=foo bar" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 7a89b8953..008db1ac5 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_auth_mode.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 5f76a7c97..f621ad875 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_local_broker.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 16d12a5a1..dac030dca 100644 --- a/pam/integration-tests/testdata/tapes/cli/switch_username.tape +++ b/pam/integration-tests/testdata/tapes/cli/switch_username.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\n/ Show Hide @@ -17,11 +17,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 f4aabf89e..42d689ca4 100644 --- a/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/cli/unexistent_user.tape @@ -2,7 +2,7 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username: user name$/ +Wait /Username: user name\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 25262436e..e4a161c20 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:\n/ 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 f70ace0a8..422373806 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 64c660bfa..75dc51162 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 ${AUTHD_TEST_TAPE_COMMAND_AUTH_FINAL_WAIT} diff --git a/pam/integration-tests/testdata/tapes/native/local_user.tape b/pam/integration-tests/testdata/tapes/native/local_user.tape index 0ddbab30a..eae9bbc2e 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:\n/ 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 64c660bfa..75dc51162 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 ${AUTHD_TEST_TAPE_COMMAND_AUTH_FINAL_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 45fd8c724..d260a6efe 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:\n/ 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 b76b2e0e4..ae6604579 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:\n/ 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 ea1c5638f..198498260 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:\n/ 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 a7b470b10..1c592f3d1 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:\n/ 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 70059d40b..a9ae6c319 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:\n/ 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 00549a6f2..c5a20442f 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:\n/ 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 344a8cd6e..7a98371b2 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:\n/ Show Hide @@ -56,7 +56,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:\n/ 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 df4179088..e28366391 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:\n/ 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 da8afdfde..48a8c040c 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:\n/ Show Hide @@ -40,7 +40,7 @@ ClearTerminal Hide Type "${AUTHD_TEST_TAPE_LOGIN_COMMAND}" Enter -Wait /Username:$/ +Wait /Username:\n/ 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 11000fcd2..eb47a27a4 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:\n/ Show Hide 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 297f8a590..7c3ed4442 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:\n/ Show Hide Type "" Enter -Wait /Username:$/ +Wait /Username:\n/ 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 d346df962..e8230ed8e 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:\n/ Show Hide @@ -17,7 +17,7 @@ Show Hide Type "r" Enter -Wait /Username:$/ +Wait /Username:\n/ 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 44377de9c..7d86bc5cb 100644 --- a/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape +++ b/pam/integration-tests/testdata/tapes/ssh/cancel_key_user.tape @@ -2,5 +2,5 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait+Suffix /Password:/ +Wait /Password:/ Show 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 99358e94f..90c624736 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 44377de9c..7d86bc5cb 100644 --- a/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape +++ b/pam/integration-tests/testdata/tapes/ssh/unexistent_user.tape @@ -2,5 +2,5 @@ Hide Wait Type "${AUTHD_TEST_TAPE_COMMAND}" Enter -Wait+Suffix /Password:/ +Wait /Password:/ Show diff --git a/pam/integration-tests/vhs-helpers_test.go b/pam/integration-tests/vhs-helpers_test.go index a66ce34ce..5d634fdcf 100644 --- a/pam/integration-tests/vhs-helpers_test.go +++ b/pam/integration-tests/vhs-helpers_test.go @@ -105,6 +105,10 @@ 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(`\bWait(\+Line)?(@\S+)?[\t ]+(/(.+)/|(.+))`) + // vhsWaitLineRegex ensures proper debug on Wait command (without pattern). + vhsWaitLineRegex = regexp.MustCompile(`\bWait(\+Line)?(@\S+)?[\t ]*\n`) // vhsWaitSuffix adds support for Wait+Suffix /Pattern/ command. vhsWaitSuffix = regexp.MustCompile(`\bWait\+Suffix(@\S+)?[\t ]+(/(.*)/|(.*))`) // vhsWaitPromptRegex adds support for Wait+Prompt /Pattern/ command. @@ -448,7 +452,7 @@ func evaluateTapeVariables(t *testing.T, tapeString string, td tapeData, testTyp } tapeString = vhsTypeAndWaitUsername.ReplaceAllString(tapeString, `Type "$1" -Wait /Username: $1$$/`) +Wait /Username: $1\n/`) for _, m := range vhsTypeAndWaitCLIPassword.FindAllStringSubmatch(tapeString, -1) { fullMatch, password := m[0], m[1] @@ -459,6 +463,16 @@ Wait+Screen /\n> %s\n/`, regexp.QuoteMeta(strings.Repeat("*", len(password))))) } + waitPattern := `/(^|\n)>/` + if wp, ok := td.Settings[vhsWaitPattern]; ok { + waitPattern, ok = wp.(string) + require.True(t, ok, "Setup: %s must be a string", vhsWaitPattern) + } + + tapeString = vhsWaitRegex.ReplaceAllString(tapeString, + `Wait+Suffix$2 /(^|[\n]+)[^\n]*$4$5[^\n]*/`) + tapeString = vhsWaitLineRegex.ReplaceAllString(tapeString, + fmt.Sprintf("Wait+Suffix$2 %s\n", waitPattern)) tapeString = vhsWaitCLIPromptRegex.ReplaceAllString(tapeString, `Wait+Suffix$1 /$2:\n>[\n]+[ ]*$4[\n]*[\n]+$6/`) tapeString = vhsWaitPromptRegex.ReplaceAllString(tapeString,