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
=== modified file 'dep8/debian/tests/control'
--- dep8/debian/tests/control 2015-04-29 04:44:49 +0000
+++ dep8/debian/tests/control 2015-04-30 13:02:02 +0000
@@ -1,3 +1,3 @@
1Test-Command: python3 -m unittest tests1Test-Command: python3 -m unittest -v tests
2Restrictions: allow-stderr2Restrictions: allow-stderr
3Depends: python3, python3-requests3Depends: python3, python3-requests, git
44
=== modified file 'dep8/tests/test_proxy.py'
--- dep8/tests/test_proxy.py 2015-04-29 04:44:49 +0000
+++ dep8/tests/test_proxy.py 2015-04-30 13:02:02 +0000
@@ -19,6 +19,7 @@
19"""Tests for 'uci-nova' testbed proxy setup."""19"""Tests for 'uci-nova' testbed proxy setup."""
2020
21import requests21import requests
22import subprocess
22import unittest23import unittest
2324
2425
@@ -26,8 +27,11 @@
2627
27 def assertAccess(self, url):28 def assertAccess(self, url):
28 """Assert given url is accessible (HTTP 200)."""29 """Assert given url is accessible (HTTP 200)."""
29 r = requests.get(url, headers={'Connection': 'close'})30 r = requests.get(url, headers={'Connection': 'close'}, timeout=5)
30 self.assertEqual(requests.codes.ok, r.status_code)31 self.assertEqual(
32 requests.codes.ok, r.status_code,
33 "Failed to access {}".format(url)
34 )
3135
32 def test_unity_firefox_extension(self):36 def test_unity_firefox_extension(self):
33 # 'unity-firefox-extension' test requires pypi for installing mozmill.37 # 'unity-firefox-extension' test requires pypi for installing mozmill.
@@ -38,9 +42,17 @@
38 self.assertAccess('http://keyserver.ubuntu.com')42 self.assertAccess('http://keyserver.ubuntu.com')
3943
40 def test_linux(self):44 def test_linux(self):
41 # 'linux' test requires access to kernel.ubuntu.com and a specific45 # 'linux' test requires git access (tcp:9418) to kernel.ubuntu.com
42 # github project (patch).46 # and a specific github (https) projet for patching.
43 self.assertAccess('http://kernel.ubuntu.com')47 exit_code = subprocess.call(
48 ['git', 'ls-remote',
49 'git://kernel.ubuntu.com/ubuntu/kernel-testing.git'],
50 stdout=subprocess.DEVNULL,
51 stderr=subprocess.DEVNULL,
52 timeout=5,
53 )
54 self.assertEqual(
55 0, exit_code, "Failed to access git://kernel.ubuntu.org")
44 self.assertAccess('https://github.com/redpig/seccomp')56 self.assertAccess('https://github.com/redpig/seccomp')
4557
4658

Subscribers

People subscribed via source and target branches