summaryrefslogtreecommitdiffstats
path: root/test/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add ansible-test six constraint for Python 2.6.Matt Clay2021-04-011-0/+1
|
* Fix ansible-test coverage exporting.Matt Clay2021-03-303-3/+11
| | | | | ci_complete ci_coverage
* fix typoBaptiste Mille-Mathias2021-03-181-1/+1
|
* Don't match passive_interface for validate-modules (#73880)Paul Belanger2021-03-131-1/+1
| | | | | | | | | This is a follow up to: https://github.com/ansible/ansible/pull/73508 To avoid adding no_log statements to passive_interface args. Signed-off-by: Paul Belanger <pabelanger@redhat.com>
* validate-modules no_log test: extend search range, add more known ↵Felix Fontein2021-03-131-3/+3
| | | | | | | false-positives (#73882) * validate-modules no_log test: extend search range, add more known false-positives. * Mark false-positives.
* Ensure unit test paths for connection and inventory plugins are based on the ↵Mark Chappell2021-03-121-3/+5
| | | | context (#73877)
* validate-modules: make sure that options that potentially contain secret ↵Felix Fontein2021-03-111-0/+38
| | | | | | | | data have no_log set (#73508) * Catch more potential errors (and increase false-positive rate). * Flag some false-positives in lib/ansible/modules/ with no_log=False. Co-authored-by: John Barker <john@johnrbarker.com>
* Update `resource_prefix` syntax for ansible-test.Matt Clay2021-03-103-5/+5
|
* Remove old ansible-test windows completion entries.Matt Clay2021-03-021-2/+0
|
* Remove outdated --docker and --remote entries.Matt Clay2021-03-022-12/+0
|
* Fixed/improved regular expresssion for collection names (#73577)Alexei Znamensky2021-03-011-1/+1
| | | | * added changelog fragment * added a couple of tests to coll name validation
* pylint sanity test: stop ignoring 'used-before-assignment' (#73639)Felix Fontein2021-02-182-2/+0
| | | | | * Remove pylint ignore 'used-before-assignment'. * Adjust changelog fragment.
* ansible-test: make sure tests are also run for the new plugin types (#73599)Felix Fontein2021-02-132-0/+8
| | | | * Make sure tests are also run for the new plugin types. * New plugin types are not documentable.
* Fix ansible-test handling of egg-info.Matt Clay2021-02-132-51/+45
| | | | Resolves https://github.com/ansible/ansible/issues/67990
* Import sanity test for plugins (#72497)Felix Fontein2021-02-125-98/+181
|
* Update ansible-test default test containers.Matt Clay2021-02-121-2/+2
|
* ansible-test: yamllint, check the assigmentGonéri Le Bouder2021-02-121-1/+1
| | | | | | | | Ensure `yamllint`'s `check_assignment()` correctly ignore the attribute assignment. Those don't have any `.id` attribute and will trigger an `AttributeError` exception. See: https://github.com/ansible/ansible/pull/73322
* Fix ansible-test constraints issues. (#73578)Matt Clay2021-02-1211-42/+39
| | | | | | | | | | | * Silence Python 3.5 EOL notice in pip. * Skip import test on compat/selinux.py utils. * Improve Python version skip warning. * Use Python 3.6 as minimum Python for sanity tests. * Improve min Python handling for code-smell tests. * Overhaul test-constraints sanity test. * Merge sanity test constraints with requirements. * Remove legacy content specific constraints. * Add changelog fragment.
* Upgrade pylint used by ansible-test. (#70155)Matt Clay2021-02-116-13/+23
| | | | | | | | * Upgrade pylint and deps in ansible-test. * Enable pylint on Python 3.9. * Update pylint config. * Add ignore for vendored six. * Add ignores for support plugins. * Fix issue reported by pylint.
* Temporary fix for cryptography issues. (#73530)Matt Clay2021-02-081-1/+3
|
* Bump antsibull-changelog version for changelog sanity test.Felix Fontein2021-02-051-1/+1
|
* add self-signed https endpoint for ansible-test (#73463)Florian Heiderich2021-02-042-2/+14
| | | | | | | | | | | | | * introduce self-signed.ansible.http.tests * forwarding of port 444 * forward port 8444 to port 444 on http test container * Fix port forwarding for Windows under docker * add changelog fragment Co-authored-by: Jordan Borean <jborean93@gmail.com>
* validate_modules: fails with .id attribute not found (#73322)Gonéri Le Bouder2021-02-021-0/+2
| | | | | | | | | | | | | | | | | | | | * validate_modules: fails with .id attribute not found This patch addresses a problem in the `found_try_except_import` test. This module tries to identify lines like: `HAS_FOO = True` In this case, the target (`HAS_FOO`) is of type `ast.Name` and has a `id` attribute which provide the name. In my case, I've a line that set a module attribute`. In this case, the target (`module.var`) has the type `ast.Attribute` and no `id` attribute. The code trigger an `AttributeError` exception. This patch ensures we compare a `ast.Name`. * Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py
* Overhaul ansible-test SSH key management. (#73451)Matt Clay2021-02-028-48/+135
| | | | | | * Pass remote.sh to shell over stdin. * Pass docker.sh to shell over stdin. * Standardize SSH key management. * Update docker containers.
* [ansible-test] Bump CentOS 6 image (yum repos) (#73446)Rick Elrod2021-02-011-1/+1
| | | | | | | Change: - Bump centos6 image version to one which includes multiple fallbacks for vault.centos.org content. Signed-off-by: Rick Elrod <rick@elrod.me>
* Update ansible-test distro containers to 1.29.0.Matt Clay2021-02-011-11/+11
|
* Always use python exec wrapper in ansible-test.Matt Clay2021-01-291-10/+9
|
* Update ansible-test default containers.Matt Clay2021-01-281-2/+2
|
* Use `sh` for ansible-test raw remote shell.Matt Clay2021-01-281-1/+1
|
* Avoid sphinx usage in changelog sanity test.Matt Clay2021-01-282-1/+13
|
* No longer warn about missing pip/python pair.Matt Clay2021-01-281-10/+2
| | | | | | | | | This warning was intended to help improve test environment configuration. However, it has ended up producing mostly non-actionable warning noise instead. In most situations a missing pip or python should result in test failures. Reporting a missing pip also implies that it should be used by tests, which is not the case. Tests should be invoking pip as a python module with the appropriate python interpreter instead.
* Add test support for Python 3.8 on RHEL and FreeBSD. (#73393)Matt Clay2021-01-284-12/+55
| | | | | | | * Support Python 3.8 on RHEL 8.2+ in ansible-test. * Support Python 3.8 on FreeBSD in ansible-test. * Use libyaml with PyYAML on FreeBSD.
* Limit rstcheck sanity test to ansible-core. (#73391)Matt Clay2021-01-283-101/+0
|
* Replace the inhouse collection dependency resolver with `resolvelib`Sviatoslav Sydorenko2021-01-273-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR #72591 This change: * Adds an artifacts manager that abstracts away extracting the metadata from artifacts, downloading and caching them in a temporary location. * Adds `resolvelib` to direct ansible-core dependencies[0]. * Implements a `resolvelib`-based dependency resolver for `collection` subcommands that replaces the legacy in-house code. This is a dependency resolution library that pip 20.3+ uses by default. It's now integrated for use for the collection dependency resolution in ansible-galaxy CLI. * Refactors of the `ansible-galaxy collection` CLI. In particular, it: - reimplements most of the `download`, `install`, `list` and `verify` subcommands from scratch; - reuses helper bits previously moved out into external modules; - replaces the old in-house resolver with a more clear implementation based on the resolvelib library[0][1][2]. * Adds a multi Galaxy API proxy layer that abstracts accessing the version and dependencies via API or local artifacts manager. * Makes `GalaxyAPI` instances sortable. * Adds string representation methods to `GalaxyAPI`. * Adds dev representation to `GalaxyAPI`. * Removes unnecessary integration and unit tests. * Aligns the tests with the new expectations. * Adds more tests, integration ones in particular. [0]: https://pypi.org/p/resolvelib [1]: https://github.com/sarugaku/resolvelib [2]: https://pradyunsg.me/blog/2020/03/27/pip-resolver-testing Co-Authored-By: Jordan Borean <jborean93@gmail.com> Co-Authored-By: Matt Clay <matt@mystile.com> Co-Authored-By: Sam Doran <sdoran@redhat.com> Co-Authored-By: Sloane Hertel <shertel@redhat.com> Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com> Signed-Off-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
* Rename ansible-test functions to match constants.Matt Clay2021-01-261-7/+7
|
* Clean up code in ansible-test. (#73379)Matt Clay2021-01-2620-51/+64
| | | | | | | | | | | | | | | | | | | | | | | * Relocate code to fix type dependencies. * Fix missing and unused imports. * Fix type hints. * Suppress PyCharm false positives. * Avoid shadowing `file` built-in. * Use json.JSONEncoder directly instead of super(). This matches the recommended usage and avoids a PyCharm warning. * Remove redundant regex escape. * Remove redundant find_python call. * Use tarfile.open directly. * Add changelog fragment.
* Use a versioned pip bootstrapper in ansible-test.Matt Clay2021-01-251-4/+1
|
* Handle get-pip.py breaking change on Python 2.7.Matt Clay2021-01-231-1/+9
|
* Add Ubuntu 20.04 to CI and ansible-test (#69161)Rick Elrod2021-01-221-0/+1
| | | | | | | | | | | | Change: - Add Ubuntu 20.04 to CI now that venv is default instead of virtualenv in ansible-test. Test Plan: - CI Tickets: - Fixes #69203 Signed-off-by: Rick Elrod <rick@elrod.me>
* [ansible-test] First attempt at freebsd/11.4 (#72655)Rick Elrod2021-01-221-0/+1
| | | | | | | | | | | | Change: - Try CI against freebsd 11.4 Test Plan: - ci_complete Tickets: - Fixes #48782 Signed-off-by: Rick Elrod <rick@elrod.me>
* Vanquish rare container bootstrap failure (#73288)Alexander Sowitzki2021-01-211-6/+5
| | | | | | | | | | | | The init script for the test container writes additional lines to the .bashrc of the user. This was done via a `cat` multiline instruction, which is implemented internally by writing a temporary file to TMPDIR (/tmp in this case) first. Docker fails to provide /tmp just after creation, which results in a race condition that rarely makes the init fail. Changed the `cat` statement to multiple `echo`s. Co-authored-by: Matt Clay <matt@mystile.com>
* update rstcheck and sphinx versions in contraints (#73176)Sandra McCann2021-01-141-1/+2
| | | | * update rstceck and sphinx versions in contraints * fix test error
* Remove obsolete `tower` plugin from ansible-test.Matt Clay2021-01-133-274/+0
|
* Cleanup provisioning code in ansible-test. (#73207)Matt Clay2021-01-139-169/+75
| | | | | | | | | | | * Remove unused code in ansible-test. * Remove obsolete endpoint logic from ansible-test. * Remove obsolete region selection in ansible-test. * Remove obsolete port logic in ansible-test. * Clean up ansible-test remote providers.
* Add macOS 11 to CI (#72622)Sam Doran2021-01-111-0/+1
| | | | | * Fix connection_paramiko_ssh test for macOS 11 * Update Azure Pipelines config * Add changelog
* ansible-test - No virtualenv install on Python 3Matt Clay2021-01-081-3/+11
| | | | | | | Tests should use the Python built-in ``venv`` module on Python 3 instead of the standalone ``virtualenv`` module. On Python 2 the ``virtualenv`` module continues to be the only option. The version installed is either the OS packaged version or the last release to support Python 2, which is version 16.7.10.
* Refactor ansible-test cryptography install code.Matt Clay2021-01-071-15/+25
|
* [ansible-test] Add Fedora 33 support and drop F31Rick Elrod2021-01-061-0/+1
| | | | | | | | | | | | Change: - Changes to make F33 work with current tests - Add F33 to docker.txt - Add F33 to AZP config Test Plan: - ci_complete Signed-off-by: Rick Elrod <rick@elrod.me>
* arg_spec - move validator lookup method to a function (#72667)Sam Doooran2020-12-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arg_spec - move type checking lookup method to a function * Change get_wanted_type name and behavior Change the name to get_validator to bette describe what it is doing. Change the interface to always return a value. This lines up with the behavior of get_* functions always returning something or None and check_* functions raising an Exception if something went wrong during the check. * Add param to check_type_str() Not meant to be a long term fix, but gets tests passing. More work is needed to figure out how to solve this cleanly. * Remove private attribute mapping types to validator Since the function that needs it has moved to parameters.py, there is no need to have it as a attribute of AnsibleModule. Update tests that were referencing the private attribute. * Use private method for 'str' type To avoid having to put the string conversion warning behavior in the check_type_str() method, use the private _check_type_str() method for 'str' type. Import CHECK_ARGUMENT_TYPES_DISPATCHER for backwards compalitibility and store it as a private attribute. Revert changes to support plugins that are referencing serf._CHECK_ARGUMENT_TYPES_DISPATCHER. * Add changelog * Change function name to better reflect its... function * Change dict name to better reflect its contents CHECK_ARGUMENT_TYPES_DISPATCHER --> DEFAULT_TYPE_VALIDATORS * Fix changelog
* import_playbook - change additional params to deprecation (#72987)Sam Doooran2020-12-171-1/+1
| | | | | | | * import_playbook - change additional params to deprecation I incorrectly recommended this be set as a warning when it should have been a deprecation. * Fix deprecation sanity test to not required a collection name when not inside a collection