Commit Graph

642 Commits (a35e8015e54fb48b748ef827b64201e9964f4754)

Author SHA1 Message Date
Matt Clay a35e8015e5 [stable-2.13] ansible-test - Update git diff handling (#80202)
This change allows ansible-test to work with newer versions of git on AZP.

(cherry picked from commit bad8843124)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 8cc8aa268d [stable-2.13] Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead..
(cherry picked from commit f47bc03599)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 130fbe8ba5 [stable-2.13] ansible-test - Remove pointless comparison (#80168)
(cherry picked from commit 31658031ed)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay a5d7c73cc9 [stable-2.13] ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
(cherry picked from commit 6bfe6b899a)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay ef5842798d [stable-2.13] ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
(cherry picked from commit 5e3db6e441)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 866d91bb7d [stable-2.13] ansible-test - Allow target prefixes to use `_` (#80021)
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
(cherry picked from commit e6cffce0eb)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 8e2148943b
[stable-2.13] ansible-test - Fix file permissions for delegation (#80204)
* [stable-2.13] ansible-test - Fix file permissions for delegation (#79932)

* ansible-test - Fix file permissions for delegation

* Set more restrictive permissions for SSH key

* Check all execute bits, not just owner

* Add a breaking_changes changelog entry.
(cherry picked from commit c8c1402ff6)

Co-authored-by: Matt Clay <matt@mystile.com>

* ansible-test - Fix collection delegation (#79947)

(cherry picked from commit 0793833847)

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
3 years ago
Matt Clay 15e9438b06
[stable-2.13] ansible-test - Fix pylint error with old home dir (#80151) (#80153)
* [stable-2.13] ansible-test - Fix pylint error with old home dir (#80151)
(cherry picked from commit 27287b40c0)

Co-authored-by: Matt Clay <matt@mystile.com>

* ansible-test - Fix error with missing pylint home (#80155)

(cherry picked from commit 367d45facd)
3 years ago
Matt Clay 344230fca5 [stable-2.13] ansible-test - Support Podman 4.4.0+
(cherry picked from commit 67d49734f7)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Felix Fontein 695d3c7927
Bump acme test container. (#79783) (#79815)
(cherry picked from commit 5fb8bc3ddb)
3 years ago
Matt Clay 696b7936a9
[stable-2.13] ansible-test - Specify config path in plugin error (#79881) (#79978)
(cherry picked from commit d48d1c23df)
3 years ago
Matt Clay 522019c317
[stable-2.13] ansible-test - fix warning to include image name (#79560) (#79974)
(cherry picked from commit 0a12d8a5bc)

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
3 years ago
Jordan Borean 2e541a5450 ansible-test - fix ps argspec check inside cmdlet (#79699)
* ansible-test - fix ps argspec check inside cmdlet

* Added error condition test

* Fix sanity problem

(cherry picked from commit ee33be9484)
3 years ago
Matt Clay 9e3363f8b7 [stable-2.13] ansible-test - Improve container startup handling.
Also improve the ansible-test-container integration test:

 - Add coverage for the no-probe code path.
 - Add work-arounds for centos6 containers (to support backporting).
 - Avoid systemd debug when the container doesn't use cgroup.
(cherry picked from commit 04fc98c794)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 55a198da11 [stable-2.13] ansible-test - Support RSA SHA-1 for SSH clients..
(cherry picked from commit 75b60b17ee)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay ad59db8256 [stable-2.13] ansible-test - Fix `--prime-containers` and `--explain` (#79581)
* Remove unused code.
* Fix explain errors.
* Fix `--prime-containers` with docker on cgroup v2.
(cherry picked from commit da3b1d3f50)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 7783c9b1ee [stable-2.13] ansible-test - Fix target PyPI proxy config..
(cherry picked from commit dcc08eec35)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 1d7436935f
[stable-2.13] ansible-test - Improve container management. (#79538)
* ansible-test - More flexible become support.

(cherry picked from commit 5666c6d6a3)

* ansible-test - Add support for more remotes.

(cherry picked from commit 24d91f552c)

* ansible-test - Enable ACLs on FreeBSD remotes.

This allows integration tests to switch from one unprivileged user
to another, sharing files between the users using ACLs.

(cherry picked from commit b63812bc08)

* ansible-test - Enable ACL support on more remotes. (#78299)

(cherry picked from commit 8bb20fe06b)

* ansible-test - Install `acl` on Alpine remotes. (#78303)

(cherry picked from commit 8565deaae3)

* ansible-test - Use sudo for all remotes. (#78310)

(cherry picked from commit f3f4ad9332)

* ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551)

(cherry picked from commit d683c5bd21)

* ansible-test - Verify executables are executable. (#78606)

(cherry picked from commit ece85abbc4)

* ansible-test - Use --tmpfs to run containers. (#78605)

(cherry picked from commit 4187707f03)

* ansible-test - Remove Fedora 35 support. (#78720)

(cherry picked from commit 38a82a5cc4)

* ansible-test - Fix container error handling. (#78739)

(cherry picked from commit 79f67ed561)

* ansible-test - Improve container management. (#78550)

See changelogs/fragments/ansible-test-container-management.yml for details.

(cherry picked from commit cda16cc5e9)

* ansible-test - Fix container detection. (#79530)

(cherry picked from commit 80d2f8da02)

* Update test matrix symlinks. (#78737)

* Add remote platform symlinks.

These were already supported by ansible-test.
This change adds the symlinks for use in the CI test matrix.

* Remove obsolete AIX test symlink.

AIX was already removed from ansible-test.

(cherry picked from commit 62221a3be2)

* Use patched containers without VOLUME instruction.

* Make test suite compatible with older ansible.

* Fix compatibility with Python 3.8.
3 years ago
Matt Clay ea9b9716f0 [stable-2.13] ansible-test - Improve pylint command consistency. (#78896)
* ansible-test - Improve pylint command consistency.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit bc274f5)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 53f2ef7774 [stable-2.13] ansible-test - Fix and update documentation links..
(cherry picked from commit 938c0fa944)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Sviatoslav Sydorenko 2d6747bcbf [stable-2.13] Restrict `wheel` below v0.38.0 under Pythons < 3.7 (#79187)
* Restrict `wheel` below v0.38.0 under Pythons < 3.7

* Add a change note for PR #79187

* Update changelogs/fragments/79187--wheel-0.38.0.yml

Co-authored-by: Matt Clay <matt@mystile.com>

* Use constraints file when installing wheel.

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit a76bbb18a5)

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
3 years ago
Matt Clay fa0655228a [stable-2.13] ansible-test - Fix integration test target filter. (#78862)
- Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
(cherry picked from commit d3d7785472)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay fd1935048c
Update mypy test. Fix type hints for Python 3.9. (#78587)
This also bumps the minimum controller version (for mypy only) to Python 3.9.

(cherry picked from commit cc5ac88c4c)
3 years ago
Matt Clay d6b40a5bc6
[stable-2.13] ansible-test - Fix ansible-doc sanity test FQCN. (#78518). (#78519)
(cherry picked from commit 2b63fdd1b8)
3 years ago
Matt Clay 9ec6e331bf
[stable-2.13] ansible-test - Fix self-test change handling. (#78521) (#78523)
(cherry picked from commit 99016653a2)
3 years ago
Matt Clay 426e4899a3
[stable-2.13] ansible-test - Parse content config only once. (#78418) (#78426)
(cherry picked from commit f2abfc4b3d)
3 years ago
Matt Clay 24359537bb [stable-2.13] ansible-test - Fix TTY and output handling. (#78350).
(cherry picked from commit a3c90dd0bc)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 4bb1907084 [stable-2.13] ansible-test - Fix handling of args after `--` (#78328)
(cherry picked from commit 0012263c7a)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 99217ca2b6 [stable-2.13] ansible-test - Improve pip bootstrap download.
(cherry picked from commit b9d13d222c)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sandra McCann f09e6b7769
Backportapalooza 06 16 (#78072)
* Docsite: Updated style guide resources (#78048)

(cherry picked from commit 561cf1956d)

* Create reusable role layout snippet for documentation (#78057)

* reuse role structure
* reuse role snippet in role docs

(cherry picked from commit f4ad1c771e)

* Docsite: update links to community docs (#78043)

(cherry picked from commit 46d86a882d)

* Windows - incorrect python-devel package in WinRM docs (#78037)

Co-authored-by: Emanuele Barbato <manu@Giuseppes-MacBook-Air.local>
(cherry picked from commit 681dc6eab9)

* issue #72449 winrm script rm (#77931)

(cherry picked from commit 3cd2c494bd)

* reword the regex note (#75393)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
(cherry picked from commit 66c0882314)

* Document debconf interaction with dpkg-reconfigure (#74196)

Signed-off-by: David Greaves <david@dgreaves.com>
(cherry picked from commit 5b90601ca4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Emanuele Barbato <30394740+emanuelebarbato@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: David Greaves <david@dgreaves.com>
4 years ago
Sloane Hertel cf5c0c9b06
ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649) (#78008)
* ansible-galaxy - support resolvelib versions >= 0.5.3, <= 0.8.1

Test incompatibilities are removed for resolvelib >= 0.6.0

Test against the latest 0.8.x version and fix requirements

* Fix tests - use a venv for testing the range of resolvelib versions

* Update temporary hardcoded fallback for ansible-test

* Update hardcoded upperbound for sanity tests

* Make error check more flexible

(cherry picked from commit 143e7fb45e)
4 years ago
Sloane Hertel 0c76edb63a
Pin PyYAML version compatible with Python 3.8+ (#77936) (#77986)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit e89176caac)
4 years ago
Matt Clay 567a295c00
[stable-2.13] ansible-test - Adjust unit test mock usage. (#77961) (#77999)
(cherry picked from commit 23914d3f0b)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay ae380e3bef
[stable-2.13] ansible-test - Multiple backports (#77951)
* ansible-test - Backport `InternalError`

NOTE: This is a partial backport, including only one new class.

(cherry picked from commit b960641759)

* ansible-test - Fix subprocess management. (#77641)

* Run code-smell sanity tests in UTF-8 Mode.
* Update subprocess use in sanity test programs.
* Use raw_command instead of run_command with always=True set.
* Add more capture=True usage.
* Don't expose stdin to subprocesses.
* Capture more output. Warn on retry.
* Add more captures.
* Capture coverage cli output.
* Capture windows and network host checks.
* Be explicit about interactive usage.
* Use a shell for non-captured, non-interactive subprocesses.
* Add integration test to assert no TTY.
* Add unit test to assert no TTY.
* Require blocking stdin/stdout/stderr.
* Use subprocess.run in ansible-core sanity tests.
* Remove unused arg.
* Be explicit with subprocess.run check=False.
* Add changelog.
* Use a Python subprocess instead of a shell.
* Use InternalError instead of Exception.
* Require capture argument.
* Check for invalid raw_command arguments.
* Removed pointless communicate=True usage.
* Relocate stdout w/o capture check.
* Use threads instead of a subprocess for IO.

(cherry picked from commit 5c2d830dea)

* ansible-test - Add support for remote Ubuntu VMs.

(cherry picked from commit 6513453310)

* ansible-test - Fix remote completion validation.

(cherry picked from commit e2200e8dfc)

* ansible-test - Add multi-arch remote support.

(cherry picked from commit 2cc74b04c4)

* ansible-test - Enhance the shell command. (#77734)

* ansible-test - Add shell --export option.

* ansible-test - Support cmd args for shell command.

Also allow shell to be used without a valid layout if no delegation is required.

* ansible-test - Improve stderr/stdout consistency.

By default all output goes to stdout only, with the exception of a fatal error.

When using any of the following, all output defaults to stderr instead:

* sanity with the `--lint` option -- sanity messages to stdout
* coverage analyze -- output to stdout if the output file is `/dev/stdout`
* shell -- shell output to stdout

This fixes issues two main issues:

* Unpredictable output order when using both info and error/warning messages.
* Mixing of lint/command/shell output with bootstrapping messages on stdout.

* ansible-test - Add changelog fragment.

(cherry picked from commit fe349a1ccd)

* ansible-test - Fix remote args restriction.

The platform-specific and global fallbacks were not working with the `--remote` option.

This regression was introduced by https://github.com/ansible/ansible/pull/77711

(cherry picked from commit 76ead1e768)
4 years ago
Matt Clay 2ac74197af [stable-2.13] ansible-test - Prefer unittest.mock for core.
(cherry picked from commit 81351022d8)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 44ce9fe998 [stable-2.13] ansible-test - Fix shell target options handling.
(cherry picked from commit f933314101)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 2b6df9ea36
Add RHEL 9.0 to ansible-test and CI. (#77923)
* ansible-test - Add RHEL 9.0 remote support.

* Add RHEL 9.0 to CI. (#77853)

* Add RHEL 9.0 to CI.

* Restrict network manager inspection to RHEL8

* Skip module tests when astream_name is undefined, undefine it for RHEL9 until 9.1

* Remove redundant test.

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 43d650f924)

* Include test fix from https://github.com/ansible/ansible/pull/77847
4 years ago
Matt Clay 9a7b645c50 ansible-test - Update default containers to 5.9.0. 4 years ago
Matt Martz 30f96bb75e
[stable-2.13] ansible-test - Don't fail if network cannot be disconnected (#77472) (#77482)
* Don't fail if network cannot be disconnected

* add clog frag
(cherry picked from commit 66c5844)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Clay 3b20b02272
[stable-2.13] Fix sanity test crash. (#77475)
(cherry picked from commit 6216c9fc93)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
4 years ago
Matt Clay ee9705a1ce [stable-2.13] ansible-test - Fix origin host target filtering.
(cherry picked from commit 4b51e61645)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 708e4c206a ansible-test - Update default test containers. 4 years ago
Felix Fontein 7075fa36a1
Bump requirements for antsibull to 0.42.0 (which depends on antsibull-changelog >= 0.14.0). (#77362) 4 years ago
Matt Clay 55f90ba31f ansible-test - Remove RHEL 9.0b support.
Support can be restored once RHEL 9 has been released.
4 years ago
Sloane Hertel 2769f5621b
Add find_spec and exec_module to RestrictedModuleLoader (#76427)
* Add find_spec and exec_module to RestrictedModuleLoader

* Fix getting new loader with correct path

Fix pep8 errors

* Use convert_ansible_name_to_absolute_paths instead of the loader path

* Apply suggestions from code review

* Fix type hints and test them in CI

* Fix error message for ansible.module_utils.basic if it's missing

Add mypy ignored missing imports for controller sanity tests

* Add mypy attr-defined ignore entries for python 3.8, 3.9, 3.10 for vendored six

Add mypy attr-defined ignore for python 2.7 in lib/ansible/utils/collection_loader/_collection_finder.py

* Just test controller python versions to simplify ignoring mypy errors
4 years ago
Abhijeet Kasurde 1100289a45
docker_util: Handle error in JSON parsing (#77298)
While getting hostname from container, podman command
fails to return JSON so wrap exception and return
hostname as 'None'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Felix Fontein 4d984613f5
validate-modules for plugins: do some more schema validations so that some issues that are currently reported for modules are also reported for plugins (#77268)
* Add more sanity tests on schema level (so they also work for plugins).

* Fix various issues the sanity test reported.

* Add changelog fragment.

* Fix function name.
4 years ago
Matt Clay e8afdac06e ansible-test - Fix delegation inventory path. 4 years ago
Matt Martz 7cb581ed2c
Support podman-remote in ansible-test (#75753) 4 years ago
Matt Clay 0c514bcf54 ansible-test - Fix PS coverage `--all` generation. 4 years ago