<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_distros, branch circinus</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=circinus</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=circinus'/>
<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>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/vyos/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>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/vyos/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>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/vyos/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>
<entry>
<title>testing: add get_cloud function (SC-461) (#1038)</title>
<updated>2021-10-16T00:53:42+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-16T00:53:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a9501251aadf6d30192f7bd7debeabc9c3e29420'/>
<id>urn:sha1:a9501251aadf6d30192f7bd7debeabc9c3e29420</id>
<content type='text'>
Also added supporting distro/datasource classes and updated tests
that have a `get_cloud` call.</content>
</entry>
<entry>
<title>photon: refactor hostname handling and add networkd activator (#958)</title>
<updated>2021-08-09T16:49:13+00:00</updated>
<author>
<name>sshedi</name>
<email>53473811+sshedi@users.noreply.github.com</email>
</author>
<published>2021-08-09T16:49:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=049d62b658b06e729291def6b7b6f9520827d0ba'/>
<id>urn:sha1:049d62b658b06e729291def6b7b6f9520827d0ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add ability to manage fallback network config on PhotonOS (#941)</title>
<updated>2021-07-23T15:40:41+00:00</updated>
<author>
<name>sshedi</name>
<email>53473811+sshedi@users.noreply.github.com</email>
</author>
<published>2021-07-23T15:40:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=6e7066ea2b06940c4931f0258c7982b09966582f'/>
<id>urn:sha1:6e7066ea2b06940c4931f0258c7982b09966582f</id>
<content type='text'>
Currently cloud-init generates fallback network config on various
scenarios.

For example:
1. When no DS found
2. There is no 'network' info given in DS metadata.
3. If a DS gives a network config once and upon reboot if DS doesn't
   give any network info, previously set network data will be
   overridden.

A newly introduced key in cloud.cfg.tmpl can be used to control this
behavior on PhotonOS.

Also, if OS comes with a set of default network files(configs), like in
PhotonOS, cloud-init should not overwrite them by default.

This change also includes some nitpicking changes of reorganizing few
config variables.

Signed-off-by: Shreenidhi Shedi &lt;sshedi@vmware.com&gt;</content>
</entry>
<entry>
<title>Update pylint to v2.9.3 and fix the new issues it spots (#946)</title>
<updated>2021-07-20T14:58:21+00:00</updated>
<author>
<name>Paride Legovini</name>
<email>paride.legovini@canonical.com</email>
</author>
<published>2021-07-20T14:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=ec6afadbf0f0f77d5b58dccd70df77da89c2c91d'/>
<id>urn:sha1:ec6afadbf0f0f77d5b58dccd70df77da89c2c91d</id>
<content type='text'>
In CI run against pylint 2.9.3 and fix occurrences of:
 - W0237 (arguments-renamed)
 - W0402 (deprecated-module)

The W0402 deprecated-module was about module `imp`:

    cloudinit/patcher.py:9: [W0402(deprecated-module), ]
        Uses of a deprecated module 'imp'

The imp module is deprecated and replaced by importlib, which according
to the documentation has no replacement for acquire_lock() and
release_lock(), which are the only reason why `imp` is imported.
    
Nothing about the code using this lock that actually requires it.
Let's remove the locking code and the import altogether.

Dropping the locking makes patcher.patch() an empty wrapper around
_patch_logging(). Rename _patch_logging() to patch_logging() and
call it directly instead. Drop patch().</content>
</entry>
<entry>
<title>Removed distro specific network code from Photon (#929)</title>
<updated>2021-06-28T18:42:34+00:00</updated>
<author>
<name>sshedi</name>
<email>53473811+sshedi@users.noreply.github.com</email>
</author>
<published>2021-06-28T18:42:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=b5aecbe9512fa546255cc93b178b4081342fc247'/>
<id>urn:sha1:b5aecbe9512fa546255cc93b178b4081342fc247</id>
<content type='text'>
Minor fixes in networkd renderer &amp; fixed corresponding tests

Removed datasource_list for Photon from cloud.cfg.tmpl &amp; added a comment
in cloud.cfg.tmpl about not to use multiline array for datasource_list.

Signed-off-by: Shreenidhi Shedi &lt;sshedi@vmware.com&gt;</content>
</entry>
<entry>
<title>Add support for VMware PhotonOS (#909)</title>
<updated>2021-06-18T16:53:44+00:00</updated>
<author>
<name>sshedi</name>
<email>53473811+sshedi@users.noreply.github.com</email>
</author>
<published>2021-06-18T16:53:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=35aa9db6f8e2ba05d366776c0e8d97f52217e930'/>
<id>urn:sha1:35aa9db6f8e2ba05d366776c0e8d97f52217e930</id>
<content type='text'>
Also added a new (currently experimental) systemd-networkd renderer,
and includes a small refactor to cc_resolv_conf.py to support the
resolved.conf used by systemd-resolved.</content>
</entry>
</feed>
