| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import dbus | 6 import dbus |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 _FLIMFLAM_PATH = 'org.chromium.flimflam' | 25 _FLIMFLAM_PATH = 'org.chromium.flimflam' |
| 26 | 26 |
| 27 def setUp(self): | 27 def setUp(self): |
| 28 self.CleanupFlimflamDirsOnChromeOS() | 28 self.CleanupFlimflamDirsOnChromeOS() |
| 29 # Move ethernet to the end of the flimflam priority list, | 29 # Move ethernet to the end of the flimflam priority list, |
| 30 # effectively hiding any ssh connections that the | 30 # effectively hiding any ssh connections that the |
| 31 # test harness might be using and putting wifi ahead. | 31 # test harness might be using and putting wifi ahead. |
| 32 self._PushServiceOrder('wifi,ethernet') | 32 self._PushServiceOrder('wifi,ethernet') |
| 33 self._ParseDefaultRoutingTable() | 33 self._ParseDefaultRoutingTable() |
| 34 pyauto.PyUITest.setUp(self) | 34 pyauto.PyUITest.setUp(self) |
| 35 self.ForgetAllRememberedNetworks() | |
| 36 | 35 |
| 37 def tearDown(self): | 36 def tearDown(self): |
| 38 self.ForgetAllRememberedNetworks() | |
| 39 pyauto.PyUITest.tearDown(self) | 37 pyauto.PyUITest.tearDown(self) |
| 40 self._PopServiceOrder() | 38 self._PopServiceOrder() |
| 41 # Remove the route entry for the power strip. | 39 # Remove the route entry for the power strip. |
| 42 if hasattr(self, 'ps_route_entry'): | 40 if hasattr(self, 'ps_route_entry'): |
| 43 os.system('route del -net %(ipaddress)s gateway %(gateway)s netmask ' | 41 os.system('route del -net %(ipaddress)s gateway %(gateway)s netmask ' |
| 44 '%(netmask)s dev %(iface)s' % self.ps_route_entry) | 42 '%(netmask)s dev %(iface)s' % self.ps_route_entry) |
| 45 | 43 |
| 46 def _GetFlimflamManager(self): | 44 def _GetFlimflamManager(self): |
| 47 _proxy = dbus.SystemBus().get_object(self._FLIMFLAM_PATH, '/') | 45 _proxy = dbus.SystemBus().get_object(self._FLIMFLAM_PATH, '/') |
| 48 return dbus.Interface(_proxy, self._FLIMFLAM_PATH + '.Manager') | 46 return dbus.Interface(_proxy, self._FLIMFLAM_PATH + '.Manager') |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 old_service_order = self._old_service_order.split(',') | 91 old_service_order = self._old_service_order.split(',') |
| 94 set_service_order = self._GetFlimflamManager().GetServiceOrder().split(',') | 92 set_service_order = self._GetFlimflamManager().GetServiceOrder().split(',') |
| 95 common_service = set(old_service_order) & set(set_service_order) | 93 common_service = set(old_service_order) & set(set_service_order) |
| 96 | 94 |
| 97 old_service_order = [s for s in old_service_order if s in common_service] | 95 old_service_order = [s for s in old_service_order if s in common_service] |
| 98 set_service_order = [s for s in set_service_order if s in common_service] | 96 set_service_order = [s for s in set_service_order if s in common_service] |
| 99 | 97 |
| 100 assert old_service_order == set_service_order, \ | 98 assert old_service_order == set_service_order, \ |
| 101 'Flimflam service order not set properly. %s != %s' % \ | 99 'Flimflam service order not set properly. %s != %s' % \ |
| 102 (old_service_order, set_service_order) | 100 (old_service_order, set_service_order) |
| OLD | NEW |