Commit graph

7992 commits

Author SHA1 Message Date
Abhijeet Kasurde
ee8a607cca ipaddr: Handle network address in ipmath (#57149)
* Updated testcase, documentation

Fixes: #54457

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-04 14:01:18 +05:30
Chris Van Heuveln
6bb13bbb84 nxos_vlan: fix broken purge behavior (issue #57101) (#57229)
* nxos_vlan: fix broken purge behavior (issue #57101)

Symptoms/Analysis:
- `nxos_vlan` `purge: true` would fail when `purge` was trying to delete all unspecified vlans, including vlan 1.
- `nxos` devices do not allow removing vlan 1 and raise a cli exception error
- Previous fix #55144 caused a side effect when `purge` was used: vlan changes specified by `aggregate` were ignored; e.g.
 - vlan 4 is not present; playbook specifies `aggregate: { vlan: 4 }, purge: true`
 - results in proper purging but vlan 4 is not created

Solutions:
- ignore vlan 1 when purging
- remove the `not purge` check from state present logic

Added additional unit tests and integration tests.
Tested against all regression platforms.

* PEP fixes

* Add agg_show_vlan_brief.txt fixture

* Add warning for removing vlan 1

* change method name check
2019-06-04 09:14:09 +05:30
Matt Clay
858e3a7272 Correct virtualenv usage in integration tests. 2019-06-03 15:23:04 -07:00
Felix Fontein
7b40b569b2
Rename memset_*_facts to memset_*_info (#57030)
* Rename memset_*_facts to memset_*_info

* Add changelog.
2019-06-03 21:19:49 +02:00
Stefan Horning
ddfaa83ccf s3_bucket: add encryption capabilities to the module (#55985)
* s3_bucket: add encryption capabilities to the module
2019-06-03 11:25:09 -07:00
Andrey Klychkov
3e06013eb6 unittests for module_utils.common.removed.removed_module function (#57214) 2019-06-03 11:12:12 -04:00
Mike Wiebe
87422ea7e7 nxos_snmp_user, nxos_snmp_host integration test fixes. (#57201)
* Fix nxos_snmp tests

* Add imagetag check for nxos_snmp_user test
2019-06-03 18:33:52 +05:30
Sam Doran
2e0229a4b6 ansible-vault: convert vault_password_files to list to prevent traceback (#57186)
* Convert vault_password_files to a list

* Add changelog and tests
2019-06-03 12:14:06 +02:00
Sloane Hertel
21cd24a0dd improve conditional warnings (#57190)
* Fix order for warning on templated conditionals

Fix bare variable warnings when the variable is a boolean

* changelog

* Add tests for cases that should and should not give warnings

If the behavior may change when the default behavior for CONDITIONAL_BARE_VARS becomes False there should be a warning. Boolean type conditionals will not change in behavior so don't warn.

* oops, forgot to add files

* typo
2019-06-03 12:12:32 +02:00
Andrey Klychkov
96bf243265 New module postgresql_copy: copy data between a file and a table (#56835)
* New module postgresql_copy

* New module postgresql_copy: added tests

* New module postgresql_copy: changed tests

* New module postgresql_copy: doc format fixes

* New module postgresql_copy: fixes

* New module postgresql_copy: added upper, PostgreSQL

* New module postgresql_copy: fixed description

* New module postgresql_copy: added note about superuser

* New module postgresql_copy: remove SQLParseError

* New module postgresql_copy: fixed opt_need_quotes type

* New module postgresql_copy: fixed check_mode

* New module postgresql_copy: small fix
2019-06-03 19:11:50 +10:00
René Moser
0c66a5d3ca
cloudcscale_floating_ip: add types (#56924) 2019-06-03 10:43:32 +02:00
rajaspachipulusu17
6b2688245e Pluribus Networks ipv6security raguard port module with UT (#57033)
* Pluribus Networks ipv6security raguard port module with UT

* Dox fix
2019-06-03 11:44:28 +05:30
rajaspachipulusu17
b8a317c527 Pluribus Networks vrouter packet relay module with UT (#57155)
* Pluribus Networks vrouter packet relay module with UT

* Doc fix
2019-06-03 11:43:29 +05:30
Gonéri Le Bouder
e460a219cd VMware: vmware_evc_mode: fix the functional tests (#56875)
* Updated vmware_evc_mode tests
* Remove extraneous line in main.yml

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-02 08:16:05 +05:30
Felix Fontein
c54d79bc13
Extend docker_image tests. (#57090) 2019-06-01 15:29:00 +02:00
Abhijeet Kasurde
c8eda7773e
VMware: Update vmware_guest_powerstate (#57000)
* Updated documentation
* Updated testcases
* Updated example
* Updated logic
* Provided option to specify task name, task description, task enable status etc.

Fixes: #56987

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-01 08:10:05 +05:30
Felix Fontein
7cd229aa97
Fix assignments in docker tests. (#57249) 2019-05-31 23:47:53 +02:00
Matt Martz
8bd4e2a144 cert validation fixes - Attempt 2 (#55953)
* Attempt 2 of cert validation fixes

* Remove unused code

* Cleanup the tmp cert using atexit

* Fix linting issues

* Only add SSLValidationHandler when not HAS_SSLCONTEXT

* Catch value errors on non PEM certs

* Only catch NotImplementedError to avoid masking issues

* set self._context even with PyOpenSSLContext for conformity

* Fix error building

* normalize how we interact with the context we create

* Remove unused code

* Address test for py3.7 message difference

* open_url should pass the ca_path through

* Account for new error in url lookup test

* Guard some code behind whether or not we are validating certs

* Make _make_context public

* Move atexit.register up to where the tmp file is created
2019-05-31 16:35:25 -04:00
Sviatoslav Sydorenko
4c7fff315e
Fix module_utils.common.test_collections testsuite
PR #57181
2019-05-31 13:40:18 +02:00
Rohit
ae033f1ec3
vyos interfacefix and test cases (#57169)
Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
2019-05-31 16:13:40 +05:30
Sebastiaan Mannem
223f509ea3 Issue 56430 (#57147)
* Adding integration test for 127.0.0.1/32 and ::1/128.

* Making sure file is not corrupted when render fails

* Fixes #56430

* Adding changelog for MR 57147/Issue 56430
2019-05-31 12:32:28 +02:00
Andrey Klychkov
bf25889bfd test_postgres: fix typos 2019-05-30 07:18:30 -07:00
Andrey Klychkov
01ed7a489a Add unit tests for lib/ansible/module_utils/common/text/converters.py (#56915)
Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2019-05-30 09:22:53 -04:00
Will Thames
ac1895453f Add test case for k8s cascading deletes (#55987)
* Add test case for non-cascading deletes

Deleting a DaemonSet does not delete associated pods,
even though it should

* Add coverage module when using pip

Otherwise tests seemingly fail
2019-05-29 19:26:43 -04:00
Kevin Breit
5008e1d479 meraki_config_template - Enable check mode (#54502)
* Add support for check mode

* Check mode returns proper changed status
- Added is_template_valid()
- Restructured check_mode so it will always return data
- Check mode should show proper changed status
- Code is untested and integration tests need to be expanded

* Fix deleting networks
- Add integration tests for deleting networks
- Refine tests based on changed/unchanged

* Remove one task from integration test
2019-05-29 16:30:26 -04:00
Kevin Breit
4df53f869e meraki_network - Add support for disableRemoteStatusPage (#48971)
* Add support for disableRemoteStatusPage
- New feature in the Meraki API
- Yes, it's a double negative, I may fix at some point

* Remove double negative
- All disables became enable and logic is reversed
- This isn't yet tested

* Switching computers!!!

* Apply changes to make the logic work, even reversed

* Attempt to fix some formatting errors

* Add documentation fragment

* Fix whitespace

* Add disable_my_meraki back, with deprecation notice

* Edit changelog notice

* Update deprecation version

* Update example to be a block and change deprecation message.

* Remove duplicate delegate_to

* Change deprecation notice.
2019-05-29 16:29:40 -04:00
Felix Fontein
c47e9d22b4
Rename one_image_facts -> one_image_info (#57035)
* Rename one_image_facts -> one_image_info.

* Add changelog.

* Forgot symlink.
2019-05-29 21:23:25 +02:00
Ian Wienand
39945b8570 Make query with errors='ignore' return a blank list (#57038)
The jinja2 query() function (or lookup with wantslist=True, which is
the same thing) should always return a list.

However, if you combine a query with errors='ignore' and take the
error path, the current code returns a None value.  This is important
in a case such as

 - name: Conditional include file
   import_tasks: '{{ item }}'
   vars:
     params:
       files:
         - path/file1.yaml
         - path/file2.yaml
   loop: "{{ q('first_found', params, errors='ignore') }}"

If neither file1.yaml or file2.yaml exist, this should do nothing by
returning an empty list to the loop.  Currently if you run the above
task you'll get a rather unhelpful:

 Invalid data passed to 'loop', it requires a list, got this instead: .

This change ensures that when a query ignores an error, it returns a
empty list.  The errors='ignore' case is tested in several variants
with first_found.  The extant (but deprecated) "skip: True" for
first_found doesn't seem to be explicitly tested; a test is added here
to avoid regressions before removal in 2.12.

This fixes a regression you'll hit if you follow the suggestion in the
deprecation message included with
e17a2b502d to use errors=ignore over
"skip: True" for first_found.  This change adds an example that points
out the query/lookup difference and also fixes the error message to
not mention the now deprecated "skip: True".

Closes #56775
2019-05-29 13:23:02 -04:00
Kevin Breit
7864df8cb9 meraki - Rewrite update requirement check (#48394)
* Rewrite idempotency check
- Check now operates recursively and works on multiple types
- Order of lists matter

* Remove blank line for lint

* Fixed idempotency checks in meraki_ssid
- New sanitize() method for finding keys unique in compared dicts
- Fixed bug in meraki_ssid where SSID specified by number breaks
  - This will require a backport
- Converted ignored_keys from tuple to list

* Made changes required for idempotency

* Add changelog fragment

* Add unidirectional option for testing

* Disable option 1 check

* General fixes for is_update_required testing
- Added commented out debug statements in method
- Fixed ignored_keys modifications

* Remove old commented algorithm
2019-05-29 10:18:01 -04:00
Daniel Mellado Area
0ada6b8d8d Fix junos_facts test (#57065)
This commit fixes a non-passing junos_facts integration test, as it was
using a non-ordered frozenset to assert its result.
2019-05-28 20:25:45 -04:00
Nathaniel Case
1b66a13186
Fix flow in eos_l2_interface (#57059)
* Also fix test debug labels
2019-05-28 14:06:57 -04:00
The Magician
a837cc5694 Bug fixes for GCP modules (#55976) 2019-05-28 13:43:19 -04:00
The Magician
713ac29054 Bug fixes for GCP modules (#56689) 2019-05-28 13:42:12 -04:00
Paul Belanger
6f1ff8eb8e Add missing scp dependency for ios_file tests (#56956)
This was required to be installed by a human, out side of our testing.
Add it so ansible-test can now manage.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-28 17:51:10 +05:30
Paul Belanger
94e007ed77 ansible-test: use become for connection=local on ios_user (#56960)
ios_user requires escalated privledges, rather then doing this in the
inventory, we can just add it into the playbook tasks.

Also add missing provider settings for authorize.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-28 17:38:36 +05:30
Felix Fontein
61b48778a7
Rename _facts -> _info (#57028) 2019-05-28 13:43:04 +02:00
Felix Fontein
d8dcd20294 docker_container: fix container creation with networks_cli_compatible=yes (#56687)
* Fix behavior.

* Add changelog.

* Add simple test to prevent #56620.
2019-05-28 03:19:52 -04:00
Andrey Klychkov
baac1df935 New module mysql_info - Gather information about MySQL servers (#55434)
* New module mysql_info: collect info about MySQL server instance

* mysql_info - CI tests

* mysql_info: fixes

* mysql_info: fixes Decimal

* mysql_info: fixes Decimal converters.py

* mysql_info: fixed err conn message and check_mode

* mysql_info: added decimal.Decimal to lib/ansible/parsing/ajson.py

* mysql_info: convert Decimal to float

* mysql_info: fix

* mysql_info: fix

* mysql_info: returned the args list as it was

* mysql_info: fix typo

* mysql_info: fixes

* mysql_info: removed aliases for login_db

* mysql_info: changed RETURN condition info

* mysql_info: fixed doc

* mysql_info: fixed role's parsing

* mysql_info: fixed role's parsing

* mysql_info: fixes

* mysql_info: fixed integration tests
2019-05-28 09:10:12 +02:00
ShachafGoldstein
f137527201 $result.reboot_required = $feature_result.RestartNeeded (#56419)
* $result.reboot_required = $feature_result.RestartNeeded

* Update relevent PSLint ignores

* CI Problem with pslint and ignore.txt
2019-05-28 01:21:56 -04:00
Paul Belanger
89b73cb535
ios_ntp: Switch interface to GigabitEthernet0/1 for tests (#56964)
* ios_ntp: Switch interface to GigabitEthernet0/1 for tests

Lets use an interface we know that exists for testing, in some cases
Loopback0 maybe not be configured.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>

* ios_ntp: properly register result variable for testing

This is currently broken, and tests don't work. Fix this by properly
registering the result variable.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-27 13:11:58 -04:00
Felix Fontein
7a0af34ba9
First batch _facts -> _info rename. (#56822) 2019-05-27 18:17:42 +02:00
Paul Belanger
4f8abde081 Fix syntax issue with ios_ntp tests (#56958)
This was missing a yaml anchor.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-27 19:51:07 +05:30
rajaspachipulusu17
19a78bdc7b Pluribus Networks vrouter bgp module with unit test cases (#56434)
* Pluribus Networks vrouter bgp module with unit test cases
* Sanity fixes
2019-05-27 11:53:57 +05:30
Lukas Kämmerling
7f08de6b6c hcloud_volume attach step should be idempotent (#56906) 2019-05-27 07:48:48 +02:00
Paul Belanger
d7f4f886f8 ansible-test: ios_command cli test should only be network_cli (#56955)
We do not support testing under ansible_connection=local

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-05-27 10:04:02 +05:30
SirFerdek
6a50c6aae4 docker_network: Integration tests for IPAM config idempotence (#56975)
Integration tests for pull request #56901 which fixes found issues with idempotence.
2019-05-26 16:41:06 -04:00
Martin Krizek
484c023316
ansible-test: prefer shlex.quote (#56823) 2019-05-24 22:10:33 +02:00
Andrey Klychkov
86354ff1fb postgresql: remove depricated lib (#56641) 2019-05-24 15:08:16 -04:00
Wojciech Wypior
fca2a4c68b adds ltm policy to bigip facts (#56926)
facts no longer return changed but queried status in results
2019-05-24 10:12:43 -07:00
Brian Coca
30210e7de0
added tests for log_plays (#56811)
* added tests for log_plays

* grep for warning

* Update tests to work with ansible-test.
2019-05-24 12:24:31 -04:00