Commit Graph

5967 Commits (03d8fa05b68b2d700adbca2a5e83151e1aef71b5)

Author SHA1 Message Date
Felix Fontein 7caf70db42 docker_container: fix various idempotency problems and non-working options (#45905)
* Sorting args.

* Doing comparisons of options with container parameters in a more context-sensitive way.

This prevents unnecessary restarts, or missing restarts (f.ex. if parameters are removed from ``cmd``).

* Make blkio_weight work.

* Fix cap_drop idempotency problem.

* Making groups idempotent if it contains integers.

* Make cpuset_mems work.

* Make dns_opts work.

* Fixing log_opts: docker expects string values, returns error for integer.

* Adding tests from felixfontein/ansible-docker_container-test#2.

* Make uts work.

* Adding changelog entry.

* Forgot option security_opts.

* Fixing typo.

* Explain strict set(dict) comparison a bit more.

* Improving idempotency tests.

* Making dns_servers a list, since the ordering is relevant.

* Making dns_search_domains a list, since the ordering is relevant.

* Improving dns_search_domains/dns_servers.

* Fixing entrypoint test.

* Making sure options are only supported for correct docker-py versions.
6 years ago
René Moser 83ec418470
cs_loadbalancer_rule_member: fix error handling (#46012)
* make use of query_api
* fix sanity
6 years ago
Abhijeet Kasurde 905acd7c9e
VMware: vmware_inventory contrib testing (#42879)
* VMware: vmware_inventory contrib testing
* Use python.py to run inventory script during test.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Clay 54937ba784 Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
6 years ago
Sloane Hertel 18dc928e28
Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.
6 years ago
Matt Clay 7d8f1a7aae Disable failing sts_assume_role integration test. 6 years ago
Matt Clay 339d22a2bd
Improve stability of Docker integration tests. (#46005) 6 years ago
Matt Clay d603cd41fe Fix integration test library search path.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.
6 years ago
Matt Clay ac492476e5
Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.
6 years ago
Sam Doran b60854357b
Unify terms and UI between 1Password lookups and facts module (#45427)
* Unify login behavior between 1Password lookup plugins and module

- Use the same names for all credential aspects
- Only require the minimal amount of information for each
- Add more examples

* Change parameter terms

- use terms in line with 1Password documentation.
- update examples
- update tests

* Improve error messages in lookup plugin

* Unify onepassword_facts with lookup plugins

- use same methods and logic for signing in or reusing existing session
- unify terms with lookup plugins

* Change rc test for determing login

An rc other than 1 can be returned when a current login session does not exist.

* Create AnsibleModuleError class

ansible.errors is not available to modules, so create an AnsibleModuleError class within the module

Do not user os.path.expanduser since this is already done by virtue of the type being "path" in the argument spec.

* Add note about risk with fact caching sensitive data

* Add note on op version that was used for testing
6 years ago
Matt Clay 45b5685037 Add python.py coverage injector for ansible-test.
This can be used to run Python scripts from the repository with the
correct interpreter and allow collection of code coverage.

Useful for testing contrib inventory scripts.
6 years ago
Matt Clay 2148999048 Improve error handling for docs-build test. 6 years ago
tstoner 216da1c475 Changed when condition from checking image version to checking keys being (#45943)
defined
6 years ago
Matt Clay 2056c981ae Improve ansible-test match error handling. 6 years ago
Jordan Borean 27c10fa502
add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording
6 years ago
Jordan Borean 198423d6fb
powershell: do not quote join_path result to reflect ShellBase join_path (#45944) 6 years ago
Andrew Gaffney acac001742 Add number of skipped tasks to play recap in 'default' callback (#45797) 6 years ago
Matt Martz 95e77ac853
Ensure that the src file contents is converted to unicode in diff info (#45744)
* Ensure that the src file contents is converted to unicode in diff info. Fixes #45717

* Fix up and cleanup

* The diff functionality in the callback plugins should have the
  to_text() calls removed since we're now doing it in ActionBase
* catching of UnicodeError and warnings in the callback diff
  functionality from 61d01f549f haven't been
  needed since we switched to to_text so remove them.
* Add a note to ActionBase's diff function giving an example of when the
  diff function will be inaccurate and how to fix it

* Fix callback get_diff() tests

I believe the unittests of callback's get_diff() were wrong.  They were
sending in a list where strings were expected.  Because previous code
was transforming the lists into strings via their repr, the previous
tests did not fail but they would have formatted the test cases output
in an odd way if we had looked at it.
6 years ago
Dag Wieers 24dd87bd0a Fix incorrect use of subprocess.CalledProcessError (#45890) 6 years ago
Rémy Léone 7c7a7efbbe Add an option to enable public ip at server creation (#44826) 6 years ago
max-allan-surevine cb460dee74 Update keycloak_client.py (#43547)
* Update keycloak_client.py to document the 'realm' parameter, eliminate E322 ignore
6 years ago
Nathaniel Case 406b59aeba
Move persistent connections to only use registered variables (#45616)
* Try to intuit proper plugins to send to ansible-connection

* Move sub-plugins to init so that vars will be populated in executor

* Fix connection unit tests
6 years ago
Jordan Borean 5c73d4f4bd
async: use async_dir for the async results file directory (#45461)
* win async: use async_dir for the async results file directory

* tried to unify POSIX and PowerShell async implementations of async_dir

* fix sanity issue
6 years ago
Matt Clay 5a3000af19 Support comments in ansible-test flat files. 6 years ago
Dag Wieers cb4bf04be6 Fix pylint error on utf8 character in string (#45880)
Small fix
6 years ago
Matt Clay f3d1f9544b
Make ansible-test available in the bin directory. (#45876) 6 years ago
Jordan Borean 582a4dfa13
append AWS region to test instance file (#45877) 6 years ago
Zim Kalinowski 83645963fb Fixing assigning ssl certificate to http listener in app gateway (#45830)
* fixed ssl certificate reference

* modified test
6 years ago
Zim Kalinowski 16fa49a894 adding os disk name (#45126)
* adding os disk name

* fixed test
6 years ago
Jordan Borean a7d372c3ba
go back to FreeBSD 11.1 for tests due to 11.2 stability issues (#45872) 6 years ago
Eric Helms 74b94e119e Deprecate foreman and katello modules (#42043)
* Deprecate foreman and katello modules in 2.8, remove in 2.12
6 years ago
Felix Fontein bc69aeca7f Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility.

* Adding unit test.

* PEP8.

* Changelog.
6 years ago
Daniel Speichert d34cf93f1a Migrate from MySQLdb to PyMySQL (#40123)
* Migrate from MySQLdb to PyMySQL

* Deduplicate driver loading and failure message

* Explain requirements

* Apply requirements docs change to proxysql too

* Add changelog
6 years ago
Pilou 60160c1e90 doc: exercising module code locally: update cmd (#45697)
The documented way to execute module code locally wasn't always working:

    $ python ./lib/ansible/modules/files/file.py <<< '{"ANSIBLE_MODULE_ARGS": {}}'
    Traceback (most recent call last):
      File "./lib/ansible/modules/files/file.py", line 177, in <module>
        from ansible.module_utils.basic import AnsibleModule
      File "~/ansible/lib/ansible/module_utils/basic.py", line 78, in <module>
        import tempfile
      File "~/ansible/lib/ansible/modules/files/tempfile.py", line 69, in <module>
        from tempfile import mkstemp, mkdtemp
    ImportError: cannot import name 'mkstemp'
6 years ago
Dag Wieers 2edf20d1ed Docs: Avoid use of 'default: null' (#45795)
Various modules document the default 'null' value, but it causes None to
be shown in the documentation explicitly.
6 years ago
Felix Fontein 6e04a1dbdc integration tests for docker_container (#45747)
* First round of integration tests for docker_container.

* Added regression test for #45700.

* Work around dict order randomization.
6 years ago
Matt Clay 846ee7e85f Fix issues with docker_stack test:
- Leave swarm at end of test to avoid breaking docker_swarm test.
- Do not update stack to avoid error leaving swarm.
- Put test back in correct group.
6 years ago
Tim Rupp ccfbed3dbc
Adds bigiq_device_facts module (#45822)
This module can be used to query a variety of facts from a BIG-IQ
6 years ago
Matt Clay 99cac99cbc Block network access for unit tests in docker. 6 years ago
Matt Clay be199cfe90 Minor fixes for unit test delegation. 6 years ago
Julien PRIGENT 6059246093 EFS - add support for new Provisioned Throughput (#43253)
* efs.py: Add support for EFS provisioned throughput

* efs_facts.py: Add support for EFS provisioned throughput

* efs_facts integration tests updated with provision throughput

* efs_facts: Tests refactoring - add failure and success playbook according to botocore version.

* efs_facts: More tests and new option descriptions adjustment

* efs_facts tests renamed to efs
6 years ago
René Moser 1ed3bd9168
vultr: fix for unreliable API behavior (#45712) 6 years ago
Matt Clay abe8e4c9e8
Run unit tests in parallel. (#45812) 6 years ago
Matt Clay 06e2e0e040 Change group on docker_stack test.
This should provide a temporary fix for conflicts with the docker_swarm test.
6 years ago
Matt Clay 379a7f4f5a
Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
6 years ago
Dario Zanzico 54c3d1c24e New module: add docker_stack module (clound/docker/docker_stack) (#24588)
* add docker_stack module + tests
6 years ago
Matt Clay 53b230ca74 Fix unit test parametrize order on Python 3.5. 6 years ago
Matt Clay 0686450cae
Fix unit tests which modify the source tree. (#45763)
* Fix CNOS unit test log usage.
* Use temp dir for Galaxy unit tests.
* Write to temp files in interfaces_file unit test.
* Fix log placement in netapp_e_ldap unit test.
6 years ago
Will Thames d2569a3f7d Improve iam_group exception handling (#45599)
* Improve iam_group exception handling

Use AnsibleAWSModule for iam_group and handle BotoCoreErrors
as well as ClientErrors. Use fail_json_aws to improve error messages

* Add minimal iam_group test suite

Update some of the read-only IAM permissions (this is not sufficient
to run the test suite but it gets further than it did until it tries
to add a (non-existent) user)

* Clean up after tests
6 years ago
Sloane Hertel 2167ce6cb6
Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754) 6 years ago