Commit graph

3474 commits

Author SHA1 Message Date
Martin Krizek
32d6b1d0e0 user: fix default non-system user's shell on macOS 2017-09-19 18:11:22 -04:00
Adrian Likins
307be59092 Don't ask for password confirm on 'ansible-vault edit' (#30514)
* Don't ask for password confirm on 'ansible-vault edit'

This is to match the 2.3 behavior on:

        ansible-vault edit encrypted_file.yml

Previously, the above command would consider that a 'new password'
scenario and prompt accordingly, ie:

        $ ansible-vault edit encrypted_file.yml
        New Password:
        Confirm New Password:

The bug was cause by 'create_new_password' being used for
'edit' action. This also causes the previous implicit 'auto prompt'
to get triggered and prompt the user.

Fix is to make auto prompt explicit in the calling code to handle
the 'edit' case where we want to auto prompt but we do not want
to request a password confirm.

Fixes #30491
2017-09-19 17:39:51 -04:00
Toshio Kuratomi
0a69e27e62 Fix jenkins_plugin test for no net situations (#30568)
Unittests are sometimes run without network connectivity in build
systems.  Make that work correctly by mocking out _get_url_data with the
expected return value.
2017-09-19 13:12:45 -07:00
Matt Clay
dbf9634b1b Enable more pylint rules and fix reported issues. (#30543)
* Enable pylint invalid-encoded-data test.
* Enable pylint anomalous-unicode-escape-in-string test.
2017-09-19 00:45:35 -07:00
Matt Clay
7714dcd04e Enable more pylint rules and fix reported issues. (#30539)
* Enable pylint unreachable test.
* Enable pylint suppressed-message test.
* Enable pylint redundant-unittest-assert test.
* Enable pylint bad-open-mode test.
* Enable pylint signature-differs test.
* Enable pylint unnecessary-pass test.
* Enable pylint unnecessary-lambda test.
* Enable pylint raising-bad-type test.
* Enable pylint logging-not-lazy test.
* Enable pylint logging-format-interpolation test.
* Enable pylint useless-else-on-loop test.
2017-09-18 23:20:32 -07:00
Jordan Borean
01563ccd5d windows: fix list type in legacy module utils (#30483)
* windows: fix list type in legacy module utils

* only change the return for the list type instead of affecting it all

* additional null check when using an array
2017-09-18 21:18:52 -07:00
Toshio Kuratomi
c82cf791dd Add a code-smell test for smart quotes and remove smart quotes from all files 2017-09-18 16:49:16 -07:00
Dag Wieers
6a6f88d035 Clean up ACI error text (#30501)
* Clean up ACI error text
* Get rid of explicit unicode strings, use PY2
2017-09-18 11:51:58 -07:00
Toshio Kuratomi
1fa3fb45bc Update aci tests for new messages from lxml-4.0+ 2017-09-17 19:04:17 -07:00
Matt Clay
ff4276b65d Enable more Windows tests in CI. (#30443)
* Enable more Windows tests in CI.
* Fix win_psexec tests.
* Fix host-specific output_dir in win_fetch test.
2017-09-16 00:27:18 -07:00
Matt Davis
035a17e8aa migrate azure_rm_vm tests to active (#30452) 2017-09-15 22:48:30 -07:00
Matt Davis
6b5b465125 azure_rm_dnsrecordset rewrite (#30449)
As-merged, had several issues that prevented idempotent usage. Some args were defined at the wrong UI level. Dual-state args didn't match up with typical Ansible UI.
2017-09-15 18:12:46 -07:00
Matt Clay
397918435b Fix docker error handling for cs/vcenter tests. 2017-09-15 16:49:46 -07:00
Matt Clay
b9d8637e37 Improve test reliability for win_chocolatey. (#30440)
* Rename variables.
* Test install with chocolatey-core.extension.
2017-09-15 13:35:10 -07:00
Matt Clay
4ce13e983a Command module bug fix, tests and cleanup. (#30432)
* Add more command integration tests.
* Remove unnecessary command test debug tasks.
* Fix traceback in command module for empty args.
* Remove unreachable code.
2017-09-15 11:57:50 -07:00
René Moser
f128796782 cs_volume: fix CloudStackException dependency (#30389)
fixes pep8
2017-09-15 20:40:28 +02:00
Kedar K
7e58661335 Test Role: Adds nxos_pim_rp_address integration test role (#29958)
*   Adds nxos_pim_rp_address integration test role for group_list,
  prefix_list and route_map (cli and nxapi)

*  * Adds explicit removal of static RP configs to match cli behaviour

*  * Removes config deletion using nxos_config module (for 2.4 only)

*  * Attempt short and long delete config command
 * Add a platform check for N3K for bidir
2017-09-15 14:22:03 -04:00
Mike Wiebe
9af6dc4751 Fix nxos_snmp_community idempotence issue (#30388)
* Fix nxos_snmp_community idempotence issue

* Use passed in name to filter

* Test updates and remove unused method
2017-09-15 07:45:51 -07:00
Sloane Hertel
bdbe5337c6 s3 integration tests (#28396)
* Replace pause in integration tests with until.

Use resource prefix instead of generating a random number

Only try to delete keys if they exist

* Add alias to tests
2017-09-15 05:08:09 -04:00
Matt Clay
c00ad0868e Update Windows CI groups from 2 to 3. 2017-09-14 23:54:28 -07:00
Mike Wiebe
173c41aefe Rel240/fix nxos pim interface (#29885)
* fix nxos_pim_interface

* Add integration test coverage and fix unit test

* Add clarifying comments

* Make ansibot happy
2017-09-14 13:36:32 -07:00
Pierre-Louis Bonicoli
5c029abac1 alternatives: test that path parameter is checked
Relates: #24800
2017-09-14 11:06:29 -07:00
Pierre-Louis Bonicoli
e9d202f944 module_utils/avi.py: fix broken import 2017-09-14 10:59:25 -07:00
Mike Wiebe
3faba93a2b Fix nxos_interface error for nxapi and idempotence problem (#29136)
* Fix nxos_interface nxapi error and idempotence

* Make shippable happy
2017-09-14 10:25:35 -07:00
Matt Clay
0ce9e84f38 Fix import test handling of multi-line messages. 2017-09-14 10:09:54 -07:00
Yanis Guenane
0648e339a7 openssl: remove static dict for keyUsage (#30339)
keyUsage and extendedKeyUsage are currently statically limited via a
static dict defined in modules_utils/crypto.py. If one specify a value
that isn't in there, idempotency won't work.

Instead of having static dict, we uses keyUsage and extendedKyeUsage
values OpenSSL NID and compare those rather than comparing strings.

Fixes: https://github.com/ansible/ansible/issues/30316
2017-09-14 12:03:00 -04:00
Martin Krizek
dc5f83c09b Add sudo/su become_methods for become tests (#30266)
* Add sudo/su become_methods for become tests

* Fix test on osx
2017-09-14 11:13:43 -04:00
Matt Clay
781fd7099a Reorganize integration tests:
- Move legacy tests into a separate directory.
- Reduce common dependencies between targets.
2017-09-14 07:14:30 -07:00
Yanis Guenane
3e4a306a42 openssl_certificate: Correctly set the version (#30314)
Current openssl_certificate is mistakenly taking its derivating its
version number from the csr version number.

Thos two fields are completly unrelated and hence the version number of
the certificate should be able to be directly specified (via
selfsigned_version parameter).
2017-09-14 15:21:32 +02:00
Ganesh Nalawade
3ff527b1d2 Fixes #30281 eos_banner integration test failure (#30283)
* Fixes #30281 Configure login prompt for eos_banner

* Fix unit test

* Fix pep8 issue
2017-09-14 13:56:32 +05:30
Matt Clay
765718bed2 Run all Windows tests if change detection disabled (#30320)
* Run all Windows tests if change detection disabled
* Run all Windows versions if change detection disabled
2017-09-13 22:21:19 -07:00
Jordan Borean
d0867edbc3 updated test not that module util checks the path is valid (#30321) 2017-09-14 11:18:32 +10:00
Ricardo Carrillo Cruz
dbe9df1289 Add CLI provider with authorize yes to ios tests (#30312)
We are getting failures to do lack of elevated privileges.
2017-09-14 00:00:58 +02:00
MarkusTeufelberger
2186b04934 Add simple integration test for openssl_certificate (#29038)
* openssl_certificate: Fix parameter assertion in Python3

Parameter assertion in Python3 is broken. pyOpenSSL get_X() functions
returns b'' type string and tries to compare it with '' string, leading
to failure.

The error mentionned above has been fixed by sanitizing the inputs from
a user to the assert only backend.

Also, this error was hidden by the fact that the improper check method
was called in the generate() functions.

* Add simple integration test for openssl_certificate

* remove subject == issuer assertion

* run integration tests only on supported hosts

* change min supported version to 0.15.x

* Add test for more CSR fields

* also convert dict members to bytes

* fix version_compare

* openssl_{csr, certificate}: Fail if pyOpenSSL <= 0.15

Previous 0.13 pyOpenSSL was a C-binding, and required the parameter
passed to add_extention to be in ASN.1. This has changed with the move
to 0.14 and it is now all pythong and string based.

Previous the 0.15 release, the `get_extensions()` method didn't exist,
since the modules rely heavily on it we ensure pyOpenSSL version is at
last 0.15.0.

* check pyopenssl version in openssl_csr integration test
2017-09-13 14:39:32 -07:00
Felipe Garcia Bulsoni
18707136e2 Added support to retrieving SAN Manager resources in HPE OneView
- Added unit tests
- Added _main_ function to oneview unit tests which were missing it
2017-09-13 13:13:19 -07:00
Felipe Garcia Bulsoni
eeb8128baf Added __main__ method to tests so they can be run directly through Python 2017-09-13 13:13:19 -07:00
Matt Clay
1a602096f5 Improve ansible-test HttpClient error handling. (#30301)
- Automatic retries on DNS lookup failures.
- Handle API errors in shippable.py.
2017-09-13 12:23:48 -07:00
Jordan Borean
6d196eaa98 windows command changed to use CreateProcess (#30253)
* windows command changed to use CreateProcess

* change to get become to work
2017-09-13 09:58:49 -07:00
Nathaniel Case
8c03609e54 nxos_snmp cleanup (#28922)
* Clean up nxos_snmp_contact & nxos_snmp_location

* Bring nxos_snmp_community in line

* Bring nxos_snmp_host in line

* And I would have gotten away with it too,

if it weren't for those meddling sanity tests

* Bring nxos_snmp_traps & nxos_snmp_user in line

* Appease Shippable
2017-09-13 08:23:36 -07:00
Ricardo Carrillo Cruz
4a3a8ac616 Remove provider cli for vyos tests (#30275)
Transport is cli by default, and we set user/passwords on group_vars.
2017-09-13 16:01:47 +02:00
rahushen
caafc8e591 NXOS Commit Integration tests to Ansible (part 1) (#28935)
* cleanup nxos_bgp_neighbor_af tests

* add timeout and to_json to nxapi testing for nxos_command

* maintain folder naming consistency with other tests
2017-09-13 14:31:47 +01:00
Mike Wiebe
7292dd20ed Fix nxos_overlay_global networking modules (#28943) 2017-09-13 17:33:06 +05:30
Guillaume Coré
a09a231be7 ini_file: add integration test (#24434)
* ini_file: add integration test

Start integration tests for ini_file module.

* ini_file test: add comments for lisibility

* update from review: use var instead of checksum to assert content
2017-09-13 07:51:40 -04:00
Ganesh Nalawade
d8371cec91 Fix ios_system lookup enable issue (#30263)
Fixes #29974

Add `None` check while comparing module parameter values (want) with the actual
configuration present on device (have).
2017-09-13 15:19:09 +05:30
Matt Clay
442af3744e Miscellaneous pylint fixes.
The following rules are no longer disabled:

- bad-format-string
- duplicate-key
- lost-exception
- trailing-newlines
- unexpected-keyword-arg
- useless-suppression
- using-constant-test
2017-09-13 01:53:08 -07:00
Mike Wiebe
cef7ed0310 Fix nxos_mtu nxapi failure (#30153) 2017-09-13 10:51:46 +05:30
Nicklaus McClendon
6dbc3c63f8 Updated pip module to always return changed if venv is created (#24233)
* Updated pip module to always return changed if venv is created

Fixes #23204

* Add integration test to pip (see #23204)
2017-09-12 10:01:29 -07:00
Matt Davis
1e2ce4c8ab support missing drive letters in PS path type (#29884)
* fixes #26623
* Test-Path (and thus `-type path` in Get-AnsibleParam) fail on a nonexistent drive letter, since it can't be mapped to a PSProvider.
* added support and basic smoke tests for
2017-09-12 09:51:48 -07:00
Ricardo Carrillo Cruz
b30cd60829 Fix nxos_user tests (#30048)
On our CI we use SSH port 8022, so parameterized the test passing
-p {{ ansible_ssh_port }}.
Also, force user/pass auth.
2017-09-12 17:01:50 +02:00
John R Barker
bc2f4365b5 Correctly validate module name for modules with aliases (#29957)
* Correctly validate module name for modules with aliases

If a module has an alias (ie is a symlink) then we need to ensure that
DOCUMENTATION.module is set to the main name, not the aliased name

* formatting
2017-09-12 13:30:49 +01:00