<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_ds_identify.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>2022-01-10T22:05:52+00:00</updated>
<entry>
<title>tests: mock LXD datasource detection in ds-identify on LXD containers (#1178)</title>
<updated>2022-01-10T22:05:52+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2022-01-10T22:05:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=57ccd89b6af7d3551915df56f548b7617dfcebf9'/>
<id>urn:sha1:57ccd89b6af7d3551915df56f548b7617dfcebf9</id>
<content type='text'>
On LXD containers /dev/lxd/sock will always exist.

Mock dscheck_LXD to return 1 (NOT_FOUND) to avoid leaking into
test environment and returning LXD as detected.

We have integration tests covering proper LXD datasource detection
so we don't need a Unit test validating the [ -S /dev/lxd/sock] that
is in ds-identify.</content>
</entry>
<entry>
<title>Adopt Black and isort (SC-700) (#1157)</title>
<updated>2021-12-16T02:16:38+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-12-16T02:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf'/>
<id>urn:sha1:bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf</id>
<content type='text'>
Applied Black and isort, fixed any linting issues, updated tox.ini
and CI.
</content>
</entry>
<entry>
<title>factor out function for getting top level directory of cloudinit (#1136)</title>
<updated>2021-12-08T21:27:37+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-08T21:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=65c2cfd7f21758746444c8c79444994a4638d563'/>
<id>urn:sha1:65c2cfd7f21758746444c8c79444994a4638d563</id>
<content type='text'>
Add a test helper to get top level directory

Many tests need to get the location of files &amp; dirs within the cloud-init
project directory.

Tests implement this in various different ways, and often those ways
depend on the current working directory of the pytest invocation.
Create helper functions (and tests) that gets the path of the top
directory or any sub directory under the top directory. This function
does not depend on the environment.</content>
</entry>
<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>VMWARE: search the deployPkg plugin in multiarch dir (#1061)</title>
<updated>2021-10-12T03:54:31+00:00</updated>
<author>
<name>xiaofengw-vmware</name>
<email>42736879+xiaofengw-vmware@users.noreply.github.com</email>
</author>
<published>2021-10-12T03:54:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=76166caff42b82aa55c6bcd9528f2c1e3575232a'/>
<id>urn:sha1:76166caff42b82aa55c6bcd9528f2c1e3575232a</id>
<content type='text'>
Due to multiarch, the libdeployPkgPlugin.so is deployed into dir
/usr/lib/&lt;multiarch name&gt;/open-vm-tools, we need to add this path
into search_paths.

LP: #1944946</content>
</entry>
<entry>
<title>Datasource for VMware (#953)</title>
<updated>2021-08-10T02:24:07+00:00</updated>
<author>
<name>Andrew Kutz</name>
<email>101085+akutz@users.noreply.github.com</email>
</author>
<published>2021-08-10T02:24:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=8b4a9bc7b81e61943af873bad92e2133f8275b0b'/>
<id>urn:sha1:8b4a9bc7b81e61943af873bad92e2133f8275b0b</id>
<content type='text'>
This patch finally introduces the Cloud-Init Datasource for VMware
GuestInfo as a part of cloud-init proper. This datasource has existed
since 2018, and rapidly became the de facto datasource for developers
working with Packer, Terraform, for projects like kube-image-builder,
and the de jure datasource for Photon OS.

The major change to the datasource from its previous incarnation is
the name. Now named DatasourceVMware, this new version of the
datasource will allow multiple transport types in addition to
GuestInfo keys.

This datasource includes several unique features developed to address
real-world situations:

  * Support for reading any key (metadata, userdata, vendordata) both
    from the guestinfo table when running on a VM in vSphere as well as
    from an environment variable when running inside of a container,
    useful for rapid dev/test.

  * Allows booting with DHCP while still providing full participation
    in Cloud-Init instance data and Jinja queries. The netifaces library
    provides the ability to inspect the network after it is online,
    and the runtime network configuration is then merged into the
    existing metadata and persisted to disk.

  * Advertises the local_ipv4 and local_ipv6 addresses via guestinfo
    as well. This is useful as Guest Tools is not always able to
    identify what would be considered the local address.

The primary author and current steward of this datasource spoke at
Cloud-Init Con 2020 where there was interest in contributing this datasource
to the Cloud-Init codebase.

The datasource currently lives in its own GitHub repository at
https://github.com/vmware/cloud-init-vmware-guestinfo. Once the datasource
is merged into Cloud-Init, the old repository will be deprecated.</content>
</entry>
<entry>
<title>replace usage of dmidecode with kenv on FreeBSD (#621)</title>
<updated>2020-11-06T18:49:05+00:00</updated>
<author>
<name>Mina Galić</name>
<email>me+git@igalic.co</email>
</author>
<published>2020-11-06T18:49:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=d83c0bb4baca0b57166a74055f410fa4f75a08f5'/>
<id>urn:sha1:d83c0bb4baca0b57166a74055f410fa4f75a08f5</id>
<content type='text'>
FreeBSD lets us read out kernel parameters with kenv(1), a user-space
utility that's shipped in "base" We can use it in place of dmidecode(8),
thus removing the dependency on sysutils/dmidecode, and the restrictions
to i386 and x86_64 architectures that this utility imposes on FreeBSD.

Co-authored-by: Scott Moser &lt;smoser@brickies.net&gt;</content>
</entry>
<entry>
<title>split read_fs_info into linux &amp; freebsd parts (#625)</title>
<updated>2020-11-04T14:49:34+00:00</updated>
<author>
<name>Mina Galić</name>
<email>me+git@igalic.co</email>
</author>
<published>2020-11-04T14:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=cf6c36a18de233190996f7c2dde1e04908bad50a'/>
<id>urn:sha1:cf6c36a18de233190996f7c2dde1e04908bad50a</id>
<content type='text'>
FreeBSD doesn't have blkid, so we want to use geom to list devices and
their fstypes and labels.

This PR also adds `jail` to the list of is_container()
And we now also properly cache geom and blkid output!

A test is added to verify the new behaviour by correctly identifying
NoCloud on FreeBSD.

Co-authored-by: Scott Moser &lt;smoser@brickies.net&gt;</content>
</entry>
<entry>
<title>Recognize LABEL_FATBOOT labels (#513)</title>
<updated>2020-08-07T15:19:09+00:00</updated>
<author>
<name>James Falcon</name>
<email>TheRealFalcon@users.noreply.github.com</email>
</author>
<published>2020-08-07T15:19:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=c068f992c3905d07732dafa6eb61c1ae3aa65916'/>
<id>urn:sha1:c068f992c3905d07732dafa6eb61c1ae3aa65916</id>
<content type='text'>
Update DataSourceNoCloud and ds-identify to recognize LABEL_FATBOOT labels from blkid.
Also updated associated tests.

LP: #1841466</content>
</entry>
<entry>
<title>RbxCloud: Add support for FreeBSD (#464)</title>
<updated>2020-06-29T17:52:13+00:00</updated>
<author>
<name>Adam Dobrawy</name>
<email>ad-m@users.noreply.github.com</email>
</author>
<published>2020-06-29T17:52:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=baf11418c196ca72e6d570b64051d8ed35065abb'/>
<id>urn:sha1:baf11418c196ca72e6d570b64051d8ed35065abb</id>
<content type='text'>
Changes are made that simplify code and aim to properly support FreeBSD:

- use `util.find_devs_with` instead call directly `blkid`, because on FreeBSD is not supported well and `util.find_devs_with` have solution for FreeBSD for that
- introduction of an additional name on FAT file system, which is used in FreeBSD
- drop shell to use default value, because FreeBSD – by default – does not have `/bin/bash`</content>
</entry>
</feed>
