Merge lp:~raharper/curtin/trunk.skip-apt-proxy-test-if-not-set into lp:~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 442
Proposed branch: lp:~raharper/curtin/trunk.skip-apt-proxy-test-if-not-set
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 26 lines (+6/-3)
1 file modified
tests/vmtests/test_old_apt_features.py (+6/-3)
To merge this branch: bzr merge lp:~raharper/curtin/trunk.skip-apt-proxy-test-if-not-set
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+315688@code.launchpad.net

Description of the change

vmtest: skip apt-proxy test if not set

Testing of apt-proxy requires one to be set in the host. If a proxy
is not set then the test-case will fail. This was discovered on diglett
host which usally has an apt-proxy but recently it was disabled which
tripped this failure.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

surprised this lasted this long.
thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/vmtests/test_old_apt_features.py'
2--- tests/vmtests/test_old_apt_features.py 2016-08-05 01:07:26 +0000
3+++ tests/vmtests/test_old_apt_features.py 2017-01-26 15:25:19 +0000
4@@ -41,8 +41,8 @@
5 def test_output_files_exist(self):
6 """test_output_files_exist - Check if all output files exist"""
7 self.output_files_exist(
8- ["debc", "aptconf", "sources.list", "90curtin-aptproxy",
9- "curtin-preserve-sources.cfg", "90_dpkg.cfg"])
10+ ["debc", "aptconf", "sources.list", "curtin-preserve-sources.cfg",
11+ "90_dpkg.cfg"])
12
13 def test_preserve_source(self):
14 """test_preserve_source - no clobbering sources.list by cloud-init"""
15@@ -56,7 +56,10 @@
16 def test_aptconf(self):
17 """test_aptconf - Check if apt conf for proxy is in place"""
18 # this gets configured by tools/launch and get_apt_proxy in
19- # tests/vmtests/__init__.py, so compare with those
20+ # tests/vmtests/__init__.py, so compare with those, if set
21+ if not self.proxy:
22+ self.skipTest('Host apt-proxy not set')
23+ self.output_files_exist(["90curtin-aptproxy"])
24 rproxy = r"Acquire::http::Proxy \"" + re.escape(self.proxy) + r"\";"
25 self.check_file_regex("aptconf", rproxy)
26 self.check_file_regex("90curtin-aptproxy", rproxy)

Subscribers

People subscribed via source and target branches