summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2019-08-19 21:37:29 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-08-19 21:37:29 +0000
commit85878703e80f536168bcf86cc6444f7aba44cdc3 (patch)
tree9358683804949cd5d48a569aaa986e3b3f20107b /tests/unittests/test_handler
parent2c52e6e88b19f5db8d55eb7280ee27703e05d75f (diff)
downloadvyos-cloud-init-85878703e80f536168bcf86cc6444f7aba44cdc3.tar.gz
vyos-cloud-init-85878703e80f536168bcf86cc6444f7aba44cdc3.zip
ubuntu-drivers: emit latelink=true debconf to accept nvidia eula
To accept NVIDIA EULA, cloud-init needs to emit latelink=true debconf setting to the linux-restricted-modules package to allow NVIDIA drivers to properly link to the running kernel. LP: #1840080
Diffstat (limited to 'tests/unittests/test_handler')
-rw-r--r--tests/unittests/test_handler/test_handler_apt_source_v3.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_source_v3.py b/tests/unittests/test_handler/test_handler_apt_source_v3.py
index 90fe6eed..2f21b6dc 100644
--- a/tests/unittests/test_handler/test_handler_apt_source_v3.py
+++ b/tests/unittests/test_handler/test_handler_apt_source_v3.py
@@ -998,6 +998,17 @@ deb http://ubuntu.com/ubuntu/ xenial-proposed main""")
class TestDebconfSelections(TestCase):
+ @mock.patch("cloudinit.config.cc_apt_configure.util.subp")
+ def test_set_sel_appends_newline_if_absent(self, m_subp):
+ """Automatically append a newline to debconf-set-selections config."""
+ selections = b'some/setting boolean true'
+ cc_apt_configure.debconf_set_selections(selections=selections)
+ cc_apt_configure.debconf_set_selections(selections=selections + b'\n')
+ m_call = mock.call(
+ ['debconf-set-selections'], data=selections + b'\n', capture=True,
+ target=None)
+ self.assertEqual([m_call, m_call], m_subp.call_args_list)
+
@mock.patch("cloudinit.config.cc_apt_configure.debconf_set_selections")
def test_no_set_sel_if_none_to_set(self, m_set_sel):
cc_apt_configure.apply_debconf_selections({'foo': 'bar'})