<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/cloudinit/config/tests/test_ssh.py, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2021-12-03T20:11:46+00:00</updated>
<entry>
<title>Reorganize unit test locations under tests/unittests (#1126)</title>
<updated>2021-12-03T20:11:46+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-03T20:11:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51'/>
<id>urn:sha1:039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51</id>
<content type='text'>
This attempts to standardize unit test file location under test/unittests/
such that any source file located at cloudinit/path/to/file.py may have a
corresponding unit test file at test/unittests/path/to/test_file.py.

Noteworthy Comments:
====================
Four different duplicate test files existed:
test_{gpg,util,cc_mounts,cc_resolv_conf}.py
Each of these duplicate file pairs has been merged together. This is a
break in git history for these files.

The test suite appears to have a dependency on test order. Changing test
order causes some tests to fail. This should be rectified, but for now
some tests have been modified in
tests/unittests/config/test_set_passwords.py.

A helper class name starts with "Test" which causes pytest to try
executing it as a test case, which then throws warnings "due to Class
having __init__()".  Silence by changing the name of the class.

# helpers.py is imported in many test files, import paths change
cloudinit/tests/helpers.py -&gt; tests/unittests/helpers.py

# Move directories:
cloudinit/distros/tests -&gt; tests/unittests/distros
cloudinit/cmd/devel/tests -&gt; tests/unittests/cmd/devel
cloudinit/cmd/tests -&gt; tests/unittests/cmd/
cloudinit/sources/helpers/tests -&gt; tests/unittests/sources/helpers
cloudinit/sources/tests -&gt; tests/unittests/sources
cloudinit/net/tests -&gt; tests/unittests/net
cloudinit/config/tests -&gt; tests/unittests/config
cloudinit/analyze/tests/ -&gt; tests/unittests/analyze/

# Standardize tests already in tests/unittests/
test_datasource -&gt; sources
test_distros -&gt; distros
test_vmware -&gt; sources/vmware
test_handler -&gt; config        # this contains cloudconfig module tests
test_runs -&gt; runs</content>
</entry>
<entry>
<title>Support configuring SSH host certificates. (#660)</title>
<updated>2020-11-20T20:59:51+00:00</updated>
<author>
<name>Jonathan Lung</name>
<email>lungj@users.noreply.github.com</email>
</author>
<published>2020-11-20T20:59:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=66b4be8b6da188a0667bd8c86a25155b6f4f3f6c'/>
<id>urn:sha1:66b4be8b6da188a0667bd8c86a25155b6f4f3f6c</id>
<content type='text'>
Existing config writes keys to /etc/ssh after deleting files matching
a glob that includes certificate files. Since sshd looks for
certificates in the same directory as the keys, a host certificate
must be placed in this directory. This update enables the certificate's
contents to be specified along with the keys.

Co-authored-by: jonathan lung &lt;lungj@heresjono.com&gt;
Co-authored-by: jonathan lung &lt;jlung@kepler.space&gt;</content>
</entry>
<entry>
<title>Add config for ssh-key import and consuming user-data</title>
<updated>2019-10-31T16:26:54+00:00</updated>
<author>
<name>Pavel Zakharov</name>
<email>pavel.zakharov@delphix.com</email>
</author>
<published>2019-10-31T16:26:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=45ea695f9b4fce180c662ab4211575d64912634e'/>
<id>urn:sha1:45ea695f9b4fce180c662ab4211575d64912634e</id>
<content type='text'>
This patch enables control over SSH public-key import and
discarding supplied user-data (both disabled by default).

  allow-userdata: false
  ssh:
    allow_public_ssh_keys: false

This feature enables closed appliances to prevent customers
from unintentionally breaking the appliance which were
not designed for user interaction.

The downstream change for this is here:
  https://github.com/delphix/cloud-init/pull/4
</content>
</entry>
<entry>
<title>Add support for publishing host keys to GCE guest attributes</title>
<updated>2019-08-09T17:11:05+00:00</updated>
<author>
<name>Rick Wright</name>
<email>rickw@google.com</email>
</author>
<published>2019-08-09T17:11:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=155847209e6a3ed5face91a133d8488a703f3f93'/>
<id>urn:sha1:155847209e6a3ed5face91a133d8488a703f3f93</id>
<content type='text'>
This adds an empty publish_host_keys() method to the default datasource
that is called by cc_ssh.py. This feature can be controlled by the
'ssh_publish_hostkeys' config option. It is enabled by default but can
be disabled by setting 'enabled' to false. Also, a blacklist of key
types is supported.

In addition, this change implements ssh_publish_hostkeys() for the GCE
datasource, attempting to write the hostkeys to the instance's guest
attributes. Using these hostkeys for ssh connections is currently
supported by the alpha version of Google's 'gcloud' command-line tool.

(On Google Compute Engine, this feature will be enabled by setting the
'enable-guest-attributes' metadata key to 'true' for the
project/instance that you would like to use this feature for. When
connecting to the instance for the first time using 'gcloud compute ssh'
the hostkeys will be read from the guest attributes for the instance and
written to the user's local known_hosts file for Google Compute Engine
instances.)
</content>
</entry>
<entry>
<title>config: disable ssh access to a configured user account</title>
<updated>2018-09-08T01:48:38+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-09-08T01:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=757247f9ff2df57e792e29d8656ac415364e914d'/>
<id>urn:sha1:757247f9ff2df57e792e29d8656ac415364e914d</id>
<content type='text'>
Cloud config can now disable ssh access to non-root users.

When defining the 'users' list in cloud-configuration a boolean
'ssh_redirect_user: true' can be provided to disable ssh logins for
that user. Any ssh 'public-keys' defined in cloud meta-data will be added
and disabled in .ssh/authorized_keys. Any attempts to ssh as this user
using acceptable ssh keys will be presented with a message like the
following:

Please login as the user "ubuntu" rather than the user "youruser".
</content>
</entry>
<entry>
<title>Add unit tests for config/cc_ssh.py</title>
<updated>2018-09-01T17:59:18+00:00</updated>
<author>
<name>Francis Ginther</name>
<email>francis.ginther@canonical.com</email>
</author>
<published>2018-09-01T17:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3f6d0972d83c8bfd6a5e666d73cb84a8cfe9c8b6'/>
<id>urn:sha1:3f6d0972d83c8bfd6a5e666d73cb84a8cfe9c8b6</id>
<content type='text'>
These tests focus on the apply_credentials method and the ssh setup for
root and a distro default user.
</content>
</entry>
</feed>
