Skip to content

Commit

Permalink
test: Get along with /usr/local/bin/cockpit-bridge
Browse files Browse the repository at this point in the history
This happens in the pybridge scenario once image-customize changes to
installing wheels into /usr/local [1]. We need while loops to cover all
installed "cockpit-bridge" commands.

[1] cockpit-project/bots#4397
  • Loading branch information
martinpitt authored and jelly committed Feb 14, 2023
1 parent 269d3a9 commit ad55122
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/verify/check-connection
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ class TestConnection(MachineCase):
self.allow_journal_messages(".*cockpit-session: bridge program failed.*")

# pretend cockpit-bridge is not installed, expect specific error message
m.execute("mv /usr/bin/cockpit-bridge /usr/bin/cockpit-bridge.disabled")
m.execute("while B=$(command -v cockpit-bridge); do mv $B ${B}.disabled; done")
b.open("/system")
b.wait_visible("#login")
b.set_val("#login-user-input", "admin")
b.set_val("#login-password-input", "foobar")
b.click('#login-button')
b.wait_visible('#login-fatal-message')
b.wait_text('#login-fatal-message', "The cockpit package is not installed")
m.execute("mv /usr/bin/cockpit-bridge.disabled /usr/bin/cockpit-bridge")
m.execute("while B=$(command -v cockpit-bridge.disabled); do mv $B ${B%.disabled}; done")

# Lets crash a systemd-controlled process and see if we get a proper backtrace in the logs
# This helps with debugging failures in the tests elsewhere
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-loopback
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TestLoopback(MachineCase):
b.logout()
b.wait_visible("#login")

m.execute("rm /usr/bin/cockpit-bridge")
m.execute("while B=$(command -v cockpit-bridge); do rm $B; done")
b.set_val('#login-user-input', "admin")
b.set_val('#login-password-input', "foobar")
b.click('#login-button')
Expand Down

0 comments on commit ad55122

Please sign in to comment.