Merge lp:~cprov/adt-cloud-worker/test-git-access into lp:adt-cloud-worker

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: 44
Merged at revision: 45
Proposed branch: lp:~cprov/adt-cloud-worker/test-git-access
Merge into: lp:adt-cloud-worker
Diff against target: 54 lines (+19/-7)
2 files modified
dep8/debian/tests/control (+2/-2)
dep8/tests/test_proxy.py (+17/-5)
To merge this branch: bzr merge lp:~cprov/adt-cloud-worker/test-git-access
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+257883@code.launchpad.net

Commit message

Updating `uci-nova` dogfood-tests to check for git://kernel.ubuntu.com access.

Description of the change

Updating `uci-nova` dogfood-tests to check for git://kernel.ubuntu.com access (tcp:9418, instead of http).

Adding network access timeout for failing tests faster in case of problems.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Confirm it works on bootstack with the proxy cprov set up. Looks fine to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dep8/debian/tests/control'
2--- dep8/debian/tests/control 2015-04-29 04:44:49 +0000
3+++ dep8/debian/tests/control 2015-04-30 13:02:02 +0000
4@@ -1,3 +1,3 @@
5-Test-Command: python3 -m unittest tests
6+Test-Command: python3 -m unittest -v tests
7 Restrictions: allow-stderr
8-Depends: python3, python3-requests
9+Depends: python3, python3-requests, git
10
11=== modified file 'dep8/tests/test_proxy.py'
12--- dep8/tests/test_proxy.py 2015-04-29 04:44:49 +0000
13+++ dep8/tests/test_proxy.py 2015-04-30 13:02:02 +0000
14@@ -19,6 +19,7 @@
15 """Tests for 'uci-nova' testbed proxy setup."""
16
17 import requests
18+import subprocess
19 import unittest
20
21
22@@ -26,8 +27,11 @@
23
24 def assertAccess(self, url):
25 """Assert given url is accessible (HTTP 200)."""
26- r = requests.get(url, headers={'Connection': 'close'})
27- self.assertEqual(requests.codes.ok, r.status_code)
28+ r = requests.get(url, headers={'Connection': 'close'}, timeout=5)
29+ self.assertEqual(
30+ requests.codes.ok, r.status_code,
31+ "Failed to access {}".format(url)
32+ )
33
34 def test_unity_firefox_extension(self):
35 # 'unity-firefox-extension' test requires pypi for installing mozmill.
36@@ -38,9 +42,17 @@
37 self.assertAccess('http://keyserver.ubuntu.com')
38
39 def test_linux(self):
40- # 'linux' test requires access to kernel.ubuntu.com and a specific
41- # github project (patch).
42- self.assertAccess('http://kernel.ubuntu.com')
43+ # 'linux' test requires git access (tcp:9418) to kernel.ubuntu.com
44+ # and a specific github (https) projet for patching.
45+ exit_code = subprocess.call(
46+ ['git', 'ls-remote',
47+ 'git://kernel.ubuntu.com/ubuntu/kernel-testing.git'],
48+ stdout=subprocess.DEVNULL,
49+ stderr=subprocess.DEVNULL,
50+ timeout=5,
51+ )
52+ self.assertEqual(
53+ 0, exit_code, "Failed to access git://kernel.ubuntu.org")
54 self.assertAccess('https://github.com/redpig/seccomp')
55
56

Subscribers

People subscribed via source and target branches