Skip to content

Commit

Permalink
pam/integration-tests/vhs: Add utility command to type and verify CLI…
Browse files Browse the repository at this point in the history
… password

So we can avoid to hit enter too early, as the UI may not have been
syncrhonized yet
  • Loading branch information
3v1n0 committed Nov 29, 2024
1 parent 955b524 commit 8dafb89
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 70 deletions.
14 changes: 7 additions & 7 deletions pam/integration-tests/testdata/tapes/cli/bad_password.tape
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -41,7 +41,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "1234"
TypeCLIPassword "1234"
Show

Hide
Expand All @@ -51,7 +51,7 @@ Wait /The password is shorter than \d+ characters/
Show

Hide
Type "12345678"
TypeCLIPassword "12345678"
Show

Hide
Expand All @@ -61,7 +61,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand All @@ -70,7 +70,7 @@ Wait+Prompt /Confirm password/
Show

Hide
Type "123456789"
TypeCLIPassword "123456789"
Show

Hide
Expand All @@ -80,7 +80,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand All @@ -89,7 +89,7 @@ Wait+Prompt /Confirm password/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
2 changes: 1 addition & 1 deletion pam/integration-tests/testdata/tapes/cli/local_group.tape
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -31,13 +31,13 @@ Wait+Prompt /New password/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Enter
Wait+Prompt /Confirm password/
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
10 changes: 5 additions & 5 deletions pam/integration-tests/testdata/tapes/cli/max_attempts.tape
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -32,7 +32,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -42,7 +42,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -52,7 +52,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -62,7 +62,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand Down
2 changes: 1 addition & 1 deletion pam/integration-tests/testdata/tapes/cli/mfa_auth.tape
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -37,7 +37,7 @@ Wait+Screen @${AUTHD_SLEEP_EXAMPLE_BROKER_MFA_WAIT} * 1.2 /New password:\n>\n/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -47,7 +47,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "password"
TypeCLIPassword "password"
Show

Hide
Expand All @@ -57,7 +57,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -67,7 +67,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "1234"
TypeCLIPassword "1234"
Show

Hide
Expand All @@ -77,7 +77,7 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand All @@ -86,7 +86,7 @@ Wait+Screen /Confirm password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand Down
10 changes: 5 additions & 5 deletions pam/integration-tests/testdata/tapes/cli/passwd_auth_fail.tape
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -32,7 +32,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -42,7 +42,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -52,7 +52,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand All @@ -62,7 +62,7 @@ Wait+Screen /Gimme your password:\n>\n/
Show

Hide
Type "wrongpass"
TypeCLIPassword "wrongpass"
Show

Hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -37,27 +37,27 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "1234"
TypeCLIPassword "1234"
Enter
Wait /The password is shorter than \d+ characters/
Wait+Screen /New password:\n>\n/
Show

Hide
Type "12345678"
TypeCLIPassword "12345678"
Enter
Wait /The password fails the dictionary check/
Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Enter
Wait+Prompt /Confirm password/
Show

Hide
Type "123456789"
TypeCLIPassword "123456789"
Show

Hide
Expand All @@ -67,13 +67,13 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Enter
Wait+Prompt /Confirm password/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
6 changes: 3 additions & 3 deletions pam/integration-tests/testdata/tapes/cli/passwd_mfa.tape
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand Down Expand Up @@ -72,13 +72,13 @@ Wait+Prompt@${AUTHD_SLEEP_EXAMPLE_BROKER_MFA_WAIT}*1.2 /New password/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Enter
Wait+Prompt /Confirm password/
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wait+Prompt /Gimme your password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -31,7 +31,7 @@ Wait+Prompt /New password/
Show

Hide
Type "goodpass"
TypeCLIPassword "goodpass"
Show

Hide
Expand All @@ -41,13 +41,13 @@ Wait+Screen /New password:\n>\n/
Show

Hide
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Enter
Wait+Prompt /Confirm password/
Type "authd2404"
TypeCLIPassword "authd2404"
Show

Hide
Expand Down
Loading

0 comments on commit 8dafb89

Please sign in to comment.