<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/cmd, branch sagitta</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=sagitta</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=sagitta'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2022-01-19T03:46:14+00:00</updated>
<entry>
<title>cmd: status and cloud-id avoid change in behavior for 'not run' (#1197)</title>
<updated>2022-01-19T03:46:14+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2022-01-19T03:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=20bd192db661e519b860a0799de04c663ceae0c6'/>
<id>urn:sha1:20bd192db661e519b860a0799de04c663ceae0c6</id>
<content type='text'>
snapd currrently looks for 'not run' from cloud-init status[1].
Avoid changing this behavior and revert "not-run" value to
"not run".

This avoids having to get snapd to change implementation and
release updates as far back as Bionic to handle a hyphenated
not-run string.

[1]: https://github.com/snapcore/snapd/blob/master/sysconfig/\
     cloudinit.go#L802</content>
</entry>
<entry>
<title>cli: cloud-id report not-run or disabled state as cloud-id (#1162)</title>
<updated>2022-01-13T17:12:23+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2022-01-13T17:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=0de7acb194dc15650eee1d5332efed82ef162f84'/>
<id>urn:sha1:0de7acb194dc15650eee1d5332efed82ef162f84</id>
<content type='text'>
This fix has two elements:
 - cloud-init status will not correctly report 'not-run' prior to systemd
   generator running. Only report "disabled" when generator has run
   and /run/cloud-init/disabled exists.
 -  Expose not-run and disabled state in cloud-id responses
 -  Add unique error codes from cloud-id for error, disabled and not-run.
  
The new cloud-id exit codes:
 0: success
 1: error
 2: cloud-init is in disabled state
 3: cloud-init generator has not run yet</content>
</entry>
<entry>
<title>Remove 3.5 and xenial support (SC-711) (#1167)</title>
<updated>2022-01-10T22:56:29+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2022-01-10T22:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=dc1aabfca851e520693c05322f724bd102c76364'/>
<id>urn:sha1:dc1aabfca851e520693c05322f724bd102c76364</id>
<content type='text'>
Includes:
 - Update tox.ini and .travis.yml accordingly
 - Cleanup tox.ini with new tox syntax and cloud-init dependencies
 - Update documentation accordingly
 - Replace/remove xenial references where additional testing isn't required
 - Remove xenial checks in integration tests
 - Replace yield_fixture with fixture in pytest tests

Sections of code commented with lines like "Remove when Xenial is no
longer supported" still exist as they're require additional testing.</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>tests/cmd/query: fix test run as root and add coverage for defaults (#1156)</title>
<updated>2021-12-14T16:53:56+00:00</updated>
<author>
<name>Chris Patterson</name>
<email>cpatterson@microsoft.com</email>
</author>
<published>2021-12-14T16:53:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3da3bdae5e5b41bb3a9f6b23c8573c8fbc23e629'/>
<id>urn:sha1:3da3bdae5e5b41bb3a9f6b23c8573c8fbc23e629</id>
<content type='text'>
test_handle_args_error_on_invalid_vaname_paths() would fail when run
as root due to invocation of load_userdata() on the default user/vendor
data locations under the instance link.

- Mock load_userdata() for this test case to avoid loads.
- Update _setup_paths() to configure cloud_dir in temporary location.
- Add new test case to verify that the default locations are loaded
  when unspecified.

LP: #1825027

Signed-off-by: Chris Patterson &lt;cpatterson@microsoft.com&gt;</content>
</entry>
<entry>
<title>Add Strict Metaschema Validation (#1101)</title>
<updated>2021-12-06T22:27:12+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-06T22:27:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=bedac77e9348e7a54c0ec364fb61df90cd893972'/>
<id>urn:sha1:bedac77e9348e7a54c0ec364fb61df90cd893972</id>
<content type='text'>
Improve schema validation.

This adds strict validation of config module definitions at testing
time, with plumbing included for future runtime validation. This
eliminates a class of bugs resulting from schemas that have definitions
that are incorrect, but get interpreted by jsonschema as
"additionalProperties" that are therefore ignored.

- Add strict meta-schema for jsonschema unit test validation
- Separate schema from module metadata structure
- Improve type annotations for various functions and data types

Cleanup:
- Remove unused jsonschema "required" elements 
- Eliminate manual memoization in schema.py:get_schema(),
        reference module.__doc__ directly</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>Add "install hotplug" module (SC-476) (#1069)</title>
<updated>2021-10-27T14:43:34+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-27T14:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=1d01da5d9916d97ef463ba61a36b3f98f8911419'/>
<id>urn:sha1:1d01da5d9916d97ef463ba61a36b3f98f8911419</id>
<content type='text'>
This commit removes automatically installing udev rules for hotplug
and adds a module to install them instead.

Automatically including the udev rules and checking if hotplug was
enabled consumed too many resources in certain circumstances. Moving the
rules to a module ensures we don't spend extra extra cycles on hotplug
if hotplug functionality isn't desired.

LP: #1946003</content>
</entry>
<entry>
<title>Initial hotplug support (#936)</title>
<updated>2021-07-19T19:13:21+00:00</updated>
<author>
<name>James Falcon</name>
<email>therealfalcon@gmail.com</email>
</author>
<published>2021-07-19T19:13:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=184c836a16e9954a2cba11ae21f07923077ec904'/>
<id>urn:sha1:184c836a16e9954a2cba11ae21f07923077ec904</id>
<content type='text'>
Adds a udev script which will invoke a hotplug hook script on all net
add events. The script will write some udev arguments to a systemd FIFO
socket (to ensure we have only instance of cloud-init running at a
time), which is then read by a new service that calls a new 'cloud-init
devel hotplug-hook' command to handle the new event.

This hotplug-hook command will:
- Fetch the pickled datsource
- Verify that the hotplug event is supported/enabled
- Update the metadata for the datasource
- Ensure the hotplugged device exists within the datasource
- Apply the config change on the datasource metadata
- Bring up the new interface (or apply global network configuration)
- Save the updated metadata back to the pickle cache

Also scattered in some unrelated typing where helpful</content>
</entry>
</feed>
