Merge ~powersj/cloud-init:fix-integration-snappy into cloud-init:master

Proposed by Joshua Powers on 2017-05-22
Status: Merged
Approved by: Scott Moser on 2017-05-23
Approved revision: b6c5ed3b04a00bba7e49ebb58947926b4f121e88
Merged at revision: 06a7f0afc4db3f8ba2a6b3b521274ee45a028ef2
Proposed branch: ~powersj/cloud-init:fix-integration-snappy
Merge into: cloud-init:master
Diff against target: 32 lines (+4/-7)
2 files modified
tests/cloud_tests/configs/modules/snappy.yaml (+2/-2)
tests/cloud_tests/testcases/modules/snappy.py (+2/-5)
Reviewer Review Type Date Requested Status
Scott Moser 2017-05-22 Approve on 2017-05-23
Server Team CI bot continuous-integration Approve on 2017-05-23
Review via email: mp+324430@code.launchpad.net

Commit Message

tests: Fix snapd test case for non-started service

Snapd does not start on artful or on the versions in proposed. This
changes the behavior of the test to confirm that snapd is installed, not
that it is started, while the snap team fixes the issue.

LP: #1690880

To post a comment you must log in.
Ryan Harper (raharper) wrote :

Hrm, do we have a release-based (or even version-based) check here?
Presumable older images with snapd working/starting would continue to work.
Can we instead examine the installed version (via os's package system) and
infer the behavior? Or split this into two tests. one (is it installed) and then if it's installed to also check versions (ie, do we expect this to get fixed or is it an expected change in behavior?)

Joshua Powers (powersj) wrote :

We could have a version-based check, however the version that breaks this, 2.26, is in proposed and about to migrate to all supported releases at any day. I certainly expect this to be fixed unless someone tells me that what we are doing (e.g. running snapd in a container) isn't allowed.

My original intent with the test was to confirm that "system_snappy: auto" works by setting up and install snapd on the target system and using 'snap --version' seemed like the best method to confirm that is installed. However, this bug has shown that the output of --version changes based on whether snapd is even running.

Thoughts?

b6c5ed3... by Joshua Powers on 2017-05-23

Change focus of the test

The test will not determine if the snapd package is installed
correctly versus expecting certain output from the --version
option.

Joshua Powers (powersj) wrote :

Updated the test content to check that snapd is installed using dpkg output rather than relying on --version output.

Scott Moser (smoser) wrote :

I'll pull this for now with a slight modification of the commit message.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/configs/modules/snappy.yaml b/tests/cloud_tests/configs/modules/snappy.yaml
2index 923bfe1..0e7dc85 100644
3--- a/tests/cloud_tests/configs/modules/snappy.yaml
4+++ b/tests/cloud_tests/configs/modules/snappy.yaml
5@@ -6,8 +6,8 @@ cloud_config: |
6 snappy:
7 system_snappy: auto
8 collect_scripts:
9- snap_version: |
10+ snapd: |
11 #!/bin/bash
12- snap --version
13+ dpkg -s snapd
14
15 # vi: ts=4 expandtab
16diff --git a/tests/cloud_tests/testcases/modules/snappy.py b/tests/cloud_tests/testcases/modules/snappy.py
17index 3e2f592..b92271c 100644
18--- a/tests/cloud_tests/testcases/modules/snappy.py
19+++ b/tests/cloud_tests/testcases/modules/snappy.py
20@@ -9,10 +9,7 @@ class TestSnappy(base.CloudTestCase):
21
22 def test_snappy_version(self):
23 """Test snappy version output"""
24- out = self.get_data_file('snap_version')
25- self.assertIn('snap ', out)
26- self.assertIn('snapd ', out)
27- self.assertIn('series ', out)
28- self.assertIn('ubuntu ', out)
29+ out = self.get_data_file('snapd')
30+ self.assertIn('Status: install ok installed', out)
31
32 # vi: ts=4 expandtab

Subscribers

People subscribed via source and target branches