Commit Graph

11038 Commits (8d37ea6e4bc3547dbdf82ae77e50e196ea1f409b)

Author SHA1 Message Date
Sviatoslav Sydorenko de7fe7814a
[2.11] Log `runme.sh` execution in integration tests (#79285)
* Log `runme.sh` execution in integration tests (#79263)

* Log `runme.sh` execution in integration tests

This patch adds `set -x` where it's missing in the integration tests.
It also enables `pipefail` in `runme.sh` scripts that use pipes.

* Add a change note for PR #79263

(cherry picked from commit 6674c43edd)

* Delete a bad PR #79263 change note

(cherry picked from commit 9cfb3f73e8)
3 years ago
Sviatoslav Sydorenko e7b39bd1bd [stable-2.11] 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 Martz 19b56e7f32
[stable-2.11] Don't request repo updates when only testing modes (#78843) (#78852)
(cherry picked from commit 2542048)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Matt Martz 88e8e95dd9
[stable-2.11] Filter AWS test AMI selection on any Fedora-Cloud-Base image (#78669) (#78671)
(cherry picked from commit 046c59d)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Sviatoslav Sydorenko b1c73fa870
Fail fast in stuck `ansible-galaxy-collection` (#78629)
This specific integration test gets stuck periodically causing the
Galaxy jobs to be killed on timeout wasting an hour of runtime. The
module that gets stuck waiting on Pulp is an in-test one, called
`setup_collections`. When it works, the task is complete in around 70
seconds but when it doesn't, it just freezes the whole play.

This patch attempts to make it fail faster by putting a reasonable
timeout value of 2 minutes.

(cherry picked from commit f1c56e988d)
3 years ago
Sviatoslav Sydorenko 6e070b90ca
Fix pytest collection during test_host partial run (#78596)
Sometimes pytest errors out with an `ImportError` during its tests
collection stage when a Python package/directory containing the test
module does not have an `__init__.py` in it. This is being observed
under Python 3.9 and higher.

The patch provides a workaround for this problem but does not address
the root cause which is currently unknown.

Ref:
https://github.com/ansible/ansible/pull/78585#issuecomment-1220885431
(cherry picked from commit beb70daf14)
3 years ago
Matt Clay 8acd498a57
Skip paramiko test on failing platforms. (#78642)
The paramiko install fails due to the new bcrypt 4.0.0 release.

The test is being skipped on the affected platforms since ansible-core 2.11 will reach end-of-life in November.
3 years ago
Matt Clay 09abcdaf40
[stable-2.11] Fix file integration test chattr/lsattr check. (#78614) (#78620)
On BusyBox systems such as Alpine, chattr on a tmpfs fails with a status of 0 and output only on stderr.

This change updates the test to not assume output on stdout.

(cherry picked from commit 2e536c0afb)
3 years ago
Sviatoslav Sydorenko 1c0723ba34
[2.11-only] Prepare Alpine signing keys for installs from edge (#78311)
* Add a note on installing faketime on Alpine in CI

(cherry picked from commit d7e3c765be)

* Add note about libuser being unavailable @ Alpine

* Prepare Alpine signing keys for installs from edge

Before this patch, the Ansible Core CI Alpine image integrated into
this branch only had old package signing keys pre-installed.
On July 14, 2022, Apline has rotated their RSA keys to the new
4096-bit ones[1]. This resulted in older unprepared systems being
unable to verify package downloads, causing the following in the logs:

    ERROR: http://dl-cdn.alpinelinux.org/alpine/edge/community:
    UNTRUSTED signature

This patch updates the system-trusted keys by upgrading the
`alpine-keys` package to the latest version. With the change, the old
package installs succeed again. In particular, this concerns the
`faketime` and `libuser` packages that are used in `group` and
`setup_cron` integration tests.

This change is only applied to ansible-core 2.11 since all the newer
release streams have an updated version of the Alpine container that
does not need this hack.

[1]: https://www.alpinelinux.org/posts/Alpine-edge-signing-keys-rotated.html
4 years ago
Martin Krizek 77b6633076 [stable-2.11] yum: fix parsing of check-update with subsequent empty lines (#75452)
Rather than adding further complexity to the regex, preprocess the output to
remove any empty lines. Now the only purpose of the regex is to fix
wrapped lines.

Fixes #70949
(cherry picked from commit 51f2f1ac5e)

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
4 years ago
Brian Coca 67f06ed83c
dont rely on path to set config defs for plugins (#77659) (#77696)
(cherry picked from commit a3cc6a581e)
4 years ago
Martin Krizek d5e5bd34d6
Prevent losing unsafe from lookups (#77609) (#77652)
This patch fixes a bug which under certain conditions results in data
returned from lookups not being marked as unsafe.

Each time Templar.do_template is invoked a new AnsibleContext is
created and stored effectively at two places:
1) as an instance variable in templar_obj.cur_context
2) as a local variable called new_context in do_template method of Templar

Due to custom functionality in Ansible's Context that allows for nested
templating it is possible that during resolving variable's value
template/do_template method is called recursively again, again creating
a new context. At that point the problem manifests itself because as
mentioned in 1) above the context is overwriten on the templar object
which means that any subsequent calls to _lookup will use the new
context to mark it as unsafe which is now different to the local
new_context which is used for testing for unsafe property.

The solution to the problem appears to be to restore the original
context inside do_template and also to eliminate the local variable
new_context to prevent problems in the future.

It appears that we don't have a better way of storing the context other
than as some form of global variable and so this appears to be the
"best" solution possible at this point. Hopefully data tagging will be
the solution here.

For more examples see unit and integration tests included in this patch.

Fixes #77535

(cherry picked from commit 3980eb8c09)
4 years ago
Matt Clay 4d31016e85 ansible-test - Fix rstcheck compatibility issues. 4 years ago
Jordan Borean 874f4323ef
winrm - ensure callers PATH for kinit is set (#77401) (#77402)
* winrm - ensure callers PATH for kinit is set

* Fix unit test expectations

* Fix type annotation

(cherry picked from commit 60b4200bc6)
4 years ago
Sloane Hertel 939f843024
[2.11] Fix collection redirects for filter and test plugins (#77210) (#77228)
* Fix collection redirects for filter and test plugins (#77210)

* Fix collection redirects for jinja2 filters/tests

* Handle recursive redirects

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

* The error message is only capitalized on 2.13. Make test more flexible.

(cherry picked from commit 734777ef05)
4 years ago
Sloane Hertel ca8835c990
[2.11] ansible-galaxy collection verify - display new files/dirs as modified content (#77129)
* Fix 'ansible-galaxy collection verify' to report files/directories not listed in the FILES.json

(cherry picked from commit a1d467dbb2)

* changelog

(cherry picked from commit 3d49d6f69e)
4 years ago
Matt Martz ef46bc46f4
[stable-2.11] Use full python package for ansiballz cache filenames (#77090) (#77126)
* [stable-2.11] Use full python package for ansiballz cache filenames (#77090)

* Use full python package for ansiballz cache filenames

* Be a little more explicit about test goals
(cherry picked from commit 8cbe143)

Co-authored-by: Matt Martz <matt@sivel.net>

* linting
4 years ago
Matt Clay 7a8c6d7418 ansible-test - Fix cloud plugin traceback. 4 years ago
Matt Clay 41a1fe1303 [stable-2.11] Update setup_pexpect to prefer pip user installs.
This works around issues on RHEL 7.9 when an old version of pexpect is installed from an OS package.
(cherry picked from commit 27fe26edbf)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 1b57ccb7a9 [stable-2.11] ansible-test - Use `--forked` instead of `--boxed`
The `--boxed` option is deprecated..
(cherry picked from commit eaeec8a65c)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay d6b6c95498 ansible-test - Omit pyopenssl for sanity tests. 4 years ago
Matt Clay d003313544 ansible-test - Add MarkupSafe constraint.
Installation of MarkupSafe 2.1.0 and later require setuptools 39.2 or later,
or a recent version of pip which supports installation using a wheel.

Some systems will not have new enough versions of pip and/or setuptools,
especially virtual environments -- including those created by ansible-test.
4 years ago
Sloane Hertel c6d392d43d [stable-2.11] Use --no-deps when installing amazon.aws and not testing dependencies (#77091)
(cherry picked from commit 88bfb7193e)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
4 years ago
Matt Clay 79a2ee4bed [stable-2.11] ansible-test - Use quay.io containers in plugins..
(cherry picked from commit c27fd777f4)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Brian Coca 5c2251504c
ssh connection: use 'correct' host in all cases (#76017) (#76969)
ssh plugin, use 'correct' information source in all cases
  * still fallback to pc
  * added inventory to new test
  * undef var can still show as parser error on pc
    now task_exectuer has a  more accurate error handling

(cherry picked from commit be19863e44)
4 years ago
Brian Coca ee112d9984
fix block var inheritance (#75287) (#76897)
* updated tests to conform to new block inheritance

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit b1d6750e8b)
4 years ago
Matt Clay 906642edc4 ansible-test - Install pyopenssl w/ cryptography.
ci_complete
4 years ago
Matt Clay cc97353702
[stable-2.11] ansible-test - Use relative paths in junit output. (#76909)
* [stable-2.11] ansible-test - Use relative paths in junit output. (#76871)

* ansible-test - Use relative paths in junit output.
* ansible-test - Handle out-of-tree JUnit paths.
* Also fix a traceback in the junit callback during automatic fact gathering.

(cherry picked from commit fbb5d56bd2)

* Fix task path unicode error in junit callback.

(cherry picked from commit 41db6d8d35)
4 years ago
Matt Martz b4c1688809
[stable-2.11] Compare FQCN also in lockstep logic. Fixes #76782 (#76787) (#76797)
(cherry picked from commit 29bdb8b)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Brian Coca 4eac144d7e
ssh connection avoid parsing own debug (#76732) (#76756)
* ssh connection avoid parsiing own debug (#76732)

  - Avoids false positives on become strings being echoed back
   by ssh cli itself
  - added test for debug lines
  - also simplified some of existing test code

(cherry picked from commit 0ff80a15ba)

* unicoode

* dont make em ascii
4 years ago
Brian Coca a72e3d14b3
ssh connection, handle 'fun' control paths (#76424) (#76694)
* handle 'fun' control paths by quoting the option when passed to ssh cli

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit aa022dba2d)
4 years ago
Jordan Borean 39b6dec937
galaxy build - ignore existing MANIFEST and FILES (#76479) (#76499)
(cherry picked from commit 8482ee4e9a)
4 years ago
Tadej Borovšak 6da3cf51a3
Fix zip content filtering in unarchive module (#76069) (#76420)
When we introduced an include parameter to the unarchive module, we
inadvertenly flipped the exclusion logic. This flip meant that the
unarchive module started rejecting files that should be extracted.

This commit flips the bad logic and adds some tests that will make
sure things do not go bad again.

(cherry picked from commit f92830d16e)
4 years ago
Matt Clay 070ae15c52 Limit pynacl for paramiko tests. 4 years ago
Sloane Hertel f5d694eba4 Disable the _distutils_hack in newer setuptools (#76600)
* Disable the _distutils_hack in newer setuptools. Doesn't fix the underlying issue of the venv finding the _distutils_hack of a setuptools that is not its own.

ci_complete

* re-throw blanket

(cherry picked from commit fa617fcd7b)
4 years ago
Matt Clay 15ab9a086a [stable-2.11] Fix wait_for integration test.
Pin the `psutil` package to 5.8.0 since 5.9.0 is broken on macOS.
(cherry picked from commit a5f4a25d32)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 3c2d25014a Add sanity test ignores. 4 years ago
Matt Clay a6be3165e0 [stable-2.11] ansible-test - Fix traceback in validate-modules test.
(cherry picked from commit 41ee4a5b12)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sam Doran 8353792371 [stable-2.11] pin mongodb libraries in test
A recent release of PyMongo 4.0 caused tests to fail
4 years ago
Sam Doran 272f2ba775
[stable-2.11] Use new codecov uploader (#75938) (#76268)
* Use new codecov uploader
* Rewrite coverage uploader in Python.
(cherry picked from commit 74dc830dd4)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Sloane Hertel 4079bc948b
Skip recursive suboption validation if sub_parameters is not a dict (#75635) (#76189)
* Skip recursive suboption validation if sub_parameters is not a dictionary

* Ensure sub parameter elements is a sequence to prevent iterating over string characters and causing duplicate error messages for the same param

(cherry picked from commit b5ed41edb3)
4 years ago
Matt Martz a17581efa6
2.11 `action_groups` normalization (#76171)
* Have tests use shortname in action_groups to uncover an issue

* Alias shortname from action_groups to FQCR of owning collection

* Add clog frag

* Don't overwrite
4 years ago
Matt Clay 2154722490 [stable-2.11] Fix pip integration test.
- Use `fallible==0.0.1a2` instead of `black==19.10b`
- Test on both Python 2 and 3.
(cherry picked from commit b6725ec6c9)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 17ef15a534 [stable-2.11] Fix subversion test.
Switch to a different repo that isn't giving 503 errors since GitHub hasn't fixed the issue yet..
(cherry picked from commit 319b50f04c)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Jordan Borean 651e69064d ansible-test pslint - fix warning with nested objects (#75792)
* ansible-test pslint - fix warning with nested objects

(cherry picked from commit 7e19957afa)
4 years ago
Sloane Hertel 4967b8650c
Fix unexpected exception when a role has an empty argument_specs.yml (#75604) (#75684)
* Fix role with empty argument_specs.yml

* Use try/except and add changelog fragment

* Always return a dict

* Add test for empty argument_specs key

(cherry picked from commit 3e7a622204)

Co-authored-by: devon-mar <devon-mar@users.noreply.github.com>
4 years ago
Jordan Borean 15f5886479
PowerShell - Ignore LIB env var when building C# code (#75698) (#75725)
* PowerShell - Ignore environment variables when building C# code

* Just unset LIB for now

* Fix sanity issue

(cherry picked from commit 097bc07b66)
4 years ago
Sloane Hertel d9d5d2d93e
Try all galaxy servers when locating available versions for a collection (#75468) (#75750)
* If an exception occurs when getting a collection's metadata, continue to the next in the server list.

* Warn for unknown exceptions when finding versions of a collection

* Test that an invalid server is no longer fatal if a subsequent server has the collection

* Fix server for verify tests - compare checksums against the server from which it was installed

* Add tests for verify and fix that code path to mirror install/download behavior for server errors

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 469b559ebe)
4 years ago
Matt Martz f2b14b9aa3
[stable-2.11] Don't show params when there is an issue with `set_option(s)` (#75805) (#75808)
(cherry picked from commit 79e9dae)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Brian Coca 6e011d0809
various fixes to command (#74212) (#74257)
* various fixes to command

  - Updated splitter to allow for all expected args in ad-hoc
  - Ensure we always return the returns we promissed to always return (i.e stderr/stdout)
  - Updated docs to clarify creates/removes precdence in checking
  - Removed abspath from chdir to allow reporting to handle symlinks correctly
  - Corrected tests to new output messages

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b3b1dde648)
4 years ago