summaryrefslogtreecommitdiff
path: root/tests/cloud_tests/testcases/modules
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-03-16 13:43:31 -0600
committerChad Smith <chad.smith@canonical.com>2018-03-16 13:43:31 -0600
commita1f678f8ebc080d4737f32275f42947b84ae025a (patch)
tree945466e84c4b602de1f1f2b696d43f0d89cb6941 /tests/cloud_tests/testcases/modules
parent95bb226921b8075ca9f65a9d2b672a3e342498b7 (diff)
downloadvyos-cloud-init-a1f678f8ebc080d4737f32275f42947b84ae025a.tar.gz
vyos-cloud-init-a1f678f8ebc080d4737f32275f42947b84ae025a.zip
cc_snap: Add new module to install and configure snapd and snap packages.
Support installing and configuring snaps on ubuntu systems. Now, cloud-config files can provide a list or dictionary of snap:assertions which will be allow configuration of snapd on a system via 'snap ack' calls. The snap:commands configuration option supports arbitrary system commands intended to interact with snappy's cli. This allows users to run arbitrary snappy commands to create users, download, install and configure snap packages and snapd. This branch also deprecates old snappy and snap_config modules leaving warnings in documentation and runtime for consumers of these modules. Deprecated snap* modules will be dropped in cloud-init v.18.2 release.
Diffstat (limited to 'tests/cloud_tests/testcases/modules')
-rw-r--r--tests/cloud_tests/testcases/modules/snap.py16
-rw-r--r--tests/cloud_tests/testcases/modules/snap.yaml18
-rw-r--r--tests/cloud_tests/testcases/modules/snappy.py2
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/cloud_tests/testcases/modules/snap.py b/tests/cloud_tests/testcases/modules/snap.py
new file mode 100644
index 00000000..ff68abbe
--- /dev/null
+++ b/tests/cloud_tests/testcases/modules/snap.py
@@ -0,0 +1,16 @@
+# This file is part of cloud-init. See LICENSE file for license information.
+
+"""cloud-init Integration Test Verify Script"""
+from tests.cloud_tests.testcases import base
+
+
+class TestSnap(base.CloudTestCase):
+ """Test snap module"""
+
+ def test_snappy_version(self):
+ """Expect hello-world and core snaps are installed."""
+ out = self.get_data_file('snaplist')
+ self.assertIn('core', out)
+ self.assertIn('hello-world', out)
+
+# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/snap.yaml b/tests/cloud_tests/testcases/modules/snap.yaml
new file mode 100644
index 00000000..44043f31
--- /dev/null
+++ b/tests/cloud_tests/testcases/modules/snap.yaml
@@ -0,0 +1,18 @@
+#
+# Install snappy
+#
+required_features:
+ - snap
+cloud_config: |
+ #cloud-config
+ package_update: true
+ snap:
+ squashfuse_in_container: true
+ commands:
+ - snap install hello-world
+collect_scripts:
+ snaplist: |
+ #!/bin/bash
+ snap list
+
+# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/snappy.py b/tests/cloud_tests/testcases/modules/snappy.py
index b92271c1..7d17fc5b 100644
--- a/tests/cloud_tests/testcases/modules/snappy.py
+++ b/tests/cloud_tests/testcases/modules/snappy.py
@@ -7,6 +7,8 @@ from tests.cloud_tests.testcases import base
class TestSnappy(base.CloudTestCase):
"""Test snappy module"""
+ expected_warnings = ('DEPRECATION',)
+
def test_snappy_version(self):
"""Test snappy version output"""
out = self.get_data_file('snapd')