Commit Graph

10226 Commits (abb807e5ddf49f7308a7609090648b52bf24acff)

Author SHA1 Message Date
Sam Doran cdb24e0078
ansible-galaxy - fix listing specific role and role description (#67409)
* ansible-galaxy - fix listing specific role

If the role was not in the first search path, it was reported as not found

* Properly display role description

Default to description to top level description, falling back to the description from within galaxy_info

* Display proper message when a role does not exist

* Add integration tests

* Use context manager

* BSD and macOS ruining all the fun
4 years ago
Matt Clay 7d51706278 Revert "Switch network incidental tests to VyOS 1.1.7-R2."
This reverts commit 7d5177d6a0.
4 years ago
jctanner f11b1454bb
prepare for future ansibot collection changes (#68944) 4 years ago
Martin Krizek ff1ba39c8a
Prevent templating unused variables for {%include%} (#68749)
Fixes #68699
4 years ago
Matt Clay 7d5177d6a0 Switch network incidental tests to VyOS 1.1.7-R2.
The previous version being used, VyOS 1.1.8, is currently unavailable in AWS.
4 years ago
David Shrewsbury 18a66e291d
Force collections to be static (#68723)
* Force collections to be static

Templating of collection names does not work at all. Force them to
be static so that a warning is generated for the user.

* Add collectionsearch unit test and fix for reviews

New unit test validates the new _load_collections() code and moves
the new check to the end of the method.

* Change unit test to pytest

* Adjust unit test to use capsys instead of monkeypatch

* Fix pep8 error

* Add changelog fragment

Closes #68704
4 years ago
Sloane Hertel d91658ec0c
subversion module - provide password securely when possible or warn (#67829)
* subversion module - provide password securely with svn command line option --password-from-stdin when possible, and provide a warning otherwise.
* Update lib/ansible/modules/source_control/subversion.py.
* Add a test.

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Zhanwei Wang 1097694355
get_url pass incorrect If-Modified-Since header(#67417) (#67419)
Fix #67417. HTTP header value of `If-Modified-Since` set by `get_url` does not follow HTTP protocol.
4 years ago
Matt Clay a095172130 Fix ansible-test --docker without tests dir. 4 years ago
Matt Martz d86d20a378
Fix label lookup in the default callback for includes (#68822)
* Replace included_file._args w/ included_file._vars

* Fix item value in output of include_tasks loop

Signed-off-by: Yadnyawalk Tale <ytale@redhat.com>

* Update tests for loop callback fix. Add changelog

Co-authored-by: Yadnyawalk Tale <ytale@redhat.com>

Fixes #65904
Fixes #66018
4 years ago
Felix Fontein bae5f18f5c
ansible-test: don't trigger full CI run for changes to changelogs/ and docs/ in collections (#68550)
* Don't trigger full CI run for changes to changelogs/ and docs/ in collections.

* Add changelog fragment.

* Update changelogs/fragments/68550-ansible-test-docs-changelogs.yml

Co-Authored-By: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Rick Elrod 38b7ceb75a
Update docker.txt to use the OpenSUSE 15.1 container image (devel edition) (#68785)
* Update docker.txt to use the OpenSUSE 15.1 container image

Signed-off-by: Rick Elrod <rick@elrod.me>

* handle installing mysql on suse

Signed-off-by: Rick Elrod <rick@elrod.me>

* add changelog fragment

Signed-off-by: Rick Elrod <rick@elrod.me>

* Update changelogs/fragments/ansible-test-opensuse-15.1.yml

Co-Authored-By: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 04edd77c42
Update tests to use RHEL 7.8. (#68787)
* Update tests to use RHEL 7.8.

Keeping support for RHEL 7.6 since collections are still using it.

* Fix tests for RHEL 7.7+ due to extras repo name change.
4 years ago
Brian Coca ba87c225cd
fixed fetch traversal from slurp (#68720)
* fixed fetch traversal from slurp

  * ignore slurp result for dest
  * fixed naming when source is relative
  * fixed bug in local connection plugin
  * added tests with fake slurp
  * moved existing role tests into runme.sh
  * normalized on action excepts
  * moved dest transform down to when needed
  * added is_subpath check
  * fixed bug in local connection

fixes #67793

CVE-2019-3828
4 years ago
Matt Martz 087be1da50
Allow tasks to notify a fqcn handler name (#68213)
* Allow tasks to notify a fqcn handler name

* Add tests. Fixes #68181

* Add changelog fragment

* Add test to ensure handlers are deduped properly with fqcn, role, and just handler names

* Add some docs about new special vars
4 years ago
Toshio Kuratomi 184f540056 Add some more unittests for fail_json
Test that order of msg as a keyword arg doesn't matter
4 years ago
Toshio Kuratomi 6531ba38f8 Allow the msg argument to fail_json() to be a positional argument
fial_json() requires a message be given to it to inform the end user of
why the module failed.  Prior to this commit, the message had to be a
keyword argument:

    module.fail_json(msg='Failed due to error')

Since this is a required parameter, this commit allows the message to be
given as a positional argument instead:

   module.fail_json('Failed due to an error')
4 years ago
Matt Clay 148e83f832
Fix ansible-test submodule handling. (#68759)
* Refactor ansible-test integration test.
* Add env --list-files option.
* Add tests for collection files tracked by git.
* Fix ansible-test submodule usage on older git.
* Fix submodule directory detection as files.
* Improve handling of nested source control.
4 years ago
Rick Elrod 13aef3c2e5
Add --docker-terminate flag to ansible-test (#68688)
* Add --docker-terminate flag to ansible-test

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 4916be24fd
[git] make force=True apply to git fetches (#68691)
Fixes #67972

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod f50df67517
coverage for lookup_list (#68683)
* coverage for lookup_list

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 82c60db49b
pip - Fix check_mode for prerelease packages (#68690)
* pip - Fix check_mode for prerelease packages

Fixes #68592.

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Martz 40d9650f20
Migrate apt_repo to community.general. Fixes #68637 (#68641) 4 years ago
Jordan Borean ae1cd27b57
WebRequest - Fix use_proxy: no on module options (#68603)
* WebRequest - Fix use_proxy: no on module options

* Fix up changelog fragment
4 years ago
Jordan Borean 6db66bcadd
Add relative module_util support for powershell (#68321)
* Add relative module_util support for powershell

* Added ansible-test classification support
4 years ago
Jordan Borean a20a527014
ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 (#68596) 4 years ago
Rick Elrod 541384e7b7
coverage for lookup_config (#68566)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Matt Clay 7323d5dd0d Fix references to old egg-info directory. 4 years ago
Matt Clay 0fb5593abf
Add initial ansible-test tests for collections. (#68533) 4 years ago
Matt Clay 735885d57c Fix ansible-test requirements installation. 4 years ago
Matt Clay c888035e02
Update Ubuntu 18.04 test container to 1.13. (#68534) 4 years ago
Rick Elrod 835ad75a0a
add test coverage for core filters (#68518)
Also remove now-useless exception handling.
4 years ago
Graham Mainwaring 2068131589
Fix colorization to not extend across newline boundary (#68517)
* Fix colorization to not extend across newline boundary

* Fix unit test to look for the newline outside the coloration

* Add changelog fragment
4 years ago
Matt Clay 53a3d1ffdb Fix ansible-test change detection traceback. 4 years ago
Matt Clay d8b5c11a63 Report error for coverage 5+ in ansible-test. 4 years ago
Matt Clay 27fc049993
Fix ansible-test code coverage collection. (#68502)
The last task in a play should now properly report code coverage.

This change should also eliminate empty coverage files, as well as incomplete coverage files resulting from early worker termination.
4 years ago
Matt Clay 6a7e438012 Fix code coverage in tests.
Code coverage < 5 must be used.

ci_coverage
4 years ago
Rick Elrod 3c3ffc09c2
Fix and add tests for some module_utils.common.validation (#67771)
* Fix test_check_mutually_exclusive exception-checking

Asserting inside of the `with` context of `pytest.raises`
doesn't actually have any effect. So we move the assert
out, using the exception that gets placed into the scope
after we leave the context, and ensure that it actually gets
checked.

This is also what the pytest documentation says to do:
https://docs.pytest.org/en/latest/assert.html#assertions-about-expected-exceptions

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add some tests for check_required_together

Signed-off-by: Rick Elrod <rick@elrod.me>

* use to_native instead of str, for consistency

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add newlines for pep8

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add tests for check_required_arguments

Signed-off-by: Rick Elrod <rick@elrod.me>

* Sort missing keys in error message, since hashes are unsorted and this can be random

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add changelog entry

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 2af76f16be
Unify yaml style in unarchive tests to be dict-style (refs #68272) (#68477)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Matt Clay 4fc10186b9
Move coding guidelines links to readme. (#68479) 4 years ago
Sloane Hertel 5945415398
fix using inventory and cache plugins in a collection (#56469)
* Allow custom inventory plugins and cache plugins

If _load_name is not set correctly the cache plugin can't load the documentation (which is also the arg spec)

Fix the existing inventory plugin in the collections tests

Add integration tests for using a cache plugin in a collection

* Set the attribute on the instance instead of the class

Deprecate importing custom CacheModules directly - they should use the cache_loader
4 years ago
Matt Clay 206896e9b2
Cleanup refs to deleted files/dirs. (#68480)
* Remove deleted contrib dir from MANIFEST.in

* Update package-data sanity test.

Remove deleted files and directories.

* Remove aws_config dirs.
4 years ago
Rick Elrod 0651e1c25f
Add some more test coverage for unarchive (#68272)
* Add some more test coverage for unarchive

This moves over (and slightly extends) coverage which was found in
incidental_flatpak_remote.

Signed-off-by: Rick Elrod <rick@elrod.me>

* add a group for testing too, user creation does not mean group creation on all platforms

Signed-off-by: Rick Elrod <rick@elrod.me>

* update the test group assert

Signed-off-by: Rick Elrod <rick@elrod.me>

* Fix style

Signed-off-by: Rick Elrod <rick@elrod.me>

* block/always

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 11e678b1b0
coverage for filter/urls.py, including fallback to custom implementations (#68412)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 01638e0ea2
[mathstuff] Get coverage into the 90% range (#68395)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Brian Coca 6452a82452
fix vault temp file handling (#68433)
* fix vault tmpe file handling

 * use local temp dir instead of system temp
 * ensure each worker clears dataloader temp files
 * added test for dangling temp files
 * added notes to data loader

CVE-2020-10685
4 years ago
Sandra McCann 8042d226e4
fix make webdocs warnings (#68411) 4 years ago
Brian Coca ecd66a6a6e
Action module xross coll (#68080)
* added test to verify xrs collection action/module

* added to runme

* sanity fixes

* corrected name

* avoid windoez
4 years ago
jctanner c067beecda
disable bot notification spam (#68460)
* disable bot notification spam

* add new key to botmeta sanity
4 years ago
Jordan Borean e12cea2c7c
ansible-test - fix up powershell module_util analysis for collections (#68422) 4 years ago