diff --git a/pam/integration-tests/native_test.go b/pam/integration-tests/native_test.go index e5acc889e..5a7221556 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 279a85fee..4a8f1c542 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 7e0f277d7..571b30f81 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 53ef13932..71f516344 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 fedcd2f9c..796998763 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 4f6f89e5f..5001f17e3 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 7ed5f8354..2956d10a8 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 32af11947..ebc1472b1 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 5078062ad..e5fb02ee7 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 9f2fdc325..8f256ebbf 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 044df5f99..f56fa71d4 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 b4d06e687..11893c128 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 7362ee66f..15b5bc32f 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 3d7c08cf0..7599453a9 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 940cbbcbe..ce1fb15a1 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 a776563e0..838d639d6 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 6c3667d9a..c8a9accb4 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 7b8345b75..2b7bc0fe0 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 @@ -67,12 +67,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 9251dc4c9..831c04e80 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 8d5a66682..10177ae93 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 @@ -50,12 +50,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 ab04dd63c..f855d7290 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 6903d8c2e..603e4f80a 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 6bbde8ca2..2e376a854 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 @@ -41,12 +41,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 840ee8d82..84db449fd 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 914526881..35ad68a6f 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 a08a53950..ed1d2cf8c 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 8d37c6052..204ab93d3 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 45829379a..01f854116 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 c2cb6c885..fd2b97a96 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 3c2949747..797729b31 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 4cefdfeec..3032820a4 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 8162de2d7..65d545a5f 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 a5778a387..cceb534cd 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 d6cadbafa..2d9113cd2 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 ecec5f7a8..6a71c2aa6 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 d6cadbafa..2d9113cd2 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 970895555..8185ef386 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 dbe018555..fa16d0b18 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 6e5f3c239..5a70b201b 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 b57bfb33c..843abae32 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 e1e7addcb..f623fec4f 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 030c5537c..bc4b47a99 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 b97d3388c..a674bac86 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 0f439d2e4..dd4a18276 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 68bd53ac9..43b65a472 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 251cc71fd..dd09f5809 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 413b177cb..7c4cfc3bd 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 15d5030d3..d7b461412 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 0df71baf9..2e276d8e9 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 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 f30042ba7..5adb3f129 100644 --- a/pam/integration-tests/vhs-helpers_test.go +++ b/pam/integration-tests/vhs-helpers_test.go @@ -107,6 +107,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(`\bWait(\+Line)?(@\S+)?[\t ]+(/(.+)/|(.+))`) // vhsWaitSuffix adds support for Wait+Suffix /Pattern/ command. vhsWaitSuffix = regexp.MustCompile(`\bWait\+Suffix(@\S+)?[\t ]+(/(.*)/|(.*))`) // vhsWaitPromptRegex adds support for Wait+Prompt /Pattern/ command. @@ -412,6 +414,8 @@ func evaluateTapeVariables(t *testing.T, tapeString string, td tapeData, testTyp fmt.Sprintf("${%s}", vhsCommandFinalChangeAuthokWaitVariable), finalWaitCommands(testType, authd.SessionMode_PASSWD)) + tapeString = vhsWaitRegex.ReplaceAllString(tapeString, + `Wait+Suffix$2 /(^|[\n]+)[^\n]*$4$5[^\n]*/`) tapeString = vhsWaitPromptRegex.ReplaceAllString(tapeString, `Wait+Suffix$1 /$3$4:\n>/`) tapeString = vhsWaitSuffix.ReplaceAllString(tapeString,