Dbus services are not isolated from session dbus

Bug #689800 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Control Panel
Fix Released
High
dobey
ubuntuone-control-panel (Ubuntu)
Fix Released
High
Natalia Bidart

Bug Description

When using the DBusTestCase to mock (real) dbus services, the system service is activated instead.

You can test this by running the tests in the ubuntuone-control-panel trunk by issuing:

./run-tests --integration

Be sure to have (for example) the ubuntu-sso-login dbus service running or the ubuntuone-syncdaemon service. You'll get several traces like:

  File "/home/nessita/canonical/ubuntuone/control-panel/trunk/ubuntuone/controlpanel/integrationtests/__init__.py", line 59, in register_mockserver
    self.assertNotEqual(name, dbus.bus.REQUEST_NAME_REPLY_EXISTS)
twisted.trial.unittest.FailTest: dbus.UInt32(3L) == 3

Related branches

Changed in ubuntuone-dev-tools:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
dobey (dobey) wrote :

Moving to ubuntuone-control-panel which is where the real problem lies. There was a mutable default in one of the function definitions in an imported file, causing an initialization which connected to the running dbus session, as the private one has not yet been started. This is becuase u1trial imports the tests in order to query the test cases for what services need to be run, such as the dbus service.

After other failed attempts to debug the problem, I eventually found it by mokneypatching dbus.SessionService() inside u1trial itself to simply raise an error when called. Was much easier than trying to create a simplified version of the same problem elsewhere. :)

affects: ubuntuone-dev-tools → ubuntuone-control-panel
Changed in ubuntuone-control-panel:
assignee: nobody → Rodney Dawes (dobey)
Changed in ubuntuone-control-panel:
status: Confirmed → Fix Committed
Changed in ubuntuone-control-panel (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Naty Bidart (nataliabidart)
Changed in ubuntuone-control-panel (Ubuntu):
status: Triaged → In Progress
Changed in ubuntuone-control-panel (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntuone-control-panel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.