Merge lp:~thomir-deactivatedaccount/autopilot/1.3-fix-warning into lp:autopilot/1.3

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: 337
Merged at revision: 336
Proposed branch: lp:~thomir-deactivatedaccount/autopilot/1.3-fix-warning
Merge into: lp:autopilot/1.3
Diff against target: 54 lines (+20/-1)
2 files modified
autopilot/introspection/__init__.py (+5/-1)
autopilot/tests/functional/test_introspection_features.py (+15/-0)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopilot/1.3-fix-warning
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Martin Pitt (community) Approve
Review via email: mp+186640@code.launchpad.net

Commit message

Remove a spurious log message.

Description of the change

Remove a log message when we try and get the process Id for the dbus daemon itself.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Ack. I'm not a big fan of the extra empty line in the docstring, but it's broken either way (no single-line short description), so no reason to block the merge on just that.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https://code.launchpad.net/~thomir/autopilot/1.3-fix-warning/+merge/186640/+edit-commit-message

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:335
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~thomir/autopilot/1.3-fix-warning/+merge/186640/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/autopilot-1.3-ci/20/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-1.3-saucy-amd64-ci/20/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-1.3-saucy-armhf-ci/20/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-1.3-saucy-i386-ci/4/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/autopilot-1.3-ci/20/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/introspection/__init__.py'
2--- autopilot/introspection/__init__.py 2013-09-17 18:50:07 +0000
3+++ autopilot/introspection/__init__.py 2013-09-20 12:54:31 +0000
4@@ -393,7 +393,11 @@
5
6 def _connection_matches_pid(bus, connection_name, pid):
7 """Given a PID checks wherever it or its children are connected on this
8- bus."""
9+ bus.
10+
11+ """
12+ if connection_name == 'org.freedesktop.DBus':
13+ return False
14 try:
15 if _bus_pid_is_our_pid(bus, connection_name, pid):
16 return False
17
18=== modified file 'autopilot/tests/functional/test_introspection_features.py'
19--- autopilot/tests/functional/test_introspection_features.py 2013-07-14 09:22:48 +0000
20+++ autopilot/tests/functional/test_introspection_features.py 2013-09-20 12:54:31 +0000
21@@ -17,7 +17,9 @@
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #
24
25+from dbus import SessionBus
26 import json
27+from mock import patch
28 import os
29 import subprocess
30 import tempfile
31@@ -28,6 +30,7 @@
32 from autopilot.matchers import Eventually
33 from autopilot.testcase import AutopilotTestCase
34 from autopilot.introspection.dbus import CustomEmulatorBase
35+from autopilot.introspection import _connection_matches_pid
36
37
38 class EmulatorBase(CustomEmulatorBase):
39@@ -122,3 +125,15 @@
40 self.assertThat(result1.wasSuccessful(), Equals(True))
41 result2 = InnerTestCase('test_custom_emulator').run()
42 self.assertThat(result2.wasSuccessful(), Equals(True))
43+
44+
45+class IntrospectionFunctionTests(AutopilotTestCase):
46+
47+ @patch('autopilot.introspection._connection_matches_pid')
48+ @patch('autopilot.introspection._bus_pid_is_our_pid')
49+ def test_connection_matches_pid_ignores_dbus_daemon(
50+ self, bus_pid_is_our_pid, conn_matches_pid_fn):
51+ _connection_matches_pid(SessionBus(), 'org.freedesktop.DBus', 123)
52+
53+ self.assertThat(bus_pid_is_our_pid.called, Equals(False))
54+ self.assertThat(conn_matches_pid_fn.called, Equals(False))

Subscribers

People subscribed via source and target branches

to all changes: