Commit Graph

8449 Commits (58a53fe0ebc80e2c663010729e634a8ad1e16495)

Author SHA1 Message Date
Daniel Mellado Area 58a53fe0eb
Add junos_l3_interfaces (#59026) 5 years ago
Matt Clay 93931810c8
Run pytest with dedicated pytest.ini. (#59842)
Also disable the pytest cache plugin.
5 years ago
Matt Clay f944bd2358 Update ansible-test to properly skip unit tests.
Unit tests will no longer run on "remote only" Python versions (2.6) for tests which are not "remote" (modules and module_utils).
5 years ago
Matt Clay 32fa4b15d1
More sanity test updates for collections. (#59841)
* Move action-plugin-docs ignores into ignore file.

* Update package-data sanity test.

The test now uses the file list provided by ansible-test.
5 years ago
Matt Clay ef6be41bf1 Disable pylint import-error for collections.
This matches the Ansible configuration.
5 years ago
Matt Clay 2198ecb1d2
Improve checking for unusable sanity test ignores. (#59833)
* Check sanity ignore paths against test paths.

This prevents ignores from being added for paths which will never be tested by the test being ignored or skipped.

* Fix sanity ignore handling for no/all targets.

This allows checking of ignores for tests which do not use a target list.

It also allows checking of the full ignore list on every test run for tests that always use all targets.
5 years ago
Matt Clay f61b044bf0 Support directories in sanity tests. 5 years ago
Jill R 57e4312a36
Add metaclass-boilerplate to elb_target lamda test function (#59832)
* Add metaclass-boilerplate to elb_target lamda test function

This change makes elb_target pass after #59831
5 years ago
Matt Martz c06751fb26 Handle situation where DOCS.options is None (#59783) 5 years ago
Markus Bergholz 196347ff32 ability to use lambda target in elb_target_group (#57394)
* enable elb_lambda_target test
5 years ago
Matt Clay e07c4f41d7 Standardize ansible-test sanity test filters. 5 years ago
Jordan Borean 652bfc7e19
win_template - use shared doc fragment for shared options (#59701)
* win_template - use shared doc fragment for shared options

* Change smart quote to em dash and fix whitespace issue
5 years ago
Sam Doran 691976c3d0
Fix podman_image integration tests (#59805)
Pin podman package at a specific version
5 years ago
Matt Clay 1351962eee Move "code smell" sanity test config loading. 5 years ago
Matt Clay e1c2891188 Add paths_to_dirs function to ansible-test. 5 years ago
Matt Clay 53af57b08b Fix type discrepancy in ansible-test. 5 years ago
Matt Clay 9f41a4273e Remove redundant sanity test ignores. 5 years ago
Abhijeet Kasurde 2ebc4e1e7e inventory: Handle IndexError while parsing limit file (#59776)
Handle IndexError exception raised while parsing the limit file.

Fixes: #59695

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Gonéri Le Bouder 1ec155e773 vmware_guest: clone VM with attached CDROM
If a VM has an attached CDROM, `backing` attribute of the CDROM will
be defined.
As a result, we cannot just loop `vm_obj.config.hardware.device` and check
for the existance of the attribute to decide if the entry is a
harddrive.

Instead, we check the type of the device, and only keep the
`vim.vm.device.VirtualDisk` disk.

This issue is actually breaking our test-suite with regular environment
because we keep a Fedora ISO attached to the VM.
5 years ago
Lukas Kämmerling 5bddd2f04a Add hcloud_network module (#59366)
* Add hcloud_network module

* Apply suggestions from code review

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

* Add notice about dependency

* Adjust tests

* Apply suggestions from code review

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Allow changing of ip range

* Add Setup step
5 years ago
Abhijeet Kasurde dbe618c084 podman_image: Disable unstable test
Disabling tests for podman_image until CI is green.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Ganesh Nalawade 127bd67f6e
Render elements in module doc and sanity test for sub-options (#59244)
* Render elements in module doc and sanity test for suboptions

*  Add support to render module elements value in ansible-doc output
   module html
*  Add validate-module sanity test of sunoptions.

* Add current validate module failures to ignore list

* Fix CI failure

* fix rebase conflict

* Fix CI issues

* Fix review comments

* Add validate-modules failure in ignore list
5 years ago
Matt Clay 5d7cc993dd
Clean up sanity test ignore handling. (#59749)
* Allow sanity tests to easily ignore themselves.

Useful for simple regex based sanity tests that error on their own script due to the regex or error message generated.

* Simplify no-smart-quotes sanity test.

Pruning of unversioned directories is handled by ansible-test.

* Remove directory pruning from boilerplate tests.

Files not passing these tests should be ignored instead.

* Add missing sanity ignore entries.
5 years ago
Adam Miller e9d7156f53 podman-docker docker compat for ansible-test (#59539)
* podman-docker docker compat for ansible-test

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove reprs, use ex.stderr instead

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove u''s ... not needed

Signed-off-by: Adam Miller <admiller@redhat.com>

* Update test/runner/lib/docker_util.py

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

* Update test/runner/lib/docker_util.py

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

* make sanity tests happy

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Sam Doran 19299f3310
Order data in xml integration test (#59742)
A recent update to lxml for Python >= 3.6 now preserves key order. Change the test input so the input is sorted, making tests pass on previous versions of lxml as well as the latest version.
5 years ago
Jiri Hnidek 978fe81a6d Added unit tests for redhat_subscription module (#58665)
* Fixed the redhat_subscription module:
  - Option 'pool_ids' works in Python3 now
  - It tries to attach only pools IDs that are available
  - Optimization of code: do not call list --available, when
    no pool is requested
  - Simplified configure() method
  - Small changes to generate same commands on Python2 and Python3.
    Order of arguments/options and pool IDs have to be same to
    be able to run unit test using Python2 and Python3.
  - Added fragments file for redhat_subscribtion module
5 years ago
Andrey Klychkov 32de51adac Unit tests: remove unused imports (#59740) 5 years ago
Sam Doran ed4a729fd6
Update constraints for coverage on Python 3.8 (#59733)
This fixes the unit tests hanging when run with Python 3.8 with coverage enabled
5 years ago
The Magician 4a7e11ba9a Bug fixes for GCP (as of 2019-07-09T06:06:53Z) (#59324) 5 years ago
Matt Clay 66654475e1 Update ansible-test Python version handling.
Minimum version requirements for sanity tests have been standardized:

- All single version sanity tests now require Python 3.5 or later.
- All multiple version sanity tests continue to use all supported Python versions.
- All version neutral sanity tests continue to work on any supported Python version.

Previously some tests required 3.5 or later with most of the remaining tests requiring 2.7 or later.

When using the `--python` option to specify a Python version:

- Tests which do not support the specified Python version will be skipped with a warning.
- If the specified Python version is not available, any test attempting to use it will generate an error.

When not using the `--python` option to specify a Python version:

- Multiple version tests will attempt to run on all supported versions.
- Single version tests will use the current version if supported and available, or if no supported version is available.
- Single version tests will use the lowest available and supported version if the current version is not supported.
- Any versions which are not available or supported will be skipped with a warning.

Unit tests automatically skip unavailable Python versions unless `--python` was used to specify a version.
5 years ago
Matt Clay ecddbdf0cb Isolate globals in import sanity test. 5 years ago
Shrikant Chaudhari 0b8354751b Added new module avi_user.py (#57116)
* Added new module avi_user.py and tests for that

* Updated documentation as per module argspec

* Updated as per review comments on IP address

* Updated documentation for types

* Fixed sanity check failure for __future__ import

* Updated documentation as per review comments.
5 years ago
Gonéri Le Bouder 93ea961205 vmware_guest: enable 3 extra tests
- network_with_dvpg
- network_with_portgroup.yml
- template_d1_c1_f0.yml
5 years ago
Tommy Brecher 4d775cbbf1 ec2_eip - added support for BYOIP and filtering reuse addresses by tag/value (#59180)
* change variable name from isinstance to is_instance (prevent overriding builtin function)

* Added support for:
  - Filtering existing Elastic IPs based on a tag name or it's value (when reuse_existing_ip_allowed is true)
  - Allocating new Elastic IPs from a given IPv4 pool (BYOIP support)

* yamllint corrections

* added examples for:
  -  tag_name,
  -  tag_value
  -  public_ipv4_pool

* remove aliases

* Added changelog fragment

* added integration tests for ec2_eip module

* removed space to trigger rebuild
5 years ago
Trishna Guha 6aaf0ea382
fix test typo nxos_lag_interfaces (#59710)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
5 years ago
Paul Belanger c562b53cb2 Fix nxos_facts integration tests (#59643)
This was incorrectly asserting the result of previous nxos_facts task.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
5 years ago
Tom Moore a589cac18a Windows: new win_netbios module (#58331)
* Initial commit win_netbios module

* Ansibot sanity improvements.

* Corrected file permissions.

* Windows: module description update

* Adding integration tests

* Added missing alias file

* Improvements made to tests and WMI efficiency.

* Correction from sanity check failures

* Shippable corrections

* Moved reboot flag.

* Slight tweak to return value conditoin
5 years ago
Toshio Kuratomi 0e9f002073 Fix build-ansible.py release-announcement
* When the release scripts were changed, this file to implement release
  announcements was left out

* Add announce.py to the compile skip lists as only the release engineers
  run this during package build.
5 years ago
Matt Clay f274cefa59
Consolidate sanity test ignore entries. (#59665)
* Update empty-init test.
* Update future-import-boilerplate test.
* Update line-endings test.
* Update metaclass-boilerplate test.
* Update no-assert test.
* Update no-basestring test.
* Update no-dict-iteritems test.
* Update no-dict-iterkeys test.
* Update no-dict-itervalues test.
* Update no-get-exception test.
* Update no-main-display test.
* Update no-smart-quotes test.
* Update no-unicode-literals test.
* Update no-unwanted-files test.
* Update replace-urlopen test.
* Update required-and-default-attributes test.
* Update shebang test.
* Update test-constraints test.
* Update use-argspec-type-path test.
* Update use-compat-six test.
5 years ago
Sorin Sbarnea 7c6fb57b7d Implements extra_hosts for docker_image module (#59540)
* Implements etc_hosts for docker_image module

Allows custom hosts on docker_image module.

The of this option made impossible to use docker_image module to build
images that required a custom hostname in /etc/hosts. For running
containers this option was already present.

While the python-docker API uses extra_hosts term, our existing module
already uses etc_hosts argument, so it sounds better to have some
consistency between docker_container and docker_image.

Fixes: #59233

* Update test/integration/targets/docker_image/files/EtcHostsDockerfile

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/cloud/docker/docker_image.py

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/docker_image_etc_hosts.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>
5 years ago
Andrey Klychkov 5b1a4f959a postgresql_set: improve CI tests (#59583) 5 years ago
Matt Clay 2f6de3aea4 Add missing decorator to ansible-test sanity.
This fixes sanity test errors so they show the proper error code instead of "bound method".
5 years ago
Kevin Breit 3cdc667888 New module - meraki_mx_l7_firewall (#55485)
* Initial commit for meraki_mx_l7_firewall module

* Add argument checking

* Sanity fixes

* Fix crash and improve integration tests

* Improved integration tests and coverage

* Reformat response data
- Module does not match argument structure of API
- PR reformats the response to match Ansible arg spec
- Improved integration tests

* Fix reformatting for diffs

* Create rename_* functions
- is_update_required() ignores the key id
- Meraki expects one of the keys to be id
- Function temporarily renames key to appId to get around this

* Tweak documentation and tests
- Tests now do an include so each task doesn't need delegate_to

* Fix which files I'm editing
5 years ago
Kevin Breit f8f3986871 New module - meraki_nat (#52889)
* Initial commit for meraki_nat module
- Query fully works
- Present is still very much in development

* Add initial code for present functionality, not complete

* Add request documentation

* Add examples and return documentation.

* Added payload to requests
- Module seems to need new idempotency check

* Allow 1:1 and 1:many NAT to work
- New idempotency check method is probably required to work

* Make all three options work
- Module isn't idempotent

* Diff support
- Added integration tests
- Diff support isn't quite done

* Fix diff output

* Enable idempotency assertion in tests

* Add test assertions for code coverage

* Update documentation and tests
- Split tests to separate file to avoid delegate_to

* Fix blank line
5 years ago
Kevin Breit db783eb2b9 New module - meraki_firewalled_services (#57289)
* Initial commit for module
- Module can query or modify network services on Meraki gear
- Check mode supported
- Integration tests included

* Small change to examples

* Move mutual exclusive to build in approach

* Sanity err

* Split integration tests into two files to avoid delegate_to

* Add the integration tests, woops
5 years ago
Andrey Klychkov 4e8df9a4b8 unit tests: remove unused imports (#59636) 5 years ago
Pilou 65013c4001 consul_session: ensure certificate is checked when HTTPS is used (#58693)
* consul_session: ensure SSL certificate is checked

* consul_session: don't ignore validate_certs param
5 years ago
Gonéri Le Bouder 8a821d57bd vmware_cluster_facts: fix the functional test
Fix the variable names.
5 years ago
Gonéri Le Bouder 964783fbd2 vmware_guest: speed up vmware_guest tests
- Use predictable VM name during the tests (test_vm1, test_vm2 and
  test_vm2). This to simplify the teardown of the newly created resource
  before the next test.
- Update the documentation to explain the new requirement
- Avoid VM creation with `with_items` when it's not mandatory. This to:
    - speed up the test execution, our hypervisors have limited resources
    - simplify the teardown
- Remove `create_d1_c1_f0_env.yml`, the test was just testing how Ansible
  pass environment variables.
- Correct the name for the `f0` variable (`f1`)
- Fix the DVS tests, the hosts can now reach the dvswitch1 vswitch
- Provision the VM with a poweroff status, this to improve the
  idempotency and sleep up the tests
- Avoid the use of `prepare_vmware_tests` to prepare virtual machines
  when we just need one machine
5 years ago
Nilashish Chakraborty 3da4c0dd3a
Update argspec to normalize across platforms (#59596)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
5 years ago