-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pybridge: Improve beiboot error reporting for fatal login failures
After all SSH authentication attemps fail, e.g. entering the wrong password three times, ferny throws an InteractionError. Merely exiting cockpit-beiboot gets interpreted as "Internal error" which is unfriendly. Translate the most common errors (DNS resolution and and authentication failure) to proper cockpit protocol error codes, so that they get presented properly and translated. As this involves parsing SSH output, keep the `internal-error` fallback for everything else.
- Loading branch information
1 parent
2d3f3dd
commit fb73cc7
Showing
3 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,13 +147,11 @@ Command = /usr/bin/env python3 -m cockpit.beiboot | |
b.wait_text("#conversation-prompt", "[email protected]'s password: ") | ||
b.set_val("#conversation-input", "wrong") | ||
b.click("#login-button") | ||
b.wait_in_text("#login-fatal-message", "[email protected]: Permission denied") | ||
b.click("#login-again") | ||
b.wait_text("#brand", "Connect to:") | ||
# resets the host field | ||
b.wait_val("#server-field", "") | ||
b.wait_in_text("#login-error-message", "Authentication failed") | ||
b.wait_val("#server-field", "10.111.113.2") | ||
|
||
# connect to most recent host | ||
b.open("/") # reset URL from /metrics and last remote =host | ||
b.click("#recent-hosts-list .host-line button.host-name") | ||
b.wait_text("#conversation-prompt", "[email protected]'s password: ") | ||
b.set_val("#conversation-input", "foobar") | ||
|
@@ -208,9 +206,8 @@ Command = /usr/bin/env python3 -m cockpit.beiboot | |
# unreachable host | ||
b.set_val("#server-field", "unknownhost") | ||
b.click("#login-button") | ||
b.wait_in_text("#login-fatal-message", "Could not resolve hostname unknownhost") | ||
b.click("#login-again") | ||
b.wait_text("#brand", "Connect to:") | ||
b.wait_in_text("#login-error-message", "Host is unknown") | ||
b.wait_val("#server-field", "unknownhost") | ||
# does not appear in recent hosts | ||
b.wait_in_text("#recent-hosts-list", "10.111.113.2") | ||
self.assertNotIn("unknownhost", b.text("#recent-hosts-list")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters