<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_handler, branch current</title>
<subtitle> (mirror of https://github.com/marekm72/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=current</id>
<link rel='self' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=current'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/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/marekm72/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>testing: monkeypatch system_info call in unit tests (SC-533) (#1117)</title>
<updated>2021-11-22T22:56:41+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-11-22T22:56:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=31daf6670aeeba1d452c70bc0d4d04139652be36'/>
<id>urn:sha1:31daf6670aeeba1d452c70bc0d4d04139652be36</id>
<content type='text'>
testing: monkeypatch system_info call in unit tests

system_info can make calls that read or write from the filesystem, which
should require special mocking. It is also decorated with 'lru_cache',
which means test authors often don't realize they need to be mocking.
Also, we don't actually want the results from the user's local
machine, so monkeypatching it across all tests should be reasonable.

Additionally, moved some of 'system_info` into a helper function to
reduce the surface area of the monkeypatch, added tests for the new
function (and fixed a bug as a result), and removed related mocks that
should be no longer needed.</content>
</entry>
<entry>
<title>testing: add growpart integration test (#1104)</title>
<updated>2021-11-17T18:35:00+00:00</updated>
<author>
<name>Brett Holman</name>
<email>brett.holman@canonical.com</email>
</author>
<published>2021-11-17T18:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=7f03da357e4e72f7fe09e9b35b23ba1d83477f6c'/>
<id>urn:sha1:7f03da357e4e72f7fe09e9b35b23ba1d83477f6c</id>
<content type='text'>
Add growpart integration test and associated unit tests

Additionally, a small runcmd check for a commented line.</content>
</entry>
<entry>
<title>Wait for apt lock (#1034)</title>
<updated>2021-11-09T15:28:19+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-11-09T15:28:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=3d150688617e2b8a16d715c7fb819c759f91915a'/>
<id>urn:sha1:3d150688617e2b8a16d715c7fb819c759f91915a</id>
<content type='text'>
Currently any attempt to run an apt command while another process holds
an apt lock will fail. We should instead wait to acquire the apt lock.

LP: #1944611</content>
</entry>
<entry>
<title>Allow libexec for hotplug (#1088)</title>
<updated>2021-10-29T20:39:29+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-29T20:39:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a90d8338f07b30a46887f7c133baade63129a53a'/>
<id>urn:sha1:a90d8338f07b30a46887f7c133baade63129a53a</id>
<content type='text'>
When we added the install hotplug module, we forgot to update the
redhet/cloud-init.spec.in file and allow for execution on /usr/libexec.
This PR adds that functionality.</content>
</entry>
<entry>
<title>Remove (deprecated) apt-key (#1068)</title>
<updated>2021-10-29T19:33:33+00:00</updated>
<author>
<name>Brett Holman</name>
<email>brett.holman@canonical.com</email>
</author>
<published>2021-10-29T19:33:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=28581988da4b37e3d2423075c64dc1f3bc5da5cc'/>
<id>urn:sha1:28581988da4b37e3d2423075c64dc1f3bc5da5cc</id>
<content type='text'>
Also, add the "signed by" option to source definitions. This enables
users to limit the scope of trust for individual keys.

LP: #1836336</content>
</entry>
<entry>
<title>Add "install hotplug" module (SC-476) (#1069)</title>
<updated>2021-10-27T14:43:34+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-27T14:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=1d01da5d9916d97ef463ba61a36b3f98f8911419'/>
<id>urn:sha1:1d01da5d9916d97ef463ba61a36b3f98f8911419</id>
<content type='text'>
This commit removes automatically installing udev rules for hotplug
and adds a module to install them instead.

Automatically including the udev rules and checking if hotplug was
enabled consumed too many resources in certain circumstances. Moving the
rules to a module ensures we don't spend extra extra cycles on hotplug
if hotplug functionality isn't desired.

LP: #1946003</content>
</entry>
<entry>
<title>Add module 'write-files-deferred' executed in stage 'final' (#916)</title>
<updated>2021-10-25T19:31:07+00:00</updated>
<author>
<name>Lucendio</name>
<email>github+dev@lucendio.com</email>
</author>
<published>2021-10-25T19:31:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a4236c375ddf78258a8f9252c1d79c665aa4f88b'/>
<id>urn:sha1:a4236c375ddf78258a8f9252c1d79c665aa4f88b</id>
<content type='text'>
The main idea is to introduce a second module that takes care of
writing files, but in the 'final' stage.

While the introduction of a second module would allow for choosing
the appropriate place withing the order of modules (and stages),
there is no addition top-level directive being added to the cloud
configuration schema. Instead, 'write-files' schema is being extended
to include a 'defer' attribute used only by the 'write-deffered-files'
modules.

The new module 'write-deferred-files' reuses as much as
possible of the 'write-files' functionality.</content>
</entry>
<entry>
<title>Remove pin in dependencies for jsonschema (#1078)</title>
<updated>2021-10-23T03:06:51+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-23T03:06:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=2db713346d656c3486228678ad020b56440c1e34'/>
<id>urn:sha1:2db713346d656c3486228678ad020b56440c1e34</id>
<content type='text'>
In jsonschema 4, hostname validation was changed to have an optional
dependency on the fqdn package. Since we don't have this dependency
in cloud-init, attempting this validation will no longer fail for
a string that isn't a valid hostname.</content>
</entry>
<entry>
<title>Leave the details of service management to the distro (#1074)</title>
<updated>2021-10-20T20:58:27+00:00</updated>
<author>
<name>Andy Fiddaman</name>
<email>omnios@citrus-it.co.uk</email>
</author>
<published>2021-10-20T20:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=8c89009e75c7cf6c2f87635b82656f07f58095e1'/>
<id>urn:sha1:8c89009e75c7cf6c2f87635b82656f07f58095e1</id>
<content type='text'>
Various modules restart services and they all have logic to try and
detect if they are running on a system that needs 'systemctl' or
'service', and then have code to decide which order the arguments
need to be etc. On top of that, not all modules do this in the same way.

The duplication and different approaches are not ideal but this also
makes it hard to add support for a new distribution that does not use
either 'systemctl' or 'service'.

This change adds a new manage_service() method to the distro class
and updates several modules to use it.</content>
</entry>
</feed>
