Merge lp://staging/~lool/ubuntu-system-image/use-system-bus-instead-of-session-bus into lp://staging/~registry/ubuntu-system-image/client

Proposed by Loïc Minier
Status: Merged
Approved by: Barry Warsaw
Approved revision: 113
Merge reported by: Barry Warsaw
Merged at revision: not available
Proposed branch: lp://staging/~lool/ubuntu-system-image/use-system-bus-instead-of-session-bus
Merge into: lp://staging/~registry/ubuntu-system-image/client
Diff against target: 135 lines (+18/-18)
5 files modified
systemimage/service.py (+4/-4)
systemimage/testing/controller.py (+6/-6)
systemimage/testing/dbus.py (+2/-2)
systemimage/tests/data/dbus-system.conf.in (+2/-2)
systemimage/tests/test_dbus.py (+4/-4)
To merge this branch: bzr merge lp://staging/~lool/ubuntu-system-image/use-system-bus-instead-of-session-bus
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Review via email: mp+177562@code.staging.launchpad.net

Commit message

Use system bus instead of session bus.

Description of the change

Use system bus instead of session bus; this is helpful for the mocks to work like the real service and for consistency with production.

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

NB: tests passed except test_lp1199361 which seems to be either super-slow or misbehaving on my system; seems unrelated though.

Revision history for this message
Barry Warsaw (barry) wrote :

On Jul 30, 2013, at 10:48 AM, Loïc Minier wrote:

>Use system bus instead of session bus; this is helpful for the mocks to work
>like the real service and for consistency with production.

This generally looks good, except that running the test suite locally produces
errors for me, of the kind:

======================================================================
ERROR: test_cancel (systemimage.tests.test_dbus.TestDBus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.canonical.SystemImage': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./systemimage/tests/test_dbus.py", line 133, in setUp
    super().setUp()
  File "./systemimage/tests/test_dbus.py", line 69, in setUp
    'com.canonical.SystemImage', '/Service')
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process /home/barry/projects/phone/client/.tox/py33/bin/python exited with status 2

I will investigate.

As for test_lp1199361, that one is a bit flaky on some hardware. I haven't
figured out why though, and it does seem to pass for me on my desktop and the
buildds.

Revision history for this message
Loïc Minier (lool) wrote :

On Tue, Jul 30, 2013, Barry Warsaw wrote:
> This generally looks good, except that running the test suite locally produces
> errors for me, of the kind:

Ah; this might be because I have a
/etc/dbus-1/system.d/com.canonical.SystemImage.conf
file allowing access to com.canonical.SystemImage; not sure.

I ran this on my desktop, there might be other things interfering that
need to be isolated in the testsuite :-/

--
Loïc Minier

Revision history for this message
Barry Warsaw (barry) wrote :

I fixed the dbus connection problems with a slight modification of the dbus-system.conf template. Test pass, branch approved. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches