<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/cloudinit/net/tests/test_dhcp.py, branch 22.1</title>
<subtitle> (mirror of https://github.com/marekm72/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=22.1</id>
<link rel='self' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=22.1'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/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/marekm72/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>Add connectivity_url to Oracle's EphemeralDHCPv4 (#988)</title>
<updated>2021-09-17T18:04:07+00:00</updated>
<author>
<name>James Falcon</name>
<email>therealfalcon@gmail.com</email>
</author>
<published>2021-09-17T18:04:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=612e39087aee3b1242765e7c4f463f54a6ebd723'/>
<id>urn:sha1:612e39087aee3b1242765e7c4f463f54a6ebd723</id>
<content type='text'>
Add connectivity_url to Oracle's EphemeralDHCPv4

On bionic, when trying to bring up the EphemeralDHCPv4, it's possible
that we already have a route defined, which will result in an error when
trying to add the DHCP route. Use the connectivity_url to check if we
can reach the metadata service, and if so, skip the EphemeralDHCPv4.

The has_url_connectivity function has also been modified to take
a dict of kwargs to send to readurl.

LP: #1939603</content>
</entry>
<entry>
<title>Allow braces to appear in dhclient output (#911)</title>
<updated>2021-06-01T22:30:00+00:00</updated>
<author>
<name>eb3095</name>
<email>45504889+eb3095@users.noreply.github.com</email>
</author>
<published>2021-06-01T22:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=503e2d398660e8af5d49bdf6944a50ad793a3a31'/>
<id>urn:sha1:503e2d398660e8af5d49bdf6944a50ad793a3a31</id>
<content type='text'>
dhclient output that contains brackets for pxe variables will break 
the dhclient parsing regex line. This fix retains the current                   
functionality while fixing this particular issue.</content>
</entry>
<entry>
<title>bringup_static_routes: fix gateway check (#850)</title>
<updated>2021-04-07T16:16:30+00:00</updated>
<author>
<name>Petr Fedchenkov</name>
<email>giggsoff@gmail.com</email>
</author>
<published>2021-04-07T16:16:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=15dd3601c484e189ea82917600322b7d0e25c088'/>
<id>urn:sha1:15dd3601c484e189ea82917600322b7d0e25c088</id>
<content type='text'>
When bringing up DHCP-provided static routes, we check for "0.0.0.0/0"
to indicate an unspecified gateway. However, when parsing the static
route in `parse_static_routes`, the gateway is never specified with
a net length, so the "/0" will never happen.

This change updates the gateway check to check only for "0.0.0.0".</content>
</entry>
<entry>
<title>DHCP sandboxing failing on noexec mounted /var/tmp (#521)</title>
<updated>2020-08-24T13:34:24+00:00</updated>
<author>
<name>Eduardo Otubo</name>
<email>otubo@redhat.com</email>
</author>
<published>2020-08-24T13:34:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=db86753f81af73826158c9522f2521f210300e2b'/>
<id>urn:sha1:db86753f81af73826158c9522f2521f210300e2b</id>
<content type='text'>
* DHCP sandboxing failing on noexec mounted /var/tmp

If /var/tmp is mounted with noexec option the DHCP sandboxing will fail
with Permission Denied. This patch simply avoids this error by checking
the exec permission updating the dhcp path in negative case.

rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=1857309

Signed-off-by: Eduardo Otubo &lt;otubo@redhat.com&gt;

* Replacing with os.* calls

* Adding test and removing isfile() useless call.

Co-authored-by: Rick Harding &lt;rharding@mitechie.com&gt;</content>
</entry>
<entry>
<title>printing the error stream of the dhclient process before killing it (#369)</title>
<updated>2020-06-19T13:38:05+00:00</updated>
<author>
<name>Moustafa Moustafa</name>
<email>momousta@microsoft.com</email>
</author>
<published>2020-06-19T13:38:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=d083a0315faf67c00acdecdc3f95c700edf6ba06'/>
<id>urn:sha1:d083a0315faf67c00acdecdc3f95c700edf6ba06</id>
<content type='text'>
This introduces a way to log the dhclient error stream, and uses it for the Azure datasource (where we have a specific requirement for this data to be logged).</content>
</entry>
<entry>
<title>Move subp into its own module. (#416)</title>
<updated>2020-06-08T16:49:12+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@brickies.net</email>
</author>
<published>2020-06-08T16:49:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=3c551f6ebc12f7729a2755c89b19b9000e27cc88'/>
<id>urn:sha1:3c551f6ebc12f7729a2755c89b19b9000e27cc88</id>
<content type='text'>
This was painful, but it finishes a TODO from cloudinit/subp.py.

It moves the following from util to subp:
  ProcessExecutionError
  subp
  which
  target_path

I moved subp_blob_in_tempfile into cc_chef, which is its only caller.
That saved us from having to deal with it using write_file
and temp_utils from subp (which does not import any cloudinit things now).

It is arguable that 'target_path' could be moved to a 'path_utils' or
something, but in order to use it from subp and also from utils,
we had to get it out of utils.</content>
</entry>
<entry>
<title>test: fix all flake8 E241 (#403)</title>
<updated>2020-06-02T15:24:29+00:00</updated>
<author>
<name>Joshua Powers</name>
<email>josh.powers@canonical.com</email>
</author>
<published>2020-06-02T15:24:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=5f7825e22241423322dbe628de1b00289cf34114'/>
<id>urn:sha1:5f7825e22241423322dbe628de1b00289cf34114</id>
<content type='text'>
Remove extra spaces after a ','</content>
</entry>
<entry>
<title>cloudinit: drop dependencies on unittest2 and contextlib2 (#322)</title>
<updated>2020-04-24T13:26:51+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>oddbloke@ubuntu.com</email>
</author>
<published>2020-04-24T13:26:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=38a7e6e9756fdab31264c0d6e93d20432ed111ac'/>
<id>urn:sha1:38a7e6e9756fdab31264c0d6e93d20432ed111ac</id>
<content type='text'>
These libraries provide backports of Python 3's stdlib components to Python 2. As we only support Python 3, we can simply use the stdlib now. This pull request does the following:

* removes some unneeded compatibility code for the old spelling of `assertRaisesRegex`
* replaces invocations of the Python 2-only `assertItemsEqual` with its new name, `assertCountEqual`
* replaces all usage of `unittest2` with `unittest`
* replaces all usage of `contextlib2` with `contextlib`
* drops `unittest2` and `contextlib2` from requirements files and tox.ini

It also rewrites some `test_azure` helpers to use bare asserts. We were seeing a strange error in xenial builds of this branch which appear to be stemming from the AssertionError that pytest produces being _different_ from the standard AssertionError.  This means that the modified helpers weren't behaving correctly, because they weren't catching AssertionErrors as one would expect. (I believe this is related, in some way, to https://github.com/pytest-dev/pytest/issues/645, but the only version of pytest where we're affected is so far in the past that it's not worth pursuing it any further as we have a workaround.)</content>
</entry>
<entry>
<title>dhcp: Support RedHat dhcp rfc3442 lease format for option 121 (#76)</title>
<updated>2019-12-10T00:48:37+00:00</updated>
<author>
<name>Eric Lafontaine</name>
<email>eric.lafontaine@bell.ca</email>
</author>
<published>2019-12-10T00:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a47405af306219d804ed262d6f7e2039a75883f2'/>
<id>urn:sha1:a47405af306219d804ed262d6f7e2039a75883f2</id>
<content type='text'>
RedHat dhcp client writes out rfc3442 classless-static-routes in a different format[1]
than what is found in isc-dhcp clients.  This patch adds support for the RedHat format.

1. Background details on the format
 https://bugzilla.redhat.com/show_bug.cgi?id=516325
 https://github.com/vaijab/fedora-dhcp/blob/e83fb19c51765442d77fa60596bfdb2b3b9fbe2e/dhcp-rfc3442-classless-static-routes.patch#L252 
 https://github.com/heftig/NetworkManager/blob/f56c82d86122fc45304fc829b5f1e4766ed51589/src/dhcp-manager/nm-dhcp-client.c#L978

LP: #1850642</content>
</entry>
</feed>
