Commit Graph

10217 Commits (d86d20a378ef10fbcdff5174f58e4c94246f8aab)

Author SHA1 Message Date
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
Jordan Borean 48bef155fd
Ignore test files in new package-data sanity test (#68452) 4 years ago
Jordan Borean a2deeb8fa2
ansible-galaxy - add download option (#67632)
* ansible-galaxy - add download option

* Fix sanity issues and added integration tests

* Fix doc suggestions

* Added --pre option
4 years ago
Rick Elrod 28f8b89760
add readme to test/support (#68450)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Jordan Borean 127d54b363
galaxy - preserve mode properly on artifact (#68418)
* galaxy - preserve mode properly on artifact

* Fix py2 encoding issue

* Update lib/ansible/galaxy/collection.py

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

* Use sane defaults instead of sourcing from tarfile

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Brian Coca a9d2ceafe4
prevent ansible_facts injection (#68431)
- also only replace when needed
 - switched from replace to index
 - added test to verify bogus_facts are not accepted

CVE-2020-10684
4 years ago
Rick Elrod 97e5179745
Test installing a .deb that has deps, from a URL (#68332)
Improve coverage of the apt module and remove some incidental
coverage from incidental_lookup_rabbitmq.

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Yanis Guenane fb2a7ce923 Testing: Move from ibmcloud to ibmps 4 years ago
Matt Martz 8d8c73729f
Merge pull request #67093 from sivel/acd-content-dir
Add content dir where Ansible will look for the content provided by ACD
4 years ago
Rick Elrod dbd8d0a492
Pull timezone's incidental file coverage into file tests (#68247)
* Remove some unreachable code in the file module

Remove some cases in file.py which are covered by conditionals a few
lines earlier. Remove the duplicate code which will never be hit.

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

* Restore incidental file coverage from timezone module

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

* Combine two conditionals, add a changelog entry

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

* Make new test syntax consistent, add two stat tests

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