<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_datasource/test_azure.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>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>tox: bump the pinned flake8 and pylint version (#1029)</title>
<updated>2021-09-21T20:28:30+00:00</updated>
<author>
<name>Paride Legovini</name>
<email>paride.legovini@canonical.com</email>
</author>
<published>2021-09-21T20:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=089a307db1fc572461eea1589f1876132c058311'/>
<id>urn:sha1:089a307db1fc572461eea1589f1876132c058311</id>
<content type='text'>
tox: bump the pinned flake8 and pylint version

* pylint: fix W1406 (redundant-u-string-prefix)

The u prefix for strings is no longer necessary in Python &gt;=3.0.

* pylint: disable W1514 (unspecified-encoding)
    
From https://www.python.org/dev/peps/pep-0597/ (Python 3.10):
    
The new warning stems form https://www.python.org/dev/peps/pep-0597,
which says:
    
  Developers using macOS or Linux may forget that the default encoding
  is not always UTF-8. [...] Even Python experts may assume that the
  default encoding is UTF-8. This creates bugs that only happen on Windows.
    
The warning could be fixed by always specifying encoding='utf-8',
however we should be careful to not break environments which are not
utf-8 (or explicitly state that only utf-8 is supported). Let's silence
the warning for now.

* _quick_read_instance_id: cover the case where load_yaml() returns None

Spotted by pylint:
 - E1135 (unsupported-membership-test)
 - E1136 (unsubscriptable-object)

LP: #1944414</content>
</entry>
<entry>
<title>Azure: Retry dhcp on timeouts when polling reprovisiondata (#998)</title>
<updated>2021-08-24T20:45:41+00:00</updated>
<author>
<name>aswinrajamannar</name>
<email>39812128+aswinrajamannar@users.noreply.github.com</email>
</author>
<published>2021-08-24T20:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=28e56d993fc40feab139f149dacc10cae51a3fe0'/>
<id>urn:sha1:28e56d993fc40feab139f149dacc10cae51a3fe0</id>
<content type='text'>
In the nic attach path, we skip doing dhcp since we already did it
when bringing the interface up. However when polling for
reprovisiondata, it is possible for the request to timeout due to
platform issues. In those cases we still need to do dhcp and try again
since we tear down the context. We can only skip the first dhcp
attempt.</content>
</entry>
<entry>
<title>Azure: During primary nic detection, check interface status continuously before rebinding again (#990)</title>
<updated>2021-08-20T22:53:18+00:00</updated>
<author>
<name>aswinrajamannar</name>
<email>39812128+aswinrajamannar@users.noreply.github.com</email>
</author>
<published>2021-08-20T22:53:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3ec8ddde0d1d2fd8597f7d2915baa3e328552ab1'/>
<id>urn:sha1:3ec8ddde0d1d2fd8597f7d2915baa3e328552ab1</id>
<content type='text'>
Add 10 second polling loop in wait_for_link_up after performing
an unbind and re-bind of primary NIC in hv_netvsc driver.

Also reduce cloud-init logging levels to debug for these operations.</content>
</entry>
<entry>
<title>Azure: Check if interface is up after sleep when trying to bring it up (#972)</title>
<updated>2021-08-12T19:44:53+00:00</updated>
<author>
<name>aswinrajamannar</name>
<email>39812128+aswinrajamannar@users.noreply.github.com</email>
</author>
<published>2021-08-12T19:44:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=e119ceceb7d76af7d75c04a8779b9c5fc68083a8'/>
<id>urn:sha1:e119ceceb7d76af7d75c04a8779b9c5fc68083a8</id>
<content type='text'>
When bringing interface up by unbinding and then binding hv_netvsc
driver, it might take a short delay after binding for the link to be
up. So before trying unbind/bind again after sleep, check if the link
is up. This is a corner case when a preprovisioned VM is reused and
the NICs are hot-attached.</content>
</entry>
<entry>
<title>Azure: Limit polling network metadata on connection errors (#961)</title>
<updated>2021-08-10T19:28:00+00:00</updated>
<author>
<name>aswinrajamannar</name>
<email>39812128+aswinrajamannar@users.noreply.github.com</email>
</author>
<published>2021-08-10T19:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=d3271217e2745fb0e3405bd093b61c39fe0708a7'/>
<id>urn:sha1:d3271217e2745fb0e3405bd093b61c39fe0708a7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Azure: mount default provisioning iso before try device listing (#870)</title>
<updated>2021-07-19T21:45:02+00:00</updated>
<author>
<name>Anh Vo</name>
<email>anhvo@microsoft.com</email>
</author>
<published>2021-07-19T21:45:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a984ee78b745b157b4b023a1786bfbd3b2002b88'/>
<id>urn:sha1:a984ee78b745b157b4b023a1786bfbd3b2002b88</id>
<content type='text'>
With a few exceptions, Azure VM deployments receive provisioning
metadata through the provisioning iso presented as a cdrom device
(/dev/sr0). The existing code attempts to find this device by calling
blkid to find all devices that have either type iso9660 or udf. This
can be very expensive if the VM has a lot of disks. This commit will
attempt to mount the default iso location first and only tries to use
blkid to locate the iso location if the default mounting location fails</content>
</entry>
</feed>
