<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_datasource/test_hetzner.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>Hetzner: Fix instance_id / SMBIOS serial comparison (#640)</title>
<updated>2020-10-30T18:12:25+00:00</updated>
<author>
<name>Markus Schade</name>
<email>markus.schade@hetzner.com</email>
</author>
<published>2020-10-30T18:12:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=0f8be879073148f1d67094df9ec895a873caa0d7'/>
<id>urn:sha1:0f8be879073148f1d67094df9ec895a873caa0d7</id>
<content type='text'>
Fixes erroneous string/int comparison introduced in 1431c8a

metadata['instance-id'] is an integer but the value read from smbios is
a string.  The comparision would cause TypeError.
</content>
</entry>
<entry>
<title>Hetzner: initialize instance_id from system-serial-number (#630)</title>
<updated>2020-10-29T14:45:47+00:00</updated>
<author>
<name>Markus Schade</name>
<email>markus.schade@hetzner.com</email>
</author>
<published>2020-10-29T14:45:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=1431c8a1bddaabf85e1bbb32bf316a3aef20036e'/>
<id>urn:sha1:1431c8a1bddaabf85e1bbb32bf316a3aef20036e</id>
<content type='text'>
Hetzner Cloud also provides the instance ID in SMBIOS information. Use
it to locally check_instance_id and to compared with instance_id from
metadata service.

LP: #1885527</content>
</entry>
<entry>
<title>Hetzner: support reading user-data that is base64 encoded. (#448)</title>
<updated>2020-06-22T18:44:37+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@brickies.net</email>
</author>
<published>2020-06-22T18:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=76652f3e07b6f659b2fd166a6619cb427dc6bc7e'/>
<id>urn:sha1:76652f3e07b6f659b2fd166a6619cb427dc6bc7e</id>
<content type='text'>
Hetzner cloud only supports user-data as a string (presumably utf-8).

In order to allow users on Hetzner to provide binary data to cloud-init,
we will attempt to base64decode the userdata.

The change here adds a 'maybe_b64decode' function that will decode data
if and only if is base64 encoded.

The reason for not using util.b64d is that we do not want the return value
decoded to a string, and util.b64d will do that if it can.  Additionally
we call decode with validate=True which oddly is not the default.

LP: #1884071</content>
</entry>
<entry>
<title>Hetzner: Exit early if dmi system-manufacturer is not Hetzner.</title>
<updated>2018-03-27T18:03:39+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-03-27T18:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=5e4641a3cd5eac5cbf8ffd13d32514fbb9424077'/>
<id>urn:sha1:5e4641a3cd5eac5cbf8ffd13d32514fbb9424077</id>
<content type='text'>
This takes the same basic check that is in ds-identify.  If the
DMI system manufacturer (aka sys_vendor) is not 'Hetzner', then exit
out of the datasource's get_data quickly.
</content>
</entry>
<entry>
<title>Add Hetzner Cloud DataSource</title>
<updated>2018-03-19T18:50:54+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-03-19T18:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=e88e35483e373b39b4485f30f7a867f50571027c'/>
<id>urn:sha1:e88e35483e373b39b4485f30f7a867f50571027c</id>
<content type='text'>
The Hetzner Cloud metadata service is an AWS-style service available
over HTTP via the link local address 169.254.169.254.

https://hetzner.com/cloud
https://docs.hetzner.cloud/
</content>
</entry>
</feed>
