From df24daa833d7eb88e7c172eb5d7f257766adb0e3 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 8 Jan 2018 09:43:44 -0800 Subject: tests: update apt sources list test Due to additional platforms getting added this test was not taking into account platform specific mirrors nor was it checking that no additional entries were added. --- tests/cloud_tests/testcases/modules/apt_configure_sources_list.py | 5 +++++ tests/cloud_tests/testcases/modules/apt_configure_sources_list.yaml | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'tests/cloud_tests') diff --git a/tests/cloud_tests/testcases/modules/apt_configure_sources_list.py b/tests/cloud_tests/testcases/modules/apt_configure_sources_list.py index 129d2264..cf84e056 100644 --- a/tests/cloud_tests/testcases/modules/apt_configure_sources_list.py +++ b/tests/cloud_tests/testcases/modules/apt_configure_sources_list.py @@ -10,6 +10,11 @@ class TestAptconfigureSourcesList(base.CloudTestCase): def test_sources_list(self): """Test sources.list includes sources.""" out = self.get_data_file('sources.list') + + # Verify we have 6 entires + self.assertEqual(6, len(out.rstrip().split('\n'))) + + # Verify the keys generated the list correctly self.assertRegex(out, r'deb http:\/\/archive.ubuntu.com\/ubuntu ' '[a-z].* main restricted') self.assertRegex(out, r'deb-src http:\/\/archive.ubuntu.com\/ubuntu ' diff --git a/tests/cloud_tests/testcases/modules/apt_configure_sources_list.yaml b/tests/cloud_tests/testcases/modules/apt_configure_sources_list.yaml index 143cb080..87e470c1 100644 --- a/tests/cloud_tests/testcases/modules/apt_configure_sources_list.yaml +++ b/tests/cloud_tests/testcases/modules/apt_configure_sources_list.yaml @@ -7,6 +7,12 @@ required_features: cloud_config: | #cloud-config apt: + primary: + - arches: [default] + uri: http://archive.ubuntu.com/ubuntu + security: + - arches: [default] + uri: http://security.ubuntu.com/ubuntu sources_list: | deb $MIRROR $RELEASE main restricted deb-src $MIRROR $RELEASE main restricted -- cgit v1.2.3