<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_datasource, branch cla</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=cla</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=cla'/>
<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>Move GCE metadata fetch to init-local (SC-502) (#1122)</title>
<updated>2021-12-02T14:51:26+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-12-02T14:51:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=cf38c2cbc5875813fbb9858f45e5b95789b7ffea'/>
<id>urn:sha1:cf38c2cbc5875813fbb9858f45e5b95789b7ffea</id>
<content type='text'>
GCE currently fetches metadata after network has come up. There's no
reason we can't fetch at init-local time, so update GCE to fetch at
init-local time to be more performant and consistent with other
datasources.</content>
</entry>
<entry>
<title>sources/azure: remove unused remnants related to agent command (#1119)</title>
<updated>2021-11-29T15:59:39+00:00</updated>
<author>
<name>Chris Patterson</name>
<email>cpatterson@microsoft.com</email>
</author>
<published>2021-11-29T15:59:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=4bf4de25ea487ceb7005dc63d01f73fe56a13a16'/>
<id>urn:sha1:4bf4de25ea487ceb7005dc63d01f73fe56a13a16</id>
<content type='text'>
Some references were missed in the removal of the agent command
in PR #799.  This simply removes the remaining references.

Signed-off-by: Chris Patterson &lt;cpatterson@microsoft.com&gt;</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>azure: pps imds (#1093)</title>
<updated>2021-11-02T16:53:39+00:00</updated>
<author>
<name>Anh Vo</name>
<email>anhvo@microsoft.com</email>
</author>
<published>2021-11-02T16:53:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=48467aa304fd2400cf291f816055af15af30f883'/>
<id>urn:sha1:48467aa304fd2400cf291f816055af15af30f883</id>
<content type='text'>
Without UDF support, DS Azure cannot mount the provisioning ISO,
which contains platform metadata necessary to support
pre-provisioning. The required metadata is made available in IMDS 
starting with api version 2021-08-01. This change will leverage IMDS
to obtain the required metadata to support pre-preprovisioning if 
provisioning ISO was not available.</content>
</entry>
<entry>
<title>Add LXD datasource (#1040)</title>
<updated>2021-11-01T20:43:05+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2021-11-01T20:43:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=773765346ba543987aa64a1119fa760f0b1cbb6f'/>
<id>urn:sha1:773765346ba543987aa64a1119fa760f0b1cbb6f</id>
<content type='text'>
Add DataSourceLXD which knows how to talk to the dev-lxd socket to
obtain all instance metadata API:
https://linuxcontainers.org/lxd/docs/master/dev-lxd.

This first branch is to deliver feature parity with the existing
NoCloud datasource which is currently used to intialize LXC instances
on first boot.

Introduce a SocketConnectionPool and LXDSocketAdapter to support
performing HTTP GETs on the following routes which are surfaced by the
LXD host to all containers:
http://unix.socket/1.0/meta-data
http://unix.socket/1.0/config/user.user-data
http://unix.socket/1.0/config/user.network-config
http://unix.socket/1.0/config/user.vendor-data
These 4 routes minimally replace the static content provided in the
following nocloud-net seed files:
/var/lib/cloud/nocloud-net/{meta-data,vendor-data,user-data,network-config}

The intent of this commit is to set a foundation for LXD socket
communication that will allow us to build network hot-plug features
by eventually consuming LXD's websocket upgrade route 1.0/events to
react to network, meta-data and user-data config changes over time.

In the event that no custom network-config is provided, default to the
same network-config definition provided by LXD to the NoCloud
network-config seed file.

Supplemental features above NoCloud datasource:
surface all custom instance data config keys via cloud-init query ds
which aids in discoverability of features/tags/labels as well as
conditional #cloud-config jinja templates operations based on custom
config options.
TBD: better cloud-init query support for dot-delimited keys</content>
</entry>
<entry>
<title>Add necessary mocks to test_ovf unit tests (#1087)</title>
<updated>2021-10-29T19:54:33+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-29T19:54:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=0f8428f6227106c28615384d49a3e55e5c14dc17'/>
<id>urn:sha1:0f8428f6227106c28615384d49a3e55e5c14dc17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>VMware: read network-config from ISO (#1066)</title>
<updated>2021-10-19T00:09:40+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas@t-8ch.de</email>
</author>
<published>2021-10-19T00:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a0a68a24c34ee268962e7a3c3844c59ab4036bf9'/>
<id>urn:sha1:a0a68a24c34ee268962e7a3c3844c59ab4036bf9</id>
<content type='text'>
There is no reason for the ISO missing this functionality.

As discussed in https://github.com/canonical/cloud-init/pull/947/files#r707338489</content>
</entry>
<entry>
<title>testing: mock sleep in gce unit tests (#1072)</title>
<updated>2021-10-18T17:34:31+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-18T17:34:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=70f0ee78ce4926cb79f37e13568deba298321016'/>
<id>urn:sha1:70f0ee78ce4926cb79f37e13568deba298321016</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support ETHx_IP6_GATEWAY, SET_HOSTNAME on OpenNebula (#1045)</title>
<updated>2021-10-07T14:01:59+00:00</updated>
<author>
<name>Vlastimil Holer</name>
<email>vholer@opennebula.io</email>
</author>
<published>2021-10-07T14:01:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=1bbb67ca200e53d98d7f14904b986240a2fca4b5'/>
<id>urn:sha1:1bbb67ca200e53d98d7f14904b986240a2fca4b5</id>
<content type='text'>
OpenNebula 6.1.80 (current dev. version) is introducing new IPv6 gateway
contextualization variable ETHx_IP6_GATEWAY, which mimics existing
variable ETHx_GATEWAY6. The ETHx_GATEWAY6 used until now will
be depracated in future relase (ET spring 2022).

See:
- new variable - https://github.com/OpenNebula/one/commit/e4d2cc11b9f3c6d01b53774b831f48d9d089c1cc
- deprecation tracking issue - https://github.com/OpenNebula/one/issues/5536

Also, added support for SET_HOSTNAME context variable, which is
currently widely used variable to configure guest VM hostname. See
https://docs.opennebula.io/6.0/management_and_operations/references/template.html#context-section</content>
</entry>
</feed>
