| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Test failures may have truncated assertions using `...` in some
output.
Increase verbosity and print locals to help with triaging failures
caught in CI, particularly as some environments may not be readily
testable locally.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
|
|
|
|
|
|
| |
Using individual release and platform marks to specify our test support
matrix was leading to too many marks specifying different combinations
of things. Rather, we can rely on the "skipif" mark to perform any
needed release or platform checks.
|
| |
|
|
|
|
|
| |
Add fixture to disallow dns lookups by
default in a common utility function.
|
|
|
| |
Add schema auto-format to tox and a CI test
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Added new pytest marker to define IntegrationCloud customizations.
Migrate test_lp1835584 to use this functionality.
Bump pycloudlib version.
|
|
|
|
|
|
|
|
| |
Add new `activate_by_schema_keys` property to `MetaSchema` defining
the schema keys that must be present, to avoid skipping the module.
Add this new key to our schema docs.
Add documentation to `topics/module_creation`.
Import TypedDict from typing_extensions TypedDict and gate it within
TYPE_CHECKING to avoid runtime import concerns.
|
|
|
| |
Add tox target for tracing for resource leaks, fix some leaks
|
|
|
|
|
|
|
|
|
| |
lowest-supported-dev requires running with python 3.6, which few people
will be running locally.
hypothesis-slow is being removed because fuzz testing
shouldn't be a gate for new features.
LP: #1980854
|
|
|
|
|
| |
- add a tox target for running unit tests in parallel
- add missing mocks
- make parametrized gzip bytes deterministic
|
|
|
|
|
|
|
| |
- Add `hypothesis` and `hypothesis-jsonschema`
- Add `hypothesis-slow` tox env to run slow tests
- Implement `JsonLocalResolver` to avoid `hypothesis-jsonschema` errors
- Add fuzz test covering `validate_cloudconfig_schema`
|
|
|
| |
Add make helpers to do and check fmt
|
|
|
|
|
|
|
|
|
|
| |
Changes:
* Tox: the tip-black and tip-isort environments.
* Tox: reuse the non-tip commands in the tip- environments.
* Add non-blocking (continue-on-error: true) step in the test
test matrix to run the tip- linters on ubuntu-latest.
* Code fixups to make tip-pylint pass.
* Bump the pinned pylint version to 2.13.9 (last version
supporting Python 3.6).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change a single test failure when running the
integration-tests-jenkins tox environment caused Jenkins jobs to fully
fail (status FAILURE).
With this change the pytest's "some tests failed" return code [1] is
ignored, and the status of the Jenkins jobs is determined using the
junit report that pytest generates. Most of the time this will result
in UNSTABLE (yellow) jobs when some tests failed.
If the junit report is missing (or only reports failures) the job
will still be marked as FAILURE (red).
[1] https://docs.pytest.org/en/7.1.x/reference/exit-codes.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For primary network config:
- Use `iSCSI` config if some `/run/net*` file exists, even if
`/run/initramfs/open-iscsi.interface` does not.
- If the instance is not an `iSCSI` one, then crawl the network
config from `IMDS` instead of falling back to "best guess".
- Remove unnecessary conditional use of dhcp.EphemeralDHCPv4
and use it always to crawl `IMDS`.
- Migrate tests to pytest.
- Extend unit test coverage.
- Add some types for mypy.
LP: #1967942
|
| |
|
| |
|
|
|
|
|
|
|
| |
Changes:
- pylint 2.13.8: fix E0601(used-before-assignment)
- pylint 2.13.8: fix E4702(modified-iterating-dict)
- pylint 2.13.8: silence W0402(deprecated-module) on distutils.errors
- tox: bump linters versions
|
|
|
|
|
|
|
| |
- Remove Sphinx build warnings
- Turn Sphinx warnings into errors
LP: #1876341
SC-894
|
|
|
|
|
|
|
|
|
|
| |
Adds the ability for growpart to resize a LUKS formatted partition.
This involves resizing the underlying partition as well as the
filesystem. 'cryptsetup' is used for resizing.
This relies on a file present at /cc_growpart_keydata containing
json formatted 'key' and 'slot' keys, with the key being
base64 encoded. After resize, cloud-init will destroy
the luks slot used for resizing and remove the key file.
|
|
|
|
|
|
|
|
|
| |
- add support for parallel http(s) requests to wait_for_url()
- implementation based loosely on RFC6555: "Happy Eyeballs" [1]
- update ec2 datasource to support dual-stack ipv6/ipv4
- only "nitro" instances have ipv6 IMDS, favor ipv4 initially
- replace httpretty with responses for ec2 tests
[1] https://datatracker.ietf.org/doc/html/rfc6555
|
|
|
|
|
|
|
|
| |
- add type stubs for mypy: jsonschema, oauthlib
- specify mypy directories to avoid env/ false positive
- add conftest.py and setup.py
- make setup.py pass pylint:
- check ./tools/render-cloudcfg return code in setup.py
- find_sources() has no return code, don't check for one
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Black < 22.3.0 didn't handle a dropped internal attribute _unicodefun
from in more click package version 8.1.0. Due to issue
Issue: https://github.com/psf/black/issues/2964
This broke our CI and tox -e do_format targets with
cannot import name '_unicodefun' from 'click'.
Increment our pinned black to 22.3.0 and apply minor format
change rules.
|
|
|
| |
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
|
|
|
|
|
|
|
|
|
|
|
| |
All currently failing modules are excluded from reporting
errors using follow-imports=silent and an exclusion list.
Future work can whittle down this failing list. This change will
start enforcing new modules and those currently passing.
Includes some minor alphabetical reordering in tox.ini.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
|
|
|
|
|
|
| |
* Include CI and Fixtures sections in integration test docs
* Incorporate additional variable annotations
* Remove unnecessary IntegrationInstance subclasses
* Move setup_image teardown into its fixture
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Applied Black and isort, fixed any linting issues, updated tox.ini
and CI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 -> tests/unittests/helpers.py
# Move directories:
cloudinit/distros/tests -> tests/unittests/distros
cloudinit/cmd/devel/tests -> tests/unittests/cmd/devel
cloudinit/cmd/tests -> tests/unittests/cmd/
cloudinit/sources/helpers/tests -> tests/unittests/sources/helpers
cloudinit/sources/tests -> tests/unittests/sources
cloudinit/net/tests -> tests/unittests/net
cloudinit/config/tests -> tests/unittests/config
cloudinit/analyze/tests/ -> tests/unittests/analyze/
# Standardize tests already in tests/unittests/
test_datasource -> sources
test_distros -> distros
test_vmware -> sources/vmware
test_handler -> config # this contains cloudconfig module tests
test_runs -> runs
|
|
|
|
|
|
| |
In jsonschema 4, hostname validation was changed to have an optional
dependency on the fqdn package. Since we don't have this dependency
in cloud-init, attempting this validation will no longer fail for
a string that isn't a valid hostname.
|
|
|
|
|
|
| |
*_proxy: required for https_proxy and no_proxy
GOOGLE_* and GCP_*: see [1].
https://cloud.google.com/functions/docs/configuring/env-var#runtime_environment_variables_set_automatically
|
|
|
|
| |
On unit tests, tox is attempting to install 4.0, which fails two of
the unit tests, and fails python 3.5 as it is not compatible.
|
|
|
| |
Cloud tests have been replaced with integration tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 >=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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using flake8 inplace of pyflakes
Renamed run-pyflakes -> run-flake8
Changed target name to flake8 in Makefile
With pyflakes we can't suppress warnings/errors in few required places.
flake8 is flexible in that regard. Hence using flake8 seems to be a
better choice here.
flake8 does the job of pep8 anyway.
So, removed pep8 target from Makefile along with tools/run-pep8 script.
Included setup.py in flake8 checks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In CI run against pylint 2.9.3 and fix occurrences of:
- W0237 (arguments-renamed)
- W0402 (deprecated-module)
The W0402 deprecated-module was about module `imp`:
cloudinit/patcher.py:9: [W0402(deprecated-module), ]
Uses of a deprecated module 'imp'
The imp module is deprecated and replaced by importlib, which according
to the documentation has no replacement for acquire_lock() and
release_lock(), which are the only reason why `imp` is imported.
Nothing about the code using this lock that actually requires it.
Let's remove the locking code and the import altogether.
Dropping the locking makes patcher.patch() an empty wrapper around
_patch_logging(). Rename _patch_logging() to patch_logging() and
call it directly instead. Drop patch().
|
|
|
| |
Also new jenkins tox definition
|
|
|
|
|
|
|
| |
In #856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.
Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Control is currently limited to boot events, though this should
allow us to more easily incorporate HOTPLUG support. Disabling
'instance-first-boot' is not supported as we apply networking config
too early in boot to have processed userdata (along with the fact
that this would be a pretty big foot-gun).
The concept of update events on datasource has been split into
supported update events and default update events. Defaults will be
used if there is no user-defined update events, but user-defined
events won't be supplied if they aren't supported.
When applying the networking config, we now check to see if the event
is supported by the datasource as well as if it is enabled.
Configuration looks like:
updates:
network:
when: ['boot']
|
|
|
|
|
|
|
| |
The current method of running a background sleep until travis is
finished is causing integration test runs to pass even when they should
be failing.
Instead, update the code to emit dots itself.
|
|
|
|
|
|
|
|
|
|
| |
The apt default test wasn't ported over from cloud-tests correctly.
uri should be specified in the test, but it was not, so the test
failed on openstack (and likely other platforms) because without
a specified uri, the default uri will vary by platform. I separated
this uri test out into a separate test function.
Also add openstack specific test for apt configuration with no uri.
Other platform-specific tests should be added here over time.
|
|
|
| |
This allows source'd OpenStack credentials to be used for tox tests.
|