Skip to content

Commit

Permalink
tests: Fall back if there's no seat_id for the current session_id
Browse files Browse the repository at this point in the history
Such as in an ssh login.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3875

Fixes: 98b347b ("dbusmock/logind: Mock logind and remove KVM special handling")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4299>
  • Loading branch information
vanvugt authored and Marge Bot committed Feb 27, 2025
1 parent b2c5d44 commit df555f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tests/dbusmock-templates/logind.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,17 @@ def GetSessionByPID(self, pid):
return session_path

def create_session(self, host_bus):
session_id = 'dummy'
seat_id = 'seat0'
session_id = None
seat_id = None

if host_bus:
session_id = find_host_session_id(host_bus)
seat_id = find_host_seat_id(host_bus, session_id)

if not seat_id:
session_id = 'dummy'
seat_id = 'seat0'

if not self.preferred_session_id or host_bus:
self.preferred_session_id = session_id

Expand Down

0 comments on commit df555f4

Please sign in to comment.