Merge ~powersj/cloud-init:cii-fix-kvm-tests into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Merge reported by: Scott Moser
Merged at revision: 13e29b79db4efc46db725a793a3840b8832149c9
Proposed branch: ~powersj/cloud-init:cii-fix-kvm-tests
Merge into: cloud-init:master
Diff against target: 410 lines (+46/-75)
19 files modified
tests/cloud_tests/instances/base.py (+4/-1)
tests/cloud_tests/instances/nocloudkvm.py (+1/-1)
tests/cloud_tests/testcases/examples/run_commands.yaml (+2/-2)
tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml (+9/-10)
tests/cloud_tests/testcases/modules/keys_to_console.py (+4/-4)
tests/cloud_tests/testcases/modules/runcmd.yaml (+2/-2)
tests/cloud_tests/testcases/modules/seed_random_command.yaml (+2/-2)
tests/cloud_tests/testcases/modules/seed_random_data.yaml (+2/-2)
tests/cloud_tests/testcases/modules/set_password_expire.py (+1/-1)
tests/cloud_tests/testcases/modules/set_password_expire.yaml (+2/-0)
tests/cloud_tests/testcases/modules/set_password_list.yaml (+1/-0)
tests/cloud_tests/testcases/modules/set_password_list_string.yaml (+1/-0)
tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py (+0/-8)
tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml (+0/-1)
tests/cloud_tests/testcases/modules/ssh_keys_generate.py (+0/-5)
tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml (+2/-5)
tests/cloud_tests/testcases/modules/ssh_keys_provided.py (+0/-11)
tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml (+4/-10)
tests/cloud_tests/testcases/modules/write_files.yaml (+9/-10)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Chad Smith Approve
Review via email: mp+331736@code.launchpad.net

Commit message

tests: Enable all tests for nocloud-kvm backend

The original testcases were written using the lxd backend only. This
commit enables the use of the nocloud-kvm backend for all testcases. The
primary changes revolve around 3 areas:

* Ensure all tests execute as root per spec via sudo
* Move from /root to /var/tmp or $HOME - with lxd we login as root by
default, but that is not the case with nocloud-kvm or other backends.
* Update ssh key auth user to not be root and either update or remove a
few key checks.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:f1a66a42318242811556b71e565ce54de2c6e177
https://jenkins.ubuntu.com/server/job/cloud-init-ci/374/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/374/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

probably use of /tmp is dangerous.
maybe not.
https://bugs.launchpad.net/cloud-init/+bug/1707222

Revision history for this message
Chad Smith (chad.smith) :
Revision history for this message
Chad Smith (chad.smith) wrote :

Integration tests nocloud-kvm work well on a fresh artful install when I do the following:
sudo apt install python3-simplestreams ubuntu-cloudimage-keyring
sudo mkdir -i /srv/citest
sudo chown me:me /srv/citest
python3 -m tests.cloud_tests run -p nocloud-kvm --os-name artful --preserve-data -data-dir restults --verbose -deb cloud-init_17.1-14-gfa66a42-1~bddeb_all.deb

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

for tox -e citest to work this branch was missing a rebase I think on master to pull in bzr:lp:simplestreams

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

At first I was not keen on the use of /var/tmp, as I knew that Ubuntu was carrying a patch to systemd upstream for that behavior, and figured that we were really just buying time before someone decided "oh lets remove /var/tmp/ also".

I dug a bit, patch [1] that does this is to fix Debian bug 675422 [2].
That bug references the FHS [3] which at least gives us a reasonable justification for
our use:

| The /var/tmp directory is made available for programs that require
| temporary files or directories that are preserved between system
| reboots. Therefore, data stored in /var/tmp is more persistent than
| data in /tmp.

| Files and directories located in /var/tmp must not be deleted when the
| system is booted. Although data stored in /var/tmp is typically deleted
| in a site-specific manner, it is recommended that deletions occur at a
| less frequent interval than /tmp.

So, it seems sane that /var/tmp can be used.
But for some use cases /run/my-dir is better (in that it is guaranteed
to *not* have stale data across a boot).

[1] https://git.launchpad.net/~usd-import-team/ubuntu/+source/systemd/tree/debian/patches/debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch?h=applied/ubuntu/artful
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675422
[3] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE

Revision history for this message
Scott Moser (smoser) wrote :

With regard to "not logged in as root by default", that is kind of wrong.
Any 'instance.execute()' should assume execution is root. Using something
different would mean that the caller has to adjust their usage based on
the backend being used. That is kind of painful.

lets see if we can't just easily fix that.

Revision history for this message
Joshua Powers (powersj) wrote :

>lets see if we can't just easily fix that.

I looked a little bit at this, particularly at the tests/cloud_tests/instances/base.py:run_script() function.

I think this is better tackled by removing our method of pushing a script and then executing that script and instead of going to your proposed method of specifying what is collected, specifically:

# These files should be collected when we from the running instance
# at the end of boot. Anything ending in a '/' should include
# be recursive.
files:
  - /run/cloud-init/
  - /var/lib/cloud/
  - /etc/passwd

# These are exectuted and the dictionary available to the test results.
collect_scripts:
  hosts: [cat, /etc/hosts]
  ps-a: [ps, -a]

At that point, we can handle the execution of by root then and there.

Thoughts? Is there an easy mechanism I have overlooked?

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:6d9dd0da9b042352b8ad7b40e365f3251288354f
https://jenkins.ubuntu.com/server/job/cloud-init-ci/440/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    FAILED: Ubuntu LTS: Integration

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/440/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:6d9dd0da9b042352b8ad7b40e365f3251288354f
https://jenkins.ubuntu.com/server/job/cloud-init-ci/441/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/441/rebuild

review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:806f48840ef5689c4f1647aac464f09768ec39ce
https://jenkins.ubuntu.com/server/job/cloud-init-ci/444/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/444/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:59d162eecd48079d7a67831b79292c20f1dd3620
https://jenkins.ubuntu.com/server/job/cloud-init-ci/445/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/445/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

tmpfile should look more like this:

    def tmpfile(self):
        path = "/tmp/%s-%04d" % (type(self).__name__, self._tmp_count)
        self._tmp_count += 1
        return path

then we're good.
as is, the tmpfile name never changed, which is kind of not very tmpfile-like

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:6c3c9fc43cd75bb6f1c7fd6a086ef03b952612d6
https://jenkins.ubuntu.com/server/job/cloud-init-ci/448/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/448/rebuild

review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:13e29b79db4efc46db725a793a3840b8832149c9
https://jenkins.ubuntu.com/server/job/cloud-init-ci/451/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/451/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

pushed a branch of mine to
 https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/333059
which takes this and adds.

Revision history for this message
Scott Moser (smoser) wrote :

I've called this merged as my branch went in.
thanks josh.

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/tests/cloud_tests/instances/base.py b/tests/cloud_tests/instances/base.py
index 9bdda60..8f58c69 100644
--- a/tests/cloud_tests/instances/base.py
+++ b/tests/cloud_tests/instances/base.py
@@ -22,6 +22,7 @@ class Instance(object):
22 self.properties = properties22 self.properties = properties
23 self.config = config23 self.config = config
24 self.features = features24 self.features = features
25 self._tmp_count = 0
2526
26 def execute(self, command, stdout=None, stderr=None, env=None,27 def execute(self, command, stdout=None, stderr=None, env=None,
27 rcs=None, description=None):28 rcs=None, description=None):
@@ -97,7 +98,9 @@ class Instance(object):
9798
98 @return_value: path to new file in target99 @return_value: path to new file in target
99 """100 """
100 return self.execute(['mktemp'])[0].strip()101 path = "/tmp/%s-%04d" % (type(self).__name__, self._tmp_count)
102 self._tmp_count += 1
103 return path
101104
102 def console_log(self):105 def console_log(self):
103 """Instance console.106 """Instance console.
diff --git a/tests/cloud_tests/instances/nocloudkvm.py b/tests/cloud_tests/instances/nocloudkvm.py
index 8a0e531..cf5d571 100644
--- a/tests/cloud_tests/instances/nocloudkvm.py
+++ b/tests/cloud_tests/instances/nocloudkvm.py
@@ -76,7 +76,7 @@ class NoCloudKVMInstance(base.Instance):
76 command = ['sh', '-c', command]76 command = ['sh', '-c', command]
7777
78 if self.pid:78 if self.pid:
79 return self.ssh(command)79 return self.ssh(['sudo'] + list(command))
80 else:80 else:
81 return self.mount_image_callback(command) + (0,)81 return self.mount_image_callback(command) + (0,)
8282
diff --git a/tests/cloud_tests/testcases/examples/run_commands.yaml b/tests/cloud_tests/testcases/examples/run_commands.yaml
index b0e311b..f80eb8c 100644
--- a/tests/cloud_tests/testcases/examples/run_commands.yaml
+++ b/tests/cloud_tests/testcases/examples/run_commands.yaml
@@ -7,10 +7,10 @@ enabled: False
7cloud_config: |7cloud_config: |
8 #cloud-config8 #cloud-config
9 runcmd:9 runcmd:
10 - echo cloud-init run cmd test > /tmp/run_cmd10 - echo cloud-init run cmd test > /var/tmp/run_cmd
11collect_scripts:11collect_scripts:
12 run_cmd: |12 run_cmd: |
13 #!/bin/bash13 #!/bin/bash
14 cat /tmp/run_cmd14 cat /var/tmp/run_cmd
1515
16# vi: ts=4 expandtab16# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml b/tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml
index 6f78f99..d5da0ca 100644
--- a/tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml
+++ b/tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml
@@ -9,37 +9,36 @@ cloud_config: |
9 write_files:9 write_files:
10 - encoding: b6410 - encoding: b64
11 content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV411 content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4
12 owner: root:root12 path: /var/tmp/file_b64
13 path: /root/file_b64
14 permissions: '0644'13 permissions: '0644'
15 - content: |14 - content: |
16 # My new /root/file_text15 # My new /var/tmp/file_text
1716
18 SMBDOPTIONS="-D"17 SMBDOPTIONS="-D"
19 path: /root/file_text18 path: /var/tmp/file_text
20 - content: !!binary |19 - content: !!binary |
21 f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAAAAAAAAAEAAOAAI20 f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAAAAAAAAAEAAOAAI
22 AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAADAAQAAAAAAAAgA21 AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAADAAQAAAAAAAAgA
23 AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA22 AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA
24 path: /root/file_binary23 path: /var/tmp/file_binary
25 permissions: '0555'24 permissions: '0555'
26 - encoding: gzip25 - encoding: gzip
27 content: !!binary |26 content: !!binary |
28 H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=27 H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
29 path: /root/file_gzip28 path: /var/tmp/file_gzip
30 permissions: '0755'29 permissions: '0755'
31collect_scripts:30collect_scripts:
32 file_b64: |31 file_b64: |
33 #!/bin/bash32 #!/bin/bash
34 file /root/file_b6433 file /var/tmp/file_b64
35 file_text: |34 file_text: |
36 #!/bin/bash35 #!/bin/bash
37 file /root/file_text36 file /var/tmp/file_text
38 file_binary: |37 file_binary: |
39 #!/bin/bash38 #!/bin/bash
40 file /root/file_binary39 file /var/tmp/file_binary
41 file_gzip: |40 file_gzip: |
42 #!/bin/bash41 #!/bin/bash
43 file /root/file_gzip42 file /var/tmp/file_gzip
4443
45# vi: ts=4 expandtab44# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/keys_to_console.py b/tests/cloud_tests/testcases/modules/keys_to_console.py
index 88b6812..07f3811 100644
--- a/tests/cloud_tests/testcases/modules/keys_to_console.py
+++ b/tests/cloud_tests/testcases/modules/keys_to_console.py
@@ -10,13 +10,13 @@ class TestKeysToConsole(base.CloudTestCase):
10 def test_excluded_keys(self):10 def test_excluded_keys(self):
11 """Test excluded keys missing."""11 """Test excluded keys missing."""
12 out = self.get_data_file('syslog')12 out = self.get_data_file('syslog')
13 self.assertNotIn('DSA', out)13 self.assertNotIn('(DSA)', out)
14 self.assertNotIn('ECDSA', out)14 self.assertNotIn('(ECDSA)', out)
1515
16 def test_expected_keys(self):16 def test_expected_keys(self):
17 """Test expected keys exist."""17 """Test expected keys exist."""
18 out = self.get_data_file('syslog')18 out = self.get_data_file('syslog')
19 self.assertIn('ED25519', out)19 self.assertIn('(ED25519)', out)
20 self.assertIn('RSA', out)20 self.assertIn('(RSA)', out)
2121
22# vi: ts=4 expandtab22# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/runcmd.yaml b/tests/cloud_tests/testcases/modules/runcmd.yaml
index 04e5a05..8309a88 100644
--- a/tests/cloud_tests/testcases/modules/runcmd.yaml
+++ b/tests/cloud_tests/testcases/modules/runcmd.yaml
@@ -4,10 +4,10 @@
4cloud_config: |4cloud_config: |
5 #cloud-config5 #cloud-config
6 runcmd:6 runcmd:
7 - echo cloud-init run cmd test > /tmp/run_cmd7 - echo cloud-init run cmd test > /var/tmp/run_cmd
8collect_scripts:8collect_scripts:
9 run_cmd: |9 run_cmd: |
10 #!/bin/bash10 #!/bin/bash
11 cat /tmp/run_cmd11 cat /var/tmp/run_cmd
1212
13# vi: ts=4 expandtab13# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/seed_random_command.yaml b/tests/cloud_tests/testcases/modules/seed_random_command.yaml
index 6a9157e..a201c0a 100644
--- a/tests/cloud_tests/testcases/modules/seed_random_command.yaml
+++ b/tests/cloud_tests/testcases/modules/seed_random_command.yaml
@@ -9,10 +9,10 @@ cloud_config: |
9 random_seed:9 random_seed:
10 command: ["cat", "/proc/sys/kernel/random/uuid"]10 command: ["cat", "/proc/sys/kernel/random/uuid"]
11 command_required: true11 command_required: true
12 file: /root/seed12 file: /var/tmp/seed
13collect_scripts:13collect_scripts:
14 seed_data: |14 seed_data: |
15 #!/bin/bash15 #!/bin/bash
16 cat /root/seed16 cat /var/tmp/seed
1717
18# vi: ts=4 expandtab18# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/seed_random_data.yaml b/tests/cloud_tests/testcases/modules/seed_random_data.yaml
index a9b2c88..2e6e134 100644
--- a/tests/cloud_tests/testcases/modules/seed_random_data.yaml
+++ b/tests/cloud_tests/testcases/modules/seed_random_data.yaml
@@ -6,10 +6,10 @@ cloud_config: |
6 random_seed:6 random_seed:
7 data: 'MYUb34023nD:LFDK10913jk;dfnk:Df'7 data: 'MYUb34023nD:LFDK10913jk;dfnk:Df'
8 encoding: raw8 encoding: raw
9 file: /root/seed9 file: /var/tmp/seed
10collect_scripts:10collect_scripts:
11 seed_data: |11 seed_data: |
12 #!/bin/bash12 #!/bin/bash
13 cat /root/seed13 cat /var/tmp/seed
1414
15# vi: ts=4 expandtab15# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/set_password_expire.py b/tests/cloud_tests/testcases/modules/set_password_expire.py
index a1c3aa0..967aca7 100644
--- a/tests/cloud_tests/testcases/modules/set_password_expire.py
+++ b/tests/cloud_tests/testcases/modules/set_password_expire.py
@@ -18,6 +18,6 @@ class TestPasswordExpire(base.CloudTestCase):
18 def test_sshd_config(self):18 def test_sshd_config(self):
19 """Test sshd config allows passwords."""19 """Test sshd config allows passwords."""
20 out = self.get_data_file('sshd_config')20 out = self.get_data_file('sshd_config')
21 self.assertIn('PasswordAuthentication no', out)21 self.assertIn('PasswordAuthentication yes', out)
2222
23# vi: ts=4 expandtab23# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/set_password_expire.yaml b/tests/cloud_tests/testcases/modules/set_password_expire.yaml
index 789604b..ba6344b 100644
--- a/tests/cloud_tests/testcases/modules/set_password_expire.yaml
+++ b/tests/cloud_tests/testcases/modules/set_password_expire.yaml
@@ -6,7 +6,9 @@ required_features:
6cloud_config: |6cloud_config: |
7 #cloud-config7 #cloud-config
8 chpasswd: { expire: True }8 chpasswd: { expire: True }
9 ssh_pwauth: yes
9 users:10 users:
11 - default
10 - name: tom12 - name: tom
11 password: $1$xyz$sPMsLNmf66Ohl.ol6JvzE.13 password: $1$xyz$sPMsLNmf66Ohl.ol6JvzE.
12 lock_passwd: false14 lock_passwd: false
diff --git a/tests/cloud_tests/testcases/modules/set_password_list.yaml b/tests/cloud_tests/testcases/modules/set_password_list.yaml
index a2a89c9..fd3e1e4 100644
--- a/tests/cloud_tests/testcases/modules/set_password_list.yaml
+++ b/tests/cloud_tests/testcases/modules/set_password_list.yaml
@@ -5,6 +5,7 @@ cloud_config: |
5 #cloud-config5 #cloud-config
6 ssh_pwauth: yes6 ssh_pwauth: yes
7 users:7 users:
8 - default
8 - name: tom9 - name: tom
9 # md5 gotomgo10 # md5 gotomgo
10 passwd: "$1$S7$tT1BEDIYrczeryDQJfdPe0"11 passwd: "$1$S7$tT1BEDIYrczeryDQJfdPe0"
diff --git a/tests/cloud_tests/testcases/modules/set_password_list_string.yaml b/tests/cloud_tests/testcases/modules/set_password_list_string.yaml
index c2a0f63..e9fe54b 100644
--- a/tests/cloud_tests/testcases/modules/set_password_list_string.yaml
+++ b/tests/cloud_tests/testcases/modules/set_password_list_string.yaml
@@ -5,6 +5,7 @@ cloud_config: |
5 #cloud-config5 #cloud-config
6 ssh_pwauth: yes6 ssh_pwauth: yes
7 users:7 users:
8 - default
8 - name: tom9 - name: tom
9 # md5 gotomgo10 # md5 gotomgo
10 passwd: "$1$S7$tT1BEDIYrczeryDQJfdPe0"11 passwd: "$1$S7$tT1BEDIYrczeryDQJfdPe0"
diff --git a/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py b/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py
index 8222321..e7329d4 100644
--- a/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py
+++ b/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py
@@ -13,12 +13,4 @@ class TestSshKeyFingerprintsDisable(base.CloudTestCase):
13 self.assertIn('Skipping module named ssh-authkey-fingerprints, '13 self.assertIn('Skipping module named ssh-authkey-fingerprints, '
14 'logging of ssh fingerprints disabled', out)14 'logging of ssh fingerprints disabled', out)
1515
16 def test_syslog(self):
17 """Verify output of syslog."""
18 out = self.get_data_file('syslog')
19 self.assertNotRegex(out, r'256 SHA256:.*(ECDSA)')
20 self.assertNotRegex(out, r'256 SHA256:.*(ED25519)')
21 self.assertNotRegex(out, r'1024 SHA256:.*(DSA)')
22 self.assertNotRegex(out, r'2048 SHA256:.*(RSA)')
23
24# vi: ts=4 expandtab16# vi: ts=4 expandtab
diff --git a/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml b/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml
index 746653e..d93893e 100644
--- a/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml
+++ b/tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml
@@ -5,7 +5,6 @@ required_features:
5 - syslog5 - syslog
6cloud_config: |6cloud_config: |
7 #cloud-config7 #cloud-config
8 ssh_genkeytypes: []
9 no_ssh_fingerprints: true8 no_ssh_fingerprints: true
10collect_scripts:9collect_scripts:
11 syslog: |10 syslog: |
diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_generate.py b/tests/cloud_tests/testcases/modules/ssh_keys_generate.py
index fd6d9ba..b68f556 100644
--- a/tests/cloud_tests/testcases/modules/ssh_keys_generate.py
+++ b/tests/cloud_tests/testcases/modules/ssh_keys_generate.py
@@ -9,11 +9,6 @@ class TestSshKeysGenerate(base.CloudTestCase):
99
10 # TODO: Check cloud-init-output for the correct keys being generated10 # TODO: Check cloud-init-output for the correct keys being generated
1111
12 def test_ubuntu_authorized_keys(self):
13 """Test passed in key is not in list for ubuntu."""
14 out = self.get_data_file('auth_keys_ubuntu')
15 self.assertEqual('', out)
16
17 def test_dsa_public(self):12 def test_dsa_public(self):
18 """Test dsa public key not generated."""13 """Test dsa public key not generated."""
19 out = self.get_data_file('dsa_public')14 out = self.get_data_file('dsa_public')
diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml b/tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml
index 659fd93..a702f66 100644
--- a/tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml
+++ b/tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml
@@ -10,12 +10,9 @@ cloud_config: |
10 - ed2551910 - ed25519
11 authkey_hash: sha51211 authkey_hash: sha512
12collect_scripts:12collect_scripts:
13 auth_keys_root: |13 auth_keys: |
14 #!/bin/bash14 #!/bin/bash
15 cat /root/.ssh/authorized_keys15 cat $HOME/.ssh/authorized_keys
16 auth_keys_ubuntu: |
17 #!/bin/bash
18 cat /home/ubuntu/ssh/authorized_keys
19 dsa_public: |16 dsa_public: |
20 #!/bin/bash17 #!/bin/bash
21 cat /etc/ssh/ssh_host_dsa_key.pub18 cat /etc/ssh/ssh_host_dsa_key.pub
diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_provided.py b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py
index 544649d..add3f46 100644
--- a/tests/cloud_tests/testcases/modules/ssh_keys_provided.py
+++ b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py
@@ -7,17 +7,6 @@ from tests.cloud_tests.testcases import base
7class TestSshKeysProvided(base.CloudTestCase):7class TestSshKeysProvided(base.CloudTestCase):
8 """Test ssh keys module."""8 """Test ssh keys module."""
99
10 def test_ubuntu_authorized_keys(self):
11 """Test passed in key is not in list for ubuntu."""
12 out = self.get_data_file('auth_keys_ubuntu')
13 self.assertEqual('', out)
14
15 def test_root_authorized_keys(self):
16 """Test passed in key is in authorized list for root."""
17 out = self.get_data_file('auth_keys_root')
18 self.assertIn('lzrkPqONphoZx0LDV86w7RUz1ksDzAdcm0tvmNRFMN1a0frDs50'
19 '6oA3aWK0oDk4Nmvk8sXGTYYw3iQSkOvDUUlIsqdaO+w==', out)
20
21 def test_dsa_public(self):10 def test_dsa_public(self):
22 """Test dsa public key passed in."""11 """Test dsa public key passed in."""
23 out = self.get_data_file('dsa_public')12 out = self.get_data_file('dsa_public')
diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml b/tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml
index 5ceb362..9adabf4 100644
--- a/tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml
+++ b/tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml
@@ -39,7 +39,7 @@ cloud_config: |
39 vek8Uo8ap8AEsv4Rfs9opUcUZevLp3g2741eOaidHVLm0l4iLIVl03otGOqvSzs+39 vek8Uo8ap8AEsv4Rfs9opUcUZevLp3g2741eOaidHVLm0l4iLIVl03otGOqvSzs+
40 A3tFPEOxauXpzCt8f8eXsz0WQXAgIKW2h8zu5QHjomioU3i27mtE40 A3tFPEOxauXpzCt8f8eXsz0WQXAgIKW2h8zu5QHjomioU3i27mtE
41 -----END RSA PRIVATE KEY-----41 -----END RSA PRIVATE KEY-----
42 rsa_public: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0/Ho+o3eJISydO2JvIgTLnZOtrxPl+fSvJfKDjoOLY0HB2eOjy2s2/2N6d9X9SGZ4+XnyVeNPjfBXw4IyXoqxhfIF16Azfk022iejgjiYssoUxH31M60OfqJhxo16dWEXdkKP1nac06VOt1zS5yEeooyvEuMJEJSsv3VR/7GKhMX3TVhEz5moLmVP3bIAvvoXio8X4urVC1R819QjDC86nlxwNks/GKPRi/IHO5tjJ72Eke7KNsm/vxHgkdX4vZaHNKhfdb/pavFXN5eoUaofz3hxw5oL/u2epI/pXyUhDp8Tb5wO6slykzcIlGCSd0YeO1TnljvViRx0uSxIy97N root@xenial-lxd42 rsa_public: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0/Ho+o3eJISydO2JvIgTLnZOtrxPl+fSvJfKDjoOLY0HB2eOjy2s2/2N6d9X9SGZ4+XnyVeNPjfBXw4IyXoqxhfIF16Azfk022iejgjiYssoUxH31M60OfqJhxo16dWEXdkKP1nac06VOt1zS5yEeooyvEuMJEJSsv3VR/7GKhMX3TVhEz5moLmVP3bIAvvoXio8X4urVC1R819QjDC86nlxwNks/GKPRi/IHO5tjJ72Eke7KNsm/vxHgkdX4vZaHNKhfdb/pavFXN5eoUaofz3hxw5oL/u2epI/pXyUhDp8Tb5wO6slykzcIlGCSd0YeO1TnljvViRx0uSxIy97N ubuntu@xenial-lxd
43 dsa_private: |43 dsa_private: |
44 -----BEGIN DSA PRIVATE KEY-----44 -----BEGIN DSA PRIVATE KEY-----
45 MIIBuwIBAAKBgQD5Fstc23IVSDe6k4DNP8smPKuEWUvHDTOGaXrhOVAfzZ6+jklP45 MIIBuwIBAAKBgQD5Fstc23IVSDe6k4DNP8smPKuEWUvHDTOGaXrhOVAfzZ6+jklP
@@ -53,7 +53,7 @@ cloud_config: |
53 wExw3doDSCUb28L1B50wBzQ8mC3KXp6C7IkBXWspb16DLHUHFSI8bkICFA5kVUcW53 wExw3doDSCUb28L1B50wBzQ8mC3KXp6C7IkBXWspb16DLHUHFSI8bkICFA5kVUcW
54 nCPOXEQsayANi8+Cb7BH54 nCPOXEQsayANi8+Cb7BH
55 -----END DSA PRIVATE KEY-----55 -----END DSA PRIVATE KEY-----
56 dsa_public: ssh-dss AAAAB3NzaC1kc3MAAACBAPkWy1zbchVIN7qTgM0/yyY8q4RZS8cNM4ZpeuE5UB/Nnr6OSU/nmbO8LuM7nc9ZYLfWGrXTEGhZ16/Ra1w0X1O/7hsBrXbrfLnVGqjgYjvHH7GJzV2Yuqp9iKMFP2Tjwn/W1XRyzVaOzoU/8glMP+RhUL3fQmNhAyLvbaUGdTGxAAAAFQC+4s930xik70s71tMEJcJ2KUtkBQAAAIA2n4p3JL1X3ceDEZAQ3WuWP9NK/9rcRV0Iq0SdB/nlo8fEMBUNXDkm1GHillttFXigZE9z0o52OjkFTby9IzcuaGRv5RpoNfAeSAicrX3ejvgMqMANZnG4vLKIoeIw6HGjOjEN+NbGzyfPq6q9JbSmvnbUTAhjpFqNsQOdnZrcaQAAAIEAyoUomNRB6bmpsIfzt8zdtqLP5umIj2uhr9MVPL8/QdbxmJ72Z7pfQ2z1B7QAdIBGOlqJXtlau7ABhWK29Efe+99ObyTSSdDc6RCDeAwUmBAiPRQhDH2EwExw3doDSCUb28L1B50wBzQ8mC3KXp6C7IkBXWspb16DLHUHFSI8bkI= root@xenial-lxd56 dsa_public: ssh-dss AAAAB3NzaC1kc3MAAACBAPkWy1zbchVIN7qTgM0/yyY8q4RZS8cNM4ZpeuE5UB/Nnr6OSU/nmbO8LuM7nc9ZYLfWGrXTEGhZ16/Ra1w0X1O/7hsBrXbrfLnVGqjgYjvHH7GJzV2Yuqp9iKMFP2Tjwn/W1XRyzVaOzoU/8glMP+RhUL3fQmNhAyLvbaUGdTGxAAAAFQC+4s930xik70s71tMEJcJ2KUtkBQAAAIA2n4p3JL1X3ceDEZAQ3WuWP9NK/9rcRV0Iq0SdB/nlo8fEMBUNXDkm1GHillttFXigZE9z0o52OjkFTby9IzcuaGRv5RpoNfAeSAicrX3ejvgMqMANZnG4vLKIoeIw6HGjOjEN+NbGzyfPq6q9JbSmvnbUTAhjpFqNsQOdnZrcaQAAAIEAyoUomNRB6bmpsIfzt8zdtqLP5umIj2uhr9MVPL8/QdbxmJ72Z7pfQ2z1B7QAdIBGOlqJXtlau7ABhWK29Efe+99ObyTSSdDc6RCDeAwUmBAiPRQhDH2EwExw3doDSCUb28L1B50wBzQ8mC3KXp6C7IkBXWspb16DLHUHFSI8bkI= ubuntu@xenial-lxd
57 ed25519_private: |57 ed25519_private: |
58 -----BEGIN OPENSSH PRIVATE KEY-----58 -----BEGIN OPENSSH PRIVATE KEY-----
59 b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW59 b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
@@ -62,21 +62,15 @@ cloud_config: |
62 AAAEDQlFZpz9q8+/YJHS9+jPAqy2ZT6cGEv8HTB6RZtTjd/dudAZSu4vjZpVWzId5pXmZg62 AAAEDQlFZpz9q8+/YJHS9+jPAqy2ZT6cGEv8HTB6RZtTjd/dudAZSu4vjZpVWzId5pXmZg
63 1M6G15dqjQ2XkNVOEnb5AAAAD3Jvb3RAeGVuaWFsLWx4ZAECAwQFBg==63 1M6G15dqjQ2XkNVOEnb5AAAAD3Jvb3RAeGVuaWFsLWx4ZAECAwQFBg==
64 -----END OPENSSH PRIVATE KEY-----64 -----END OPENSSH PRIVATE KEY-----
65 ed25519_public: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINudAZSu4vjZpVWzId5pXmZg1M6G15dqjQ2XkNVOEnb5 root@xenial-lxd65 ed25519_public: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINudAZSu4vjZpVWzId5pXmZg1M6G15dqjQ2XkNVOEnb5 ubuntu@xenial-lxd
66 ecdsa_private: |66 ecdsa_private: |
67 -----BEGIN EC PRIVATE KEY-----67 -----BEGIN EC PRIVATE KEY-----
68 MHcCAQEEIDuK+QFc1wmyJY8uDqQVa1qHte30Rk/fdLxGIBkwJAyOoAoGCCqGSM4968 MHcCAQEEIDuK+QFc1wmyJY8uDqQVa1qHte30Rk/fdLxGIBkwJAyOoAoGCCqGSM49
69 AwEHoUQDQgAEWxLlO+TL8gL91eET9p/HFQbqR1A691AkJgZk3jY5mpZqxgX4vcgb69 AwEHoUQDQgAEWxLlO+TL8gL91eET9p/HFQbqR1A691AkJgZk3jY5mpZqxgX4vcgb
70 7f/CtXuM6s2svcDJqAeXr6Wk8OJJcMxylA==70 7f/CtXuM6s2svcDJqAeXr6Wk8OJJcMxylA==
71 -----END EC PRIVATE KEY-----71 -----END EC PRIVATE KEY-----
72 ecdsa_public: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFsS5Tvky/IC/dXhE/afxxUG6kdQOvdQJCYGZN42OZqWasYF+L3IG+3/wrV7jOrNrL3AyagHl6+lpPDiSXDMcpQ= root@xenial-lxd72 ecdsa_public: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFsS5Tvky/IC/dXhE/afxxUG6kdQOvdQJCYGZN42OZqWasYF+L3IG+3/wrV7jOrNrL3AyagHl6+lpPDiSXDMcpQ= ubuntu@xenial-lxd
73collect_scripts:73collect_scripts:
74 auth_keys_root: |
75 #!/bin/bash
76 cat /root/.ssh/authorized_keys
77 auth_keys_ubuntu: |
78 #!/bin/bash
79 cat /home/ubuntu/ssh/authorized_keys
80 dsa_public: |74 dsa_public: |
81 #!/bin/bash75 #!/bin/bash
82 cat /etc/ssh/ssh_host_dsa_key.pub76 cat /etc/ssh/ssh_host_dsa_key.pub
diff --git a/tests/cloud_tests/testcases/modules/write_files.yaml b/tests/cloud_tests/testcases/modules/write_files.yaml
index ce936b7..c5b48c0 100644
--- a/tests/cloud_tests/testcases/modules/write_files.yaml
+++ b/tests/cloud_tests/testcases/modules/write_files.yaml
@@ -10,37 +10,36 @@ cloud_config: |
10 write_files:10 write_files:
11 - encoding: b6411 - encoding: b64
12 content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV412 content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4
13 owner: root:root13 path: /var/tmp/file_b64
14 path: /root/file_b64
15 permissions: '0644'14 permissions: '0644'
16 - content: |15 - content: |
17 # My new /root/file_text16 # My new /var/tmp/file_text
1817
19 SMBDOPTIONS="-D"18 SMBDOPTIONS="-D"
20 path: /root/file_text19 path: /var/tmp/file_text
21 - content: !!binary |20 - content: !!binary |
22 f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAAAAAAAAAEAAOAAI21 f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAAAAAAAAAEAAOAAI
23 AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAADAAQAAAAAAAAgA22 AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAADAAQAAAAAAAAgA
24 AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA23 AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA
25 path: /root/file_binary24 path: /var/tmp/file_binary
26 permissions: '0555'25 permissions: '0555'
27 - encoding: gzip26 - encoding: gzip
28 content: !!binary |27 content: !!binary |
29 H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=28 H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
30 path: /root/file_gzip29 path: /var/tmp/file_gzip
31 permissions: '0755'30 permissions: '0755'
32collect_scripts:31collect_scripts:
33 file_b64: |32 file_b64: |
34 #!/bin/bash33 #!/bin/bash
35 file /root/file_b6434 file /var/tmp/file_b64
36 file_text: |35 file_text: |
37 #!/bin/bash36 #!/bin/bash
38 file /root/file_text37 file /var/tmp/file_text
39 file_binary: |38 file_binary: |
40 #!/bin/bash39 #!/bin/bash
41 file /root/file_binary40 file /var/tmp/file_binary
42 file_gzip: |41 file_gzip: |
43 #!/bin/bash42 #!/bin/bash
44 file /root/file_gzip43 file /var/tmp/file_gzip
4544
46# vi: ts=4 expandtab45# vi: ts=4 expandtab

Subscribers

People subscribed via source and target branches