diff options
author | dermotbradley <dermot_bradley@yahoo.com> | 2020-08-20 00:18:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-19 18:18:25 -0500 |
commit | 79a8ce7e714ae1686c10bff77612eab0f6eccc95 (patch) | |
tree | 5bf05e746bb91f6a21bd549a1fc579d2c9cd1940 /tests/unittests/test_handler/test_handler_ca_certs.py | |
parent | b749548a9eb43b34cce64f8688107645411abc8c (diff) | |
download | vyos-cloud-init-79a8ce7e714ae1686c10bff77612eab0f6eccc95.tar.gz vyos-cloud-init-79a8ce7e714ae1686c10bff77612eab0f6eccc95.zip |
Add Alpine Linux support. (#535)
Add new module cc_apk_configure for creating Alpine /etc/apk/repositories file.
Modify cc_ca_certs, cc_ntp, cc_power_state_change, and cc_resolv_conf for Alpine.
Add Alpine template files for Chrony and Busybox NTP support.
Add Alpine template file for /etc/hosts.
Diffstat (limited to 'tests/unittests/test_handler/test_handler_ca_certs.py')
-rw-r--r-- | tests/unittests/test_handler/test_handler_ca_certs.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unittests/test_handler/test_handler_ca_certs.py b/tests/unittests/test_handler/test_handler_ca_certs.py index c1aff181..e74a0a08 100644 --- a/tests/unittests/test_handler/test_handler_ca_certs.py +++ b/tests/unittests/test_handler/test_handler_ca_certs.py @@ -1,6 +1,7 @@ # This file is part of cloud-init. See LICENSE file for license information. from cloudinit import cloud +from cloudinit import distros from cloudinit.config import cc_ca_certs from cloudinit import helpers from cloudinit import subp @@ -46,8 +47,9 @@ class TestConfig(TestCase): def setUp(self): super(TestConfig, self).setUp() self.name = "ca-certs" + distro = self._fetch_distro('ubuntu') self.paths = None - self.cloud = cloud.Cloud(None, self.paths, None, None, None) + self.cloud = cloud.Cloud(None, self.paths, None, distro, None) self.log = logging.getLogger("TestNoConfig") self.args = [] @@ -62,6 +64,11 @@ class TestConfig(TestCase): self.mock_remove = self.mocks.enter_context( mock.patch.object(cc_ca_certs, 'remove_default_ca_certs')) + def _fetch_distro(self, kind): + cls = distros.fetch(kind) + paths = helpers.Paths({}) + return cls(kind, {}, paths) + def test_no_trusted_list(self): """ Test that no certificates are written if the 'trusted' key is not @@ -275,7 +282,7 @@ class TestRemoveDefaultCaCerts(TestCase): mock.patch.object(util, 'write_file')) mock_subp = mocks.enter_context(mock.patch.object(subp, 'subp')) - cc_ca_certs.remove_default_ca_certs() + cc_ca_certs.remove_default_ca_certs('ubuntu') mock_delete.assert_has_calls([ mock.call("/usr/share/ca-certificates/"), |