Merge lp:~dobey/ubuntu-sso-client/update-3-0 into lp:ubuntu-sso-client/stable-3-0

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 840
Merged at revision: 840
Proposed branch: lp:~dobey/ubuntu-sso-client/update-3-0
Merge into: lp:ubuntu-sso-client/stable-3-0
Diff against target: 204 lines (+93/-8)
8 files modified
ubuntu_sso/gtk/gui.py (+18/-0)
ubuntu_sso/gtk/tests/test_gui.py (+7/-0)
ubuntu_sso/main/linux.py (+6/-1)
ubuntu_sso/main/tests/test_linux.py (+59/-0)
ubuntu_sso/qt/current_user_sign_in_page.py (+1/-3)
ubuntu_sso/qt/setup_account_page.py (+0/-1)
ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+1/-1)
ubuntu_sso/qt/tests/test_setup_account.py (+1/-2)
To merge this branch: bzr merge lp:~dobey/ubuntu-sso-client/update-3-0
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Brian Curtin (community) Approve
Review via email: mp+110177@code.launchpad.net

Commit message

[Rodney Dawes]

    Ensure we are using strict ssl with the system ca-certificates.crt file
    Trap DBusException when getting the SessionBus, and add a test case for it

[Roberto Alsina]

    Remove back buttons in signin/signup pages (Fixes LP:1009107).

To post a comment you must log in.
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~dobey/ubuntu-sso-client/update-3-0 into lp:ubuntu-sso-client/stable-3-0 failed. Below is the output from the failed tests.

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (155.1 KiB)

The attempt to merge lp:~dobey/ubuntu-sso-client/update-3-0 into lp:ubuntu-sso-client/stable-3-0 failed. Below is the output from the failed tests.

*** Running GTK test suite for ubuntu_sso ***
ubuntu_sso.utils.tests.test_parse_args
  ParseArgsTestCase
    test_parse_args_app_name_is_required ... [OK]
    test_parse_args_defaults ... [OK]
    test_parse_args_help_text ... [OK]
    test_parse_args_login_only ... [OK]
    test_parse_args_ping_url ... [OK]
    test_parse_args_policy_url ... [OK]
    test_parse_args_tc_url ... [OK]
    test_parse_args_window_id ... [OK]
twisted.trial.unittest
  TestCase
    runTest ... [OK]
ubuntu_sso.utils.tests.test_tcpactivation
  ActivationClientTestCase
    test_do_get_active_port_not_running ... [OK]
    test_do_get_active_port_running ... [OK]
    test_get_active_port_waits_classwide ... [OK]
    test_initialization ... [OK]
    test_spawn_server ... [OK]
    test_wait_server_active ... [OK]
    test_wait_server_timeouts ... [OK]
  ActivationConfigTestCase
    test_initialization ... [OK]
  ActivationDetectorTestCase
    test_initialization ... [OK]
    test_is_already_running ... [OK]
    test_is_not_already_running ... [OK]
  ActivationInstanceTestCase
    test_get_port ... [OK]
    test_get_port_fails_if_service_already_started ... [OK]
    test_initialization ... [OK]
  AsyncSleepTestCase
    test_async_sleep_fired_at_the_right_time ... [OK]
    test_async_sleep_not_fired_immediately ... [OK]
    test_async_sleep_not_fired_in_a_bit ... [OK]
  NullProtocolTestCase
    test_drops_connection ... [OK]
  PortDetectFactoryTestCase
    test_connection_failed ... [OK]
    test_connection_failed_then_lost ... [OK]
    test_connection_lost ... [OK]
    test_connection_works_then_lost ... [OK]
    test_is_listening ... [OK]
twisted.trial.unittest
  TestCase
    runTest ... [OK]
ubuntu_sso.u...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu_sso/gtk/gui.py'
--- ubuntu_sso/gtk/gui.py 2012-04-11 16:49:02 +0000
+++ ubuntu_sso/gtk/gui.py 2012-06-13 21:37:18 +0000
@@ -109,6 +109,12 @@
109LARGE_MARKUP = u'<span size="x-large">%s</span>'109LARGE_MARKUP = u'<span size="x-large">%s</span>'
110110
111111
112# SSL properties and certs location
113STRICT_SSL_PROP = 'ssl-strict'
114CERTS_FILE_PROP = 'ssl-ca-file'
115CA_CERT_FILE = '/etc/ssl/certs/ca-certificates.crt'
116
117
112def log_call(f):118def log_call(f):
113 """Decorator to log call funtions."""119 """Decorator to log call funtions."""
114120
@@ -953,11 +959,23 @@
953959
954 self._set_current_page(self.processing_vbox)960 self._set_current_page(self.processing_vbox)
955961
962 def _webkit_init_ssl(self):
963 """Set the WebKit ssl strictness."""
964 # delay the import of webkit to be able to build without it
965 from gi.repository import WebKit # pylint: disable=E0611
966
967 # Set the Soup session to be strict and use system CA certs
968 session = WebKit.get_default_session()
969 session.set_property(STRICT_SSL_PROP, True)
970 session.set_property(CERTS_FILE_PROP, CA_CERT_FILE)
971
956 def _add_webkit_browser(self):972 def _add_webkit_browser(self):
957 """Add the webkit browser for the t&c."""973 """Add the webkit browser for the t&c."""
958 # delay the import of webkit to be able to build without it974 # delay the import of webkit to be able to build without it
959 from gi.repository import WebKit # pylint: disable=E0611975 from gi.repository import WebKit # pylint: disable=E0611
960976
977 self._webkit_init_ssl()
978
961 browser = WebKit.WebView()979 browser = WebKit.WebView()
962980
963 browser.connect('notify::load-status',981 browser.connect('notify::load-status',
964982
=== modified file 'ubuntu_sso/gtk/tests/test_gui.py'
--- ubuntu_sso/gtk/tests/test_gui.py 2012-04-11 16:49:02 +0000
+++ ubuntu_sso/gtk/tests/test_gui.py 2012-06-13 21:37:18 +0000
@@ -911,6 +911,7 @@
911 def setUp(self):911 def setUp(self):
912 yield super(TermsAndConditionsBrowserTestCase, self).setUp()912 yield super(TermsAndConditionsBrowserTestCase, self).setUp()
913 self.patch(WebKit, 'WebView', FakedEmbeddedBrowser)913 self.patch(WebKit, 'WebView', FakedEmbeddedBrowser)
914 self.patch(self.ui, '_webkit_init_ssl', self._set_called)
914915
915 self.ui.tc_button.clicked()916 self.ui.tc_button.clicked()
916 self.addCleanup(self.ui.tc_browser_vbox.hide)917 self.addCleanup(self.ui.tc_browser_vbox.hide)
@@ -919,6 +920,12 @@
919 assert len(children) == 1920 assert len(children) == 1
920 self.browser = children[0]921 self.browser = children[0]
921922
923 def test_ssl_validation(self):
924 """The browser is set to validate SSL."""
925 self.assertEqual(self._called, ((), {}),
926 '_webkit_init_ssl should be called when creating a '
927 'webkit browser.')
928
922 def test_tc_browser_is_created_when_tc_page_is_shown(self):929 def test_tc_browser_is_created_when_tc_page_is_shown(self):
923 """The browser is created when the TC button is clicked."""930 """The browser is created when the TC button is clicked."""
924 self.ui.on_tc_browser_notify_load_status(self.browser)931 self.ui.on_tc_browser_notify_load_status(self.browser)
925932
=== modified file 'ubuntu_sso/main/linux.py'
--- ubuntu_sso/main/linux.py 2012-04-10 17:57:42 +0000
+++ ubuntu_sso/main/linux.py 2012-06-13 21:37:18 +0000
@@ -342,10 +342,15 @@
342342
343 def __init__(self, root):343 def __init__(self, root):
344 self.root = root344 self.root = root
345 self.bus = dbus.SessionBus()
346 self.sso_login = None345 self.sso_login = None
347 self.cred_manager = None346 self.cred_manager = None
348347
348 try:
349 self.bus = dbus.SessionBus()
350 except dbus.service.DBusException as e:
351 logger.exception(e)
352 shutdown_func()
353
349 def start(self):354 def start(self):
350 """Start listening, nothing async to be done in this platform."""355 """Start listening, nothing async to be done in this platform."""
351 # Register DBus service for making sure we run only one instance356 # Register DBus service for making sure we run only one instance
352357
=== added file 'ubuntu_sso/main/tests/test_linux.py'
--- ubuntu_sso/main/tests/test_linux.py 1970-01-01 00:00:00 +0000
+++ ubuntu_sso/main/tests/test_linux.py 2012-06-13 21:37:18 +0000
@@ -0,0 +1,59 @@
1# -*- coding: utf-8 -*-
2#
3# Copyright 2012 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16#
17# In addition, as a special exception, the copyright holders give
18# permission to link the code of portions of this program with the
19# OpenSSL library under certain conditions as described in each
20# individual source file, and distribute linked combinations
21# including the two.
22# You must obey the GNU General Public License in all respects
23# for all of the code used other than OpenSSL. If you modify
24# file(s) with this exception, you may extend this exception to your
25# version of the file(s), but you are not obligated to do so. If you
26# do not wish to do so, delete this exception statement from your
27# version. If you delete this exception statement from all source
28# files in the program, then also delete it here.
29"""Tests for the main SSO Linux client code."""
30
31# pylint: disable=C0103
32do_tests = False
33try:
34 import dbus
35 import dbus.service
36 from ubuntu_sso.main import linux as main
37 do_tests = True
38except ImportError:
39 do_tests = False
40# pylint enable=C0103
41
42from ubuntuone.devtools.testcases import BaseTestCase, skipIf
43
44
45@skipIf(do_tests != True, 'Tests only work with DBus and linux imports.')
46class LinuxProxyTestCase(BaseTestCase):
47 """Test some Linux specific cases."""
48
49 def test_dbus_missing_exists_clean(self):
50 """Test that dbus-daemon not being available gives us a clean exit."""
51 def patched(*args, **kwargs):
52 """Method to patch in for testing."""
53 raise dbus.service.DBusException(
54 'org.freedesktop.DBus.Error.NoServer')
55
56 self.patch(dbus, "SessionBus", patched)
57 self.patch(main, "shutdown_func", patched)
58 self.assertRaises(dbus.service.DBusException,
59 main.UbuntuSSOProxy, None)
060
=== modified file 'ubuntu_sso/qt/current_user_sign_in_page.py'
--- ubuntu_sso/qt/current_user_sign_in_page.py 2012-04-09 17:38:24 +0000
+++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-06-13 21:37:18 +0000
@@ -97,9 +97,7 @@
97 self.setButtonText(QtGui.QWizard.CancelButton, CANCEL_BUTTON)97 self.setButtonText(QtGui.QWizard.CancelButton, CANCEL_BUTTON)
98 # Layout without custom button 1,98 # Layout without custom button 1,
99 # without finish button99 # without finish button
100 self.wizard().setButtonLayout([100 self.wizard().setButtonLayout([])
101 QtGui.QWizard.BackButton,
102 QtGui.QWizard.Stretch])
103101
104 # Set sign_in_button as default when the page is shown.102 # Set sign_in_button as default when the page is shown.
105 self.ui.sign_in_button.setDefault(True)103 self.ui.sign_in_button.setDefault(True)
106104
=== modified file 'ubuntu_sso/qt/setup_account_page.py'
--- ubuntu_sso/qt/setup_account_page.py 2012-04-09 17:38:24 +0000
+++ ubuntu_sso/qt/setup_account_page.py 2012-06-13 21:37:18 +0000
@@ -154,7 +154,6 @@
154154
155 # Button setup155 # Button setup
156 self.wizard().setButtonLayout([156 self.wizard().setButtonLayout([
157 QtGui.QWizard.BackButton,
158 QtGui.QWizard.Stretch,157 QtGui.QWizard.Stretch,
159 QtGui.QWizard.CustomButton3])158 QtGui.QWizard.CustomButton3])
160159
161160
=== modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py'
--- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-04-09 17:38:24 +0000
+++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-06-13 21:37:18 +0000
@@ -59,7 +59,7 @@
59 self.assertEqual(wizard.buttons_text[QtGui.QWizard.CancelButton],59 self.assertEqual(wizard.buttons_text[QtGui.QWizard.CancelButton],
60 "Cancel")60 "Cancel")
61 self.assertIn(('setButtonLayout',61 self.assertIn(('setButtonLayout',
62 (([QtGui.QWizard.BackButton, QtGui.QWizard.Stretch],), {})),62 (([],), {})),
63 wizard.called)63 wizard.called)
64 self.assertTrue(button.properties['default'])64 self.assertTrue(button.properties['default'])
65 self.assertFalse(button.isEnabled())65 self.assertFalse(button.isEnabled())
6666
=== modified file 'ubuntu_sso/qt/tests/test_setup_account.py'
--- ubuntu_sso/qt/tests/test_setup_account.py 2012-04-09 17:38:24 +0000
+++ ubuntu_sso/qt/tests/test_setup_account.py 2012-06-13 21:37:18 +0000
@@ -207,8 +207,7 @@
207 self.ui.initializePage()207 self.ui.initializePage()
208208
209 # set up account button209 # set up account button
210 expected = [QtGui.QWizard.BackButton, QtGui.QWizard.Stretch,210 expected = [QtGui.QWizard.Stretch, QtGui.QWizard.CustomButton3]
211 QtGui.QWizard.CustomButton3]
212 self.assertIn(('setButtonLayout', ((expected,), {})),211 self.assertIn(('setButtonLayout', ((expected,), {})),
213 self.ui.wizard().called)212 self.ui.wizard().called)
214 self.assertEqual(gui.SET_UP_ACCOUNT_BUTTON,213 self.assertEqual(gui.SET_UP_ACCOUNT_BUTTON,

Subscribers

People subscribed via source and target branches

to all changes: