Merge lp:~mikemc/ubuntu-sso-client/fix-networkstate-darwin into lp:ubuntu-sso-client
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Mike McCracken on 2012-05-25 | ||||
| Approved revision: | 975 | ||||
| Merged at revision: | 961 | ||||
| Proposed branch: | lp:~mikemc/ubuntu-sso-client/fix-networkstate-darwin | ||||
| Merge into: | lp:ubuntu-sso-client | ||||
| Prerequisite: | lp:~mikemc/ubuntu-sso-client/no-darwin-in-linuxnwindows-tests | ||||
| Diff against target: |
630 lines (+514/-68) 4 files modified
ubuntu_sso/networkstate/darwin.py (+269/-61) ubuntu_sso/networkstate/networkstates.py (+13/-7) ubuntu_sso/networkstate/tests/run_nwmgr_standalone.py (+39/-0) ubuntu_sso/networkstate/tests/test_darwin.py (+193/-0) |
||||
| To merge this branch: | bzr merge lp:~mikemc/ubuntu-sso-client/fix-networkstate-darwin | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Diego Sarmentero (community) | 2012-05-16 | Approve on 2012-05-25 | |
| Manuel de la Peña (community) | 2012-05-16 | Approve on 2012-05-23 | |
|
Review via email:
|
|||
Commit Message
- Implement internet connectivity detection in Mac OS X ("darwin") systems ( LP #984667 )
Description of the Change
- Implement internet connectivity detection in Mac OS X ("darwin") systems ( LP #984667 )
Implementation of network detection for darwin, including tests.
Uses a similar approach to the windows module, except instead of checking general internet connectivity, it specifically checks connectivity to one.ubuntu.com.
There's no general "connected" API in OS X, and I'm not sure there should be in Windows.
There are two API entry points:
1. The NetworkManagerState class spawns a separate python thread
for listening for callbacks from the system API, which then calls back
to user code with one of the states defined in
networkstate/
2. The is_machine_
calls the synchronous API to check the current connectivity once.
This branch includes two other changes:
1. run-nwmgr-
isolation. It should be platform-
report on connection status for 60 seconds.
2. networkstates.py now defines ONLINE, OFFLINE, and UNKNOWN as objects with meaningful __repr__s, so that test failure output makes sense.
This branch was marked as dependent on the no-darwin-
- 970. By Mike McCracken on 2012-05-16
-
merge with linux and windows test script branch so you can test this branch on linux and windows
| Mike McCracken (mikemc) wrote : | # |
> When trying to run the tests on linux I get the following import error:
>
> *** Running GTK test suite for ubuntu_sso ***
...snip...
> File "/home/
> darwin/
> CFRunLoopGetCurrent = CoreFoundation.
> File "/usr/lib/
> func = self.__
> File "/usr/lib/
> func = self._FuncPtr(
> AttributeError: /usr/bin/python: undefined symbol: CFRunLoopGetCurrent
>
>
> Probably there is a missing module in the list of ingored modules
It's running the darwin tests. The prerequisite branch fixes this, and I've now merged with that branch with commit 970. Sorry for the inconvenience. I should've used the bzr pipeline plugin, I guess...
| Manuel de la Peña (mandel) wrote : | # |
> > When trying to run the tests on linux I get the following import error:
> >
> > *** Running GTK test suite for ubuntu_sso ***
>
> ...snip...
>
> > File "/home/
> > darwin/
> > CFRunLoopGetCurrent = CoreFoundation.
> > File "/usr/lib/
> > func = self.__
> > File "/usr/lib/
> > func = self._FuncPtr(
> > AttributeError: /usr/bin/python: undefined symbol: CFRunLoopGetCurrent
> >
> >
> > Probably there is a missing module in the list of ingored modules
>
> It's running the darwin tests. The prerequisite branch fixes this, and I've
> now merged with that branch with commit 970. Sorry for the inconvenience. I
> should've used the bzr pipeline plugin, I guess...
No worries about that is a small details. After merging the other branch I get the following lint errors:
ubuntu_
68: [C0301] Line too long (80/79)
253: [C0301] Line too long (81/79)
254: [C0301] Line too long (82/79)
51: [C0103] Invalid name "CoreFoundation
52: [C0103] Invalid name "CoreFoundation" (should match (([A-Z_
55: [C0103] Invalid name "CFRunLoopGetCu
60: [C0103] Invalid name "CFRelease" (should match (([A-Z_
65: [C0103] Invalid name "CFRunLoopRun" (should match (([A-Z_
68: [C0103] Invalid name "kCFRunLoopDefa
68: [E1101] Class 'c_void_p' has no 'in_dll' member
73: [C0103] Invalid name "SystemConfigur
82: [C0103] Invalid name "SCNRCreateWith
87: [C0103] Invalid name "SCNRGetFlags" (should match (([A-Z_
92: [C0103] Invalid name "SCNRScheduleWi
102: [C0103] Invalid name "SCNRCallbackType" (should match (([A-Z_
108: [C0103] Invalid name "SCNRSetCallback" (should match (([A-Z_
115: [C0111, _check_
145: [C0103, flags_say_
146: [C0103, flags_say_
270: [W0612, NetworkManagerS
282: [W0703, is_machine_
23: [W0611] Unused import NM_STATE_
30: [W0611] Unused import NM_STATE_
23: [W0611] Unused import NM_STATE_
23: [W0611] Unused import NM_STATE_
ubuntu_
18: [C0111, NetworkState] Missing docstrin...
- 971. By Mike McCracken on 2012-05-17
-
fix dumb typo in tests that are only run on darwin
- 972. By Mike McCracken on 2012-05-18
-
Fix lint and pep8 complaints, improve some names and docstrings
- 973. By Mike McCracken on 2012-05-18
-
fix whitespace in blank lines that darwin lint didn't notice
- 974. By Mike McCracken on 2012-05-19
-
fixing yet another pep8 complaint missed by pep8 on darwin
| Manuel de la Peña (mandel) wrote : | # |
Can you fix the following details:
* if target == None: => if target is None
* if ok == False: => if not ok:
* if check_connected
* self.assertEqua
* self.assertEqua
* from ubuntu_
Tests and lint checks pass, please let me know when I can take another look.
- 975. By Mike McCracken on 2012-05-21
-
style fixes

When trying to run the tests on linux I get the following import error:
*** Running GTK test suite for ubuntu_sso *** bin/u1trial" , line 325, in <module> bin/u1trial" , line 305, in main get_suite( config) bin/u1trial" , line 184, in get_suite 'ignore- paths'] )) bin/u1trial" , line 168, in _collect_tests unittest( filepath) bin/u1trial" , line 108, in _load_unittest mandel/ Projects/ Canonical/ ubuntu- sso-client/ fix-networkstat e-darwin/ ubuntu_ sso/networkstat e/tests/ test_darwin. py", line 37, in <module> sso.networkstat e import ( mandel/ Projects/ Canonical/ ubuntu- sso-client/ fix-networkstat e-darwin/ ubuntu_ sso/networkstat e/darwin. py", line 55, in <module> tCurrent = CoreFoundation. CFRunLoopGetCur rent python2. 7/ctypes/ __init_ _.py", line 378, in __getattr__ getitem_ _(name) python2. 7/ctypes/ __init_ _.py", line 383, in __getitem__ (name_or_ ordinal, self))
Traceback (most recent call last):
File "/usr/local/
main()
File "/usr/local/
suite = trial_runner.
File "/usr/local/
config[
File "/usr/local/
module_suite = self._load_
File "/usr/local/
module = __import__(modpath, None, None, [""])
File "/home/
from ubuntu_
File "/home/
CFRunLoopGe
File "/usr/lib/
func = self.__
File "/usr/lib/
func = self._FuncPtr(
AttributeError: /usr/bin/python: undefined symbol: CFRunLoopGetCurrent
Probably there is a missing module in the list of ingored modules