Commit Graph

9156 Commits (bcd118c771dad85aea90f6844e9a7686d785210a)

Author SHA1 Message Date
Adrian Likins 6cdd8e5fc2 Add support for automation-hub authentication to ansible-galaxy (#63031)
Adds support for token authentication in Automation Hub. Fixes: ansible/galaxy-dev#96

(cherry picked from commit 239d639fee)
5 years ago
Matt Clay c4446a8f2e [stable-2.9] Fix ansible-test virtualenv real python search.
ansible-test now properly searches for `pythonX.Y` instead of `python` when looking for the real python that created a `virtualenv`.
(cherry picked from commit b91f452f4f)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay d69852c890 [stable-2.9] Install zip for unarchive test when using dnf.
(cherry picked from commit 86ae3cfa12)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay f004deaf91 [stable-2.9] Work around ssh-keygen issue in ansible-test. (#63211)
Newer versions of ssh-keygen create PEM keys that are not recognized by Paramiko.

Now ansible-test compensates for this by updating they keys it generates so Paramiko will recognize them.
(cherry picked from commit 022335669c)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 24e64d1ba1 [stable-2.9] Fix ansible-test integration temp dir location.
Previously the temporary directory used to run integration tests resided under the user's home directory. This prevented ansible-playbook from detecting the default collection when running tests.

Now the temporary directory is created within the collection to facilitate default collection detection.
(cherry picked from commit 4c79f1ec4d)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Mike Wiebe 6d5cac5f51 [stable-2.9] Fix nxos_l3_interfaces module and tests (#62545)
* Fix nxos_l3_interfaces module and tests

* Use get_interface_type

* get_interface_type in utils lib

(cherry picked from commit 918f768890)
5 years ago
Adam Miller 42f16219b6 dnf - properly handle idempotent removal of wildcard globs (#63034)
Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Lukas Kämmerling 66d4d8c494 Fix and reenable hcloud_network_info tests 5 years ago
Matt Clay ce7ebd30e8 [stable-2.9] Limit Shippable matrix check to ansible repo.
(cherry picked from commit ada02f1966)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 4dda11a770 [stable-2.9] Exclude tmp dir from ansible-test results copy.
This fixes test errors related to failures copying temporary test results files from a remote system back to the local system.

It also speeds up processing of test results and reduces network utilization by avoiding the temporary files.
(cherry picked from commit 3f2380ccce)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 988d369305 [stable-2.9] Fix ansible-test PYTHONPATH handling.
Running from an installed version of ansible-test now results in tests using a dedicated directory for PYTHONPATH instead of using the site-packages directory where ansible is installed.

This provides consistency with tests running from source, which already used a dedicated directory.

Resolves https://github.com/ansible/ansible/issues/62716
(cherry picked from commit 831e1bf2e0)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Gonéri Le Bouder 2a68bc0c29 mongodb_replicaset/test: properly kill the nodes
The `pids` module returns the list of the PID in a `pids` key.

This change ensures we correctly wait for the end of the previous mongod
instances before we start the next ones.

In addition, we remove an unnecessary `ignore_errors`.

See: #61938

Original PR: https://github.com/ansible/ansible/pull/62627
(cherry picked from commit cee55ab718)
5 years ago
Jordan Borean de3e76ad98 Fix test_galaxy failing test (#62624)
(cherry picked from commit 85eba9d860)
5 years ago
Sloane Hertel eae2e0d1f4 Add a representer for AnsibleUnsafeBytes (#62598)
* Add a representer for AnsibleUnsafeBytes

* changelog

* Add unit tests

Remove native string test until we have time to evaluate how this the function should work
Add non-ASCII characters to test cases

* Compare to the string on Python 2

Add a comment in the test about this behavior
(cherry picked from commit 4cc4c44dd0)
5 years ago
Rohit d58d2bc875 [Backport 2.9] vyos: Fix to give no traceback on empty config (#62568)
* vyosnoconfig tracebackfix (#62518)

* vyosnoconfig tracebackfix

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* vyos noconfig tracebackfix test cases added

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* test/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml

(cherry picked from commit b24f7d2800)

* empty config traceback fix

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
5 years ago
Gonéri Le Bouder 7750d30eb4 temporarily disable hcloud_network_info tests
`hcloud_network_info` tests are currently broken in `stable-2.9`.

See: https://github.com/ansible/ansible/issues/62606
5 years ago
Sumit Jaiswal 34609a0973 Fix traceback empty config error to meaningful msg for IOS (#62572)
* Fix traceback empty config error to meaningful msg for IOS (#62538)

* fix empty config msg

* fix space

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 35463d45f4)

* changelog
5 years ago
Zim Kalinowski b8e905cd4d Backport/2.9/62559 (#62570)
* snapshot fix for backporting (#62559)

(cherry picked from commit 054519920e)

* changelog fragment
5 years ago
Will Thames 5a99d473d3 Ensure k8s apply works with check mode (#60572)
* Ensure k8s apply works with check mode

Update the new predicted object with fields from the previous object
before applying in check mode

Don't log output of `file` with `state: absent` on huge virtualenvs!

Fixes #60510

* Use openshift client fix to improve apply for check mode

Use new apply_object method to get a better approximation
of the expected object in check mode.

Requires released upgrade to openshift

* Add changelog fragment for k8s apply check mode fix

* Update changelogs/fragments/60510-k8s-apply-check-mode.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>
(cherry picked from commit a684bb9f5b)
5 years ago
Matt Clay b1ba759862 Fix plugin names for collection plugins. (#60317)
* Fix plugin names for collection plugins.

Add an integration test to verify plugin __name__ is correct for collection plugins.

* Fix collection loader PEP 302 compliance.

The `find_module` function now returns `None` if the module cannot be found. Previously it would return `self` for modules which did not exist.

Returning a loader from `find_module` which cannot find the module will result in import errors on Python 2.x when using implicit relative imports.

* add changelog

* sanity/units/merge fixes

(cherry picked from commit 1c64dba3c9)
5 years ago
Matt Clay ef94e3c72a [stable-2.9] Backport default-test-container updates. (#62473)
* Update default test container with Python 3.8b4 (#62100)

* [stable-2.9] test: bump default-test-container

VMware VSphere SDK needs an up to date version of `pip` for the
installation step. With the current image, we face the following error:

```
(...)
02:27 Collecting git+https://github.com/vmware/vsphere-automation-sdk-python.git (from -r /root/ansible/test/lib/ansible_test/_data/requirements/integration.cloud.vcenter.txt (line 2))
02:27   Cloning https://github.com/vmware/vsphere-automation-sdk-python.git to /tmp/pip-req-build-pm27t16b
02:33 Requirement already satisfied: pyvmomi in /usr/local/lib/python3.6/dist-packages (from -r /root/ansible/test/lib/ansible_test/_data/requirements/integration.cloud.vcenter.txt (line 1)) (6.7.1.2018.12)
02:33 Requirement already satisfied: lxml>=4.3.0 in /usr/local/lib/python3.6/dist-packages (from vSphere-Automation-SDK==1.4.0->-r /root/ansible/test/lib/ansible_test/_data/requirements/integration.cloud.vcenter.txt (line 2)) (4.4.0)
02:33 Processing ./\\localhost/tmp/pip-req-build-pm27t16b/lib/vapi-runtime/vapi_runtime-2.12.0-py2.py3-none-any.whl
02:33 Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/root/ansible/\\\\localhost/tmp/pip-req-build-pm27t16b/lib/vapi-runtime/vapi_runtime-2.12.0-py2.py3-none-any.whl'
```

Bump default-test-container to 1.9.3 to get an up to date release of
`pip` (was 19.0.2, is now 19.2.3)..
(cherry picked from commit b68f5b406a)

Co-authored-by: Gonéri Le Bouder <goneri@lebouder.net>

* Add missing changelog fragments. (#62471)

* Add missing default-test-container 1.9.2 fragment.
* Add missing default-test-container 1.9.3 fragment.
5 years ago
Mike Wiebe ff9873beaa [stable-2.9] Stabilize nxos initiated copy for nxos_file_copy plugin (#62355)
* Retry spawn connection on failure

* Add debug logs

* Additional debug logs

* Close session before respawn attempt

* More debug info and increase loops

* Remove debug info and reset error dict on reconnect

* Add epdb debuger

* Add epdb debuger

* Add epdb debuger

* Wait before sending password and close pexpect session

* Fix comment typo

* Scrub error logs

* Scrub error logs

* Add more specific initial connect pattern

* Fix shippable errors

* Dont make remote_scp_server_password a hard requirement

* Add saftey check

(cherry picked from commit 97b15e9f0c)
5 years ago
Felix Fontein 303cc6aca5 [2.9] acme_* modules: bump acme-test-container version (#62448)
* Bump acme-test-container version. (#62381)

(cherry picked from commit d8d3790d6a)

* Add changelog fragment.
5 years ago
Matt Clay 4e323de7ef Remove bad sanity ignore entry. 5 years ago
Matt Clay 0d79d993f7 [stable-2.9] Mark ansible-test cloud credentials as sensitive.
(cherry picked from commit 9f7b124a6f)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Mark Goddard 0d56376a4e Fix os_keystone_endpoint endpoint_interface docs (#62283)
The os_keystone_endpoint module has two interface arguments -
'interface' for authentication, and 'endpoint_interface' for the
endpoint being registered. Currently the module documentation only
covers 'interface', when in fact it should cover 'endpoint_interface'
and pick up 'interface' from the standard OpenStack module parameter
documentation.

(cherry picked from commit 448a8c4e5f)
5 years ago
Evgeni Golov 2c8b706a0c typo: missing-subption-docs → missing-suboption-docs (#62180)
updates the name of the test and all ignore.txt entries

(cherry picked from commit 48a39f5616)
5 years ago
Gonéri Le Bouder 4c8fa415b1 test: disable hcloud_floating_ip_info
Temporarily disable `hcloud_floating_ip_info`, this until #62414 is
resolved.

(cherry picked from commit edf15b346f)
5 years ago
Matt Clay ffbda8d153 WIP - Fix ansible-doc bugs and add integration tests. (#62461)
* Add integration tests for ansible-doc.

* Enable tests that now pass

* Cleanup processing of plugin docs

* Mostly separate the steps of processing plugin docs

  1) Acquire source data
  2) Transform and calculate additonal data
  3) Format data for output
  4) Output data

  format_plugin_doc() is still mixing transformation and formatting but
  that should be fixed in a devel-only change

* Raise exceptions in _get_plugin_doc() on errors.

* Remove check to exclude on blacklisted extensions.  We already request
  only .py files

* If there is no DOCUMENTATION entry in the plugin, raise an exception
  from _get_plugin_doc().  Everywhere we use _get_plugin_doc(), this is
  treated as an error

* If there is no ANSIBLE_METADATA raise an exception as well as
  displaying of docs assumes that this has been set.

* If there is neither DOCUMENTATION nor ANSIBLE_METADATA, warn about the
  lack of METADATA and error on the lack of DOCUMENTATION.  Lack of
  DOCUMENTATION is more important so it is what the user should see.

* Add a few special cases for backwards compat.  These should probably
  be made errors in 2.10:
  * no docs but has metadata shows no documentation rather than an error
  * empty plugin file shows no doumentation rather than an error

* Simplify backwards compatibility logic.

(cherry picked from commit 3b86dc3e12)
5 years ago
Matt Clay ffb3e19dc6 [stable-2.9] Fix ansible-doc traceback and sanity test. (#62040)
* Fix ansible-doc traceback for removed modules.

This avoids tracebacks with errors like the following when a module has been removed:

module module_name missing documentation (or could not parse documentation): 'NoneType' object does not support item assignment

* Fix ansible-doc sanity test warning handling.

Warnings about removed modules/plugins on stderr are now properly ignored.

Previously an ansible-doc error could result in unrelated errors going undetected because tests were stopped early and the underlying error was ignored.
(cherry picked from commit 064e8e1ef4)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Gonéri Le Bouder 997f272c4e hcloud_networ_info: be more resilient is network already exists
We may already have an existing network or subnet. This commit ensures
we don't raise an error in this case.
e.g: https://app.shippable.com/github/ansible/ansible/runs/143559/145/tests

(cherry picked from commit 459677877a)
5 years ago
Sumit Jaiswal 51b8daa64d Fix ios_lldp_global enable to enabled raised in issue 61554 (#62440)
* fix ios_lldp_global (#62420)


(cherry picked from commit 9addad0f4a)

* changelog
5 years ago
Matt Clay ec841a086c [stable-2.9] Redact sensitive values by default in ansible-test
(cherry picked from commit 0631e057e9)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Trishna Guha b9e8a6a170 gather_facts action plugin: Fix loading network facts modules for smart gathering (#59856)
* fix smart gathering for network_os in gather_facts action plugin

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Fix detection of network_os for smart gathering

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add unittest

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* make pep8 happy

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 5cd3be9129)
5 years ago
Mike Wiebe d4e577bd6d nxos_telemetry replaced state (#62368)
(cherry picked from commit b0668e17ed)
5 years ago
Sumit Jaiswal 7a668dab06 Backport PR for Check Point Unit tests for the following module from PR 62338 (#62390)
* Network and address range tests (#62338)

* commit network and address_range

* remove test_cp_mgmt_network from ignore.txt

(cherry picked from commit b4dcd7c835)

* changelog

* fix shippable

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
5 years ago
Sumit Jaiswal bcd63a6c92 Backport PR for Check Point Unit tests for the following module from PR 62214 (#62405)
* Add unit tests for check_point ansible modules (#62214)

* Update test_cp_mgmt_network.py

* 18 tests

(cherry picked from commit 271825cfaf)

* changelog
5 years ago
Sumit Jaiswal fed6c0ace6 Backport PR for Check Point Unit tests for the following module from PR 62213 (#62386)
* Add unit tests for check_point ansible modules (#62213)

* Update test_cp_mgmt_network.py

* 17 tests

(cherry picked from commit c7f9c3f27e)

* changelog
5 years ago
Egor Zaitsev a48f8f229e routeros_facts: fix for error when there's more than 10 interfaces (#62346)
* routeros_facts: fix for error when there's more than 10 interfaces (#61376)

* fix: proper regex for preprocessing routeros output

* test: regression test

* test: fix nondeterministic unit test

* changelog
5 years ago
Sumit Jaiswal 4df7faa213 Backport PR for Check Point Unit tests for the following module from PR 62216 (#62389)
* changelog

* Forth pr 18 tests (#62216)

* Update test_cp_mgmt_network.py

* 18 tests

(cherry picked from commit ebdf78d6e4)

* fix eol

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
5 years ago
Sumit Jaiswal 347c10c5ff Backport PR for Check Point Unit tests for the following module from PR 62215 (#62388)
* Third pr 18 tests (#62215)

* Update test_cp_mgmt_network.py

* 18 tests

(cherry picked from commit 3a5c68205c)

* changelog
5 years ago
Sumit Jaiswal 1148e68049 Backport PR for Check Point Unit tests for the following module from PR 62322 (#62385)
* Commands tests (#62322)

* commands tests

* add space in order to delete it and tun shipable tests again

* delete space in order to run shipable tests again

(cherry picked from commit 47cf4e6565)

* changelog
5 years ago
chkp-orso e2aaf72d6a unique tests (#62328)
(cherry picked from commit 6bb8861b0e)
5 years ago
Ganesh Nalawade e9a16d381d Change enable to enabled for junos_interfaces module (#62321)
Fixes #62319

Change `enable` option to `enabled` in junos_interfaces
and junos_lldp_interfaces
data model to be in sync with other network platform
resource modules added in 2.9 version.

(cherry picked from commit a9a5f4e40d)
5 years ago
Matt Clay 54ea1353b3 [stable-2.9] Mark AWS credentials in ansible-test as sensitive.
This avoids displaying the credentials in CI when retrying tests at maximum verbosity.
(cherry picked from commit b73e7721df)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 7f2ba1aaf8 [stable-2.9] Fix display of sanity test doc links.
The documentation links are now displayed when running from an install.

Previously the links were only displayed when running from source.
This was due to ansible-test checking for the presence of documentation files locally, which are only present when running from source.
The check is no longer necessary since there is a sanity test in place to enforce the presence of documentation for all sanity tests.
(cherry picked from commit 32d965e)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Felix Fontein 34a48dc2ca Re-enable some docker_swarm tests. (#61875)
(cherry picked from commit 098a13dff4)
5 years ago
Matt Martz 20fee691e3 [stable-2.9] Don't treat no checksum as a checksum match (#62146)
Fixes #61978
* moar tests for get_url fetch behavior with existing file
* add changelog fragment
(cherry picked from commit 7d51cac)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Ganesh Nalawade f7fed1dacc Fix for junos cli_config replace option (#62131)
* Fix for junos cli_config replace option

*  For device that support replace option by loading
   configuration from a file on device `config` option
   is not required and value of `replace` option is the
   path of configuration file on device. This fix allows
   invoking run() function in cli_config if `config` option
   is None and `replace` option is not boolean

*  The command to replace running config on junos device
   is `load override <filename>` and not `load replace <filename>`
   This is fixed in the junos cliconf plugin.

* Add integration test

(cherry picked from commit 200ed25648)
5 years ago
Mario Lenz 9812e52682 [stable-2.9] VMware: Fix issue with order of changes in vmware_vcenter_statistics (61345) (#62088)
* VMware: Fix issue with order of changes in vmware_vcenter_statistics

* [WIP] VMware: Fix fragile sort order in vmware_vcenter_statistics (#62288)

* vmware_vcenter_statistics: Fix fragile sort order

* vmware_vcenter_statistics: Python 2.6 compatibility

(cherry picked from commit 3e4d5aeee3)
5 years ago