Commit graph

274 commits

Author SHA1 Message Date
Matt Clay
496280858d Revert "Temporarily disable test which fails in group run."
This reverts commit 99d328976d.
2017-05-11 20:26:32 +08:00
Matt Clay
b8cb3f519b Detect and fix environment tampering in tests. 2017-05-11 19:45:15 +08:00
Matt Clay
99d328976d Temporarily disable test which fails in group run. 2017-05-11 16:22:12 +08:00
Dag Wieers
e855274dc8 win_psexec: Enable -nobanner option by default (#23422)
* win_psexec: Enable -nobanner option by default

PR also includes:
- Option `nobanner:` to remove this flag
- Improvements to Examples
- Improvement to Return Value
- Add types to all parameters now
- Add (limited) integration tests

* Move sysinternals into C:\Windows\Temp
2017-05-10 16:10:33 -07:00
jctanner
e9c2546ffe Add integration test targets for core supported modules (#24217)
A preliminary set of test targets for "core" supported module that had no independent tests. These will also help us ensure python3 compatibility for those modules and prevent future regressions.
2017-05-10 09:19:11 -04:00
René Moser
2ef6713abb cloudstack: new module cs_vpn_gateway (#23954)
* cloudstack: new module cs_vpn_gateway
* add integration tests for cs_vpn_gateway
2017-05-10 14:55:14 +02:00
Matt Davis
ead23783be slightly increase win_async_wrapper fire and forget sleeptime
* should fix Shippable timeouts when AWS CPU credits are low- right on the bubble of failure w/ 5s execution
2017-05-09 11:22:29 -07:00
Dag Wieers
bc806ff479 Windows: Small fix to Add-Warning and Add-DeprecationWarning (#23520)
Simplified the logic, and fix the issue of having a nested list as
entry.

Also indicate that we deliberately want to retain $null values
(and i.e. do not want them to be turned into a boolean).
2017-05-09 09:18:37 -07:00
Ganesh Nalawade
5b3ea6562b Add junos integration test (#24404) 2017-05-09 18:41:48 +05:30
Benjamin Jolivot
e99815e9f5 Fortios file only mode + integration tests (#23275)
* WIP file_mode

* WIP

* Add file_mode + integration tests

* fix pep8

* Update doc fragments
Create mutualy_exclusive param
Fix yamllint problem in tests

* Add aliases file + main playbook for fortios

* Install pyfg before running tests

* Install pyfg before running tests in role

* Remove pre_task as it's done in roles

* Force pyFG minimal version for python3

* role_path not role_dir :(

* Change requirements

* Specify Error type when error on import

* Bug in pygf library with python 2.5 (PR is waiting https://github.com/spotify/pyfg/pull/19)

* Bad requirement format

* still bad format -_-'

* remove test/integration/fortios.py (auto generated by tests)
missing new lines at end of file

* pyFG is now fixed in 0.50
2017-05-09 13:51:19 +01:00
Matt Clay
d999d613cb Python 3 fixes for CloudStack modules and tests. (#24400) 2017-05-09 13:37:08 +02:00
René Moser
aaf4f04574 automated integration tests for cloudstack (#20552) 2017-05-09 11:32:11 +08:00
Matt Clay
86bf27511c Migrate cs_sshkeypair test to ansible-test. 2017-05-07 01:44:33 +08:00
Matt Clay
17e07a27b2 Enable cloud tests for use with ansible-test. 2017-05-05 21:46:29 +08:00
Toshio Kuratomi
a0dfa8616a Make fetch default to fail on errors
Fixes #23501
2017-05-03 09:37:31 -07:00
Toshio Kuratomi
3428f42120 Add integration test that modules are loaded from the expected locations (#24170)
* Add integration test that modules are loaded from the expected locations
* Fix ping module to pass PEP8
2017-05-01 08:52:25 -07:00
SesquipedalianDefenestrator
3f321e7591 Add check_mode to get_url (#20532)
* Add check_mode to get_url that does a HEAD request to make sure the URL exists, but doesn't write the real file

* Add info about new --check behavior to docs.  Add tests for the new behavior.  Populate res_args with the info the tests are looking for.

* Add trailing comma

* Change nonexistent test URL to http://{{httpbin_host}/DOESNOTEXIST.  Fix spacing while I'm at it

* Further spacing cleanup

* State that this functionality is in Ansible 2.4+
2017-04-28 14:43:51 +01:00
Pierre-Louis Bonicoli
a13d89da68 Debian: really generate locales
/usr/sbin/locale-gen differs between Debian and Ubuntu. With Debian,
locales must be added to /etc/locale.gen before calling locale-gen
command. With Ubuntu, /etc/locale.gen is updated by
/usr/sbin/locale-gen.

Use the locale-gen module which handles both distributions.
2017-04-28 09:10:20 +08:00
Pilou
bf5d87af07 PostgreSQL Integration test suite: improvements (#23631)
* PostgreSQL tests: use package module
* PostgreSQL tests: use ansible_service_mgr in order to test init system
* PostgreSQL tests: fix a typo
* PostgreSQL tests: install only required packages
* PostgreSQL tests: use role default value when unchanged
2017-04-28 09:09:40 +08:00
Nathaniel Case
fc0bf87c20 Run save inside config mode. (#23977)
* Run `save` before exiting config mode.

* Fix unit tests for `save`

* Allow `save` to be on its own again and introspect success

* Introspecting `compare running` makes this a lot harder.

Move `save` tests to integration tests
2017-04-27 11:08:37 -04:00
Toshio Kuratomi
bffccb5396 fetch idempotence test and deprecate validate_md5
Added an integration test for fetch module idempotence.  (Testing
that validate_checksum is doing what it's supposed to is harder as we'd
have to create a race condition with the downloaded data to trigger it.
Probably need to make that a unittest eventually).

Also give a deprecation message to the validate_md5 parameter so that we
can eventually get rid of it.
2017-04-26 12:00:01 -07:00
Brian Coca
e29dc49a49 moved to exceptions for basic skip/fails
better handling of checkmode and async
fix test to follow new flow control
2017-04-25 14:48:56 -04:00
Brian Coca
4594bee65a keep unsafe .. unsafe (#23742)
* keep unsafe .. unsafe

fixes #23734, which was broken in previous fix that allowed non string types to be templated
use new 'is_template' function vs bastardizing others
refactored clean_data to allow for arbitrary data structures to clean
fixed/removed some tests

* deal with complex data for is_template

* typos
2017-04-21 16:07:38 -04:00
Guillaume Coré
c7f4c97b18 async+script: add integration test (#23818)
see #23729
2017-04-21 01:06:01 -04:00
Ricardo Carrillo Cruz
0bbfd3d4e0 Add missing aliases file to ios_system integration target (#23795) 2017-04-20 12:33:22 +02:00
Ricardo Carrillo Cruz
82fd038998 Add missing aliases file to iosxr integration tests targets (#23796) 2017-04-20 12:32:36 +02:00
Adrian Likins
ae3d7fb29e Fix vault reading from stdin (avoid realpath() on non-links) (#23583)
* Fix vault reading from stdin (avoid realpath() on non-links)

os.path.realpath() is used to find the target of file paths that
are symlinks so vault operations happen directly on the target.

However, in addition to resolving symlinks, realpath() also returns
a full path. when reading from stdin, vault cli uses '-' as a special
file path so VaultEditor() will replace with stdin.
realpath() was expanding '-' with the CWD to something like
'/home/user/playbooks/-' causing errors like:

        ERROR! [Errno 2] No such file or directory: u'/home/user/ansible/-'

Fix is to specialcase '-' to not use realpath()

Fixes #23567

* to_text decrypt output when writing to stdout
2017-04-18 13:09:02 -04:00
Brian Coca
8382ed7200 added test emulating #23180 use case 2017-04-12 18:34:29 -04:00
Matt Martz
621e27b5dd Urls client cert auth (#18141)
* Build HTTPSClientAuthHandler more similarly to how HTTPSHandler works

* Add docs for new client cert authentication

* Support older versions of python

* Simplify logic

* Initial support for client certs in urls.py

* Add an extra test

* Add a get_url test for client cert auth

* Add additional test for client cert auth, with validation and ssl mismatch

* Skip assert when http tester not available

* Update version_added for new options
2017-04-07 09:54:37 -07:00
Toshio Kuratomi
78ced5318f Fix for recursive copy slowness
Copy module was walking over files in subdirectories repeatedly (a
directory tree a few levels deep could bring the time spent into the
tens of minutes)

This was traced to the fix for this bug report: https://github.com/ansible/ansible/issues/13013

Fixed #13013 a different way and added an integration test to check for
regressions of #13013 as we optimize this code.

Fixes #21513
2017-04-07 12:41:42 -04:00
Matt Martz
ac61f09203 Extra deps needed for building cryptography 2017-04-07 09:19:26 -07:00
Matt Martz
13ac993d25 Fallback to old ssl_wrap_socket 2017-04-07 09:19:26 -07:00
Matt Martz
b4b76bab14 Update install deps for SNI tests 2017-04-07 09:19:26 -07:00
Ricardo Carrillo Cruz
13b2f11139 Do not assert session name on idempotent eos banner (#23402)
* Check for proper response key on eos_banner map_config_to_obj

If we run the task with 'login' banner, the 'show banner' command
will return a dict containing key 'loginBanner'.
However for motd, it will just return 'motd'.
Yay naming consistency!

* Do not assert session exists on eos_banner response not changing device
2017-04-07 15:44:06 +02:00
Ricardo Carrillo Cruz
ce9826d76e Fix eos_banner basic-motd eapi asserts (#23398)
The commands in EAPI does not contain the plain command sent to the
device as a one liner, but it is split in cmd/input keys.
2017-04-07 14:18:40 +02:00
Ricardo Carrillo Cruz
2cc2b8fb4d Add missing provider to eos_banner basic-motd eapi test (#23396)
Otherwise this stalls and timeouts, it doesn't have creds to run.
2017-04-07 13:39:33 +02:00
Nathaniel Case
98c23a3342 Attempt to clear up nxos_mtu tests and documentation (#23361)
nxos_system wasn't added until 2.3, so nxos_mtu should have been deprecated
then.
2017-04-06 12:26:17 -04:00
Matt Clay
40e88dadbe Disable zypper tests for CI due to timeouts. 2017-04-06 08:48:31 -07:00
Ricardo Carrillo Cruz
4571ff0b52 Fix eapi basic-login asserts (#23318)
The asserts where not checking the commands sent to the device
2017-04-05 20:37:58 +02:00
Ricardo Carrillo Cruz
cf30f0f27d Fix asserts on ios_banner tests (#23315)
The contain assert was broken.
2017-04-05 20:00:10 +02:00
Ricardo Carrillo Cruz
d268471739 Fix basic-login eapi tests for eos_banner (#23304)
We should be passing the provider dict, not the transport.
2017-04-05 19:11:12 +02:00
John R Barker
f22702eee2 enable ios_facts tests again (#23310) 2017-04-05 17:50:32 +01:00
Nathaniel Case
d890167575 Fix nxos_facts for nxapi transport (#23302)
* Partial revert of 2e476e64cd

This broke handling of nxos_facts over nxapi

* Fix nxos_facts tests not run in isolation
2017-04-05 11:47:37 -04:00
Robin Roth
6f40cb9647 Add workaround for evasive in apache2_module (#22649)
* Add workaround for evasive in apache2_module

* Fixes #22635
* Clean up workarounds for php/shib
* Add test for evasive workaround
* Remove use of re module, since all searches work with native python

* Add unit tests to apache2_module name replacements

Go back to using re package where needed

* Rename replace_name to create_apache_identifier
2017-04-04 14:12:06 -04:00
Chulki Lee
99ef1f3a9f git: git reset with branch
`git reset <ref>` can be ambiguous and fail to switch to the correct branch.
To avoid it, specify branch as well.
2017-04-04 10:45:04 -07:00
Matt Clay
79fa5ef4cb Add missing group_vars to group_by test. 2017-04-04 10:14:10 -07:00
Brendan Jurd
7fb1519035 Add integration tests for group_by precedence.
Test that, when a group is created with group_by, variables from the
corresponding group_vars/ file are correctly pulled in, and override
variables specified in group_vars/all.

See ansible/ansible#8664.
2017-04-04 10:14:10 -07:00
Matt Clay
b7cc4616b1 Fix integration aliases. 2017-04-03 17:49:35 -07:00
Matt Clay
58c2470e8f Fix deploy_helper integration tests. 2017-04-03 16:59:40 -07:00
Ramon de la Fuente
550d229c7b added deploy_helper module tests 2017-04-03 16:59:40 -07:00
Jordan Borean
3e1a16c574 win_find fix up age parameter (#23195) 2017-04-03 11:43:07 -07:00
Jordan Borean
4d1b97d1ae win_stat change return islink to islnk to match stat (#23196) 2017-04-03 11:38:34 -07:00
Ricardo Carrillo Cruz
9cc47df30e Fix eos_banner cli basic_motd integration test (#23158)
A task was lacking the provider variable, causing the test to fail.

Fixes #23130
2017-03-31 00:21:23 +02:00
Konstantin Suvorov
c1b3d6a51f Fix 'sequence' lookup shortcut syntax and documentation (#22989)
* fix 'sequence' lookup shortcut syntax and documentation

* Update playbooks_loops.rst

Minor edits for grammar and clarity.

* Update playbooks_loops.rst

Another tweak for clarity.
2017-03-29 19:11:19 -04:00
Ricardo Carrillo Cruz
1fd58c295c Add missing aliases files on nxos integration targets (#23070) 2017-03-29 13:28:43 +02:00
Ricardo Carrillo Cruz
0e954b0fd9 Add aliases file to nxos_interface integration target (#23069) 2017-03-29 12:50:16 +02:00
Ricardo Carrillo Cruz
ac6465689c Add nxos_interface integration testing (#23030)
This is a first step before starting the refactoring of
the nxos_interface code.
2017-03-29 11:01:38 +02:00
Miyurz
1ea1becf23 Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset… (#22502)
* Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset fails when file with the name 'origin' is present in the repository

* #22455 Integration test for git module to test if it clones a repository with a file named origin

* Fixed yaml errors for test/integration/roles/test_git_clone/tasks/main.yml

* Removed the newly added target git and moved the code to test/integration/targets/git

* Reorganised code structure as per comments

* Fixed playbook name

* Added code that didn't make it to the playbook before.

* No longer need git.yml

* Remove non tasks specific code from tasks file and use existing variables

* Removed msg var from the vars.yml
2017-03-28 08:41:25 -04:00
Matt Clay
318445fe19 Associate systemd module with service test. (#22847) 2017-03-24 13:29:18 -07:00
Matt Davis
e084e8809e force Windows to always use preamble-free UTF8 input encoding (#22934)
* fixes #15770
* When running under the UTF-8 codepage, Powershell subprocesses will fail (eg, Start-Job, others) if the input encoding is using the default BOM preamble. This fix forces it to use no preamble in leaf_exec and win_shell, and includes tests to verify that Start-Job works.
2017-03-24 00:02:39 -07:00
Artem Zinenko
f4b34a4c3b win_firewall_rule doesn't fail when profile is "any" or remoteip is IPv4 and the task runs more than once. (#22555)
* Fixed #22554

* Wrote tests for win_firewall_rule module

* Fixed #22786

* Fixed review comments

* Fixed #22799

* Added test when RemoteIP containt a netmask

* Revert comment
2017-03-23 20:01:26 -07:00
Dag Wieers
ac43a1bbbc Windows: Use the correct newline sequence for the platform (#21846)
This change to the template action plugin make template use the
platform's native newline_sequence for Jinja.

We also added the option `newline_sequence` to change the newline
sequence using by Jinja if you need to use another newline sequence than
the platform default.

This was previously discussed in
https://github.com/ansible/ansible/issues/16255#issuecomment-278289414

And also relates to issue #21128
2017-03-23 19:47:10 -07:00
Dag Wieers
ef36d7de68 win_scheduled_tasks: Improve example test framework (#22833)
Updated as discussed in previous Test Working Group.
2017-03-23 19:42:12 -07:00
Matt Davis
73f50b4f9f fix Windows env handling (#22927)
* fixes #22441
* fixes #22655
* moves all env handling into the exec wrapper; this should work for everything but raw, which is consistent with non-Windows.
2017-03-23 17:48:15 -07:00
Jordan Borean
f1ab879bb6 win_reg_stat change the module parameters for standardisation (#22732) 2017-03-23 15:15:28 -07:00
Matt Clay
45951a69a6 Rewrite ansible-pull tests to use local repo. (#22821) 2017-03-21 00:30:02 -07:00
Matt Clay
3585d3d368 Add missing needs/root alias to file test. (#22800) 2017-03-20 14:11:16 -07:00
Matt Clay
b7c80dbb7e Disable failing MySQL tests on FreeBSD. (#22798) 2017-03-20 09:52:56 -07:00
Matt Clay
93d9b04f1d Fix uri options test to work again. 2017-03-17 22:28:54 -07:00
Matt Clay
011b324638 Do not run win_chocolatey in CI tests.
The test is failing repeatedly.
2017-03-17 08:57:44 -07:00
Ricardo Carrillo Cruz
6e56a61535 Add ios_banner module (#22687)
With unit and integration tests.
2017-03-16 16:35:44 +01:00
Dag Wieers
72e7927dd5 win_scheduled_task: Added frequency: once and check_mode support (#22611)
* win_scheduled_task: Added frequency: once and check_mode support

This patch includes:
- Renamed `execute:` parameter to `executable:`
- Renamed `argument:` parameter to `arguments:`
- Implemented `frequency: once` support
- Implemented check_mode support
- Fix idempotency issue related to empty description
- Added integration tests

* Improve the integration test structure

I think this is a great way to test normal mode and check-mode from the same playbook.

* Small fixes after review
2017-03-15 07:11:24 -07:00
Jordan Borean
6ce338d29c win_service Added -Force option and minor cleanup (#22598)
* win_service Added -Force option and minor cleanup

* Changed parameter and fixed typos
2017-03-14 18:53:31 -07:00
Matt Davis
ce56da69b2 make windows async ... async (#22624)
Fixes #22575 - issue under new exec wrapper where unconstrained handle inheritance (for stdin) caused WinRM to block on breakaway processes. Uses explicit handle inheritance to ensure that only stdin read handle gets inherited. Adds test to ensure that async is actually async.
2017-03-14 16:37:55 -07:00
Peter Sprygada
39c38bf30d fixes candidate var type in junos shared lib (#22551)
* candidate var can now be string, list or element
* fixes minor bug in junos_template for backup argument
* disabled invalid integration test for junos_template
2017-03-13 07:27:45 -04:00
Peter Sprygada
2b2072a8c9 roll up of fixes and updates for junos modules (#22543)
* removes cli functions
* adds comment and confirm to arguments
* implements zeroize argument
* fixes get_diff function in junos shared lib to return diff
* lots of minor bug fixes in junos_config
* minor syntax fixes in junos_netconf
* updates netconf integration tests
2017-03-12 11:45:00 -05:00
John R Barker
89e4226051 add missing files (#22496) 2017-03-10 15:29:36 +00:00
John R Barker
5dac2ee00c Test eos_banner (#22201)
* eos_banner docs improvements

* run eos_banner tests

* basic eos_banner tests

* remove trailing newlines

* remove hack

* Various eos_banner fixes

No unicode tests, as the device doesn't support it
Correctly set provider
result.command should be empty list if no changes

* test eos_banner over eapi

* revert docs changes, moved to separate PR
2017-03-10 15:20:09 +00:00
John R Barker
41f5648c44 Test system (#22420)
* ios_system

* tests for ios_system

* tests for *_system

* working ios_system on cli

* Typo

* Loopback10 (single word, upeprcase)

* Revert docs changes

* Working iosxr_system tests

* eos, not nxos

* nxos_system
2017-03-08 12:21:45 -07:00
Marius Gedminas
15c7288ab9 Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target

* Integration test for symlink target change

* Also check soft link idempotency
2017-03-06 11:29:20 -05:00
Peter Sprygada
6c8025ce5c adds eos_system integration tests (#22214)
* adds integration test cases
* updates eos_system with minor bug fixes
2017-03-02 21:20:17 -06:00
Peter Sprygada
911600acf9 update junos_command integration tests (#22213)
fixes integration test to check for full rpc-reply string when
converted from xml.  This is a change from 2.2 as the rpc-reply tag
is no longer stripped off
2017-03-02 16:46:23 -06:00
Robin Roth
3afc993f3a Fix git clone tag with depth=1
* Fixes #21316, add testcase based on this
* Add option `--branch NAME` to git clone command in case of branch or
tag in combination with depth=1
  * This option should work back to at least git 1.8 and thus on all
  supported distributions
* Provide better warning if depth is dropped
2017-03-02 14:11:50 -08:00
Matt Davis
a60d358e56 Revert "win_service_stat: Added module" (#22184) 2017-03-02 01:34:11 -08:00
Jordan Borean
778dc9ad38 win_copy: added remote and content options (#21546)
* win_copy: added remote and content options

* readded comment about original_basename accidentally removed
2017-03-01 22:35:03 -08:00
Jordan Borean
f4f09c9dbf Rewrote win_service with more options/check_mode (#19143) 2017-03-01 22:17:16 -08:00
Jordan Borean
3da806f32a win_service_stat: Added module (#21944) 2017-03-01 22:04:57 -08:00
Peter Sprygada
392d9e2aa6 updates prepare_nxos_tests to use nxos_nxapi module (#22150)
replaces nxos_config with nxos_nxapi
2017-03-01 19:36:03 +00:00
Dag Wieers
52959ebdc1 wait_for_connection: Wait for system to become reachable (#20011)
* WIP: wait_for_connection: Wait for system to be reachable

This action plugin allows to check when a system is back online and
usable by Ansible.

As an example, when doing a SysPrep and running Enable-WinRM.ps1, it
takes between 10 to 20 seconds between the WinRM TCP port to open, and
it actually being able to server Ansible requests. This time is variable
and depends on the boot process.

Current implementation is specific for Windows (WinRM) only, this will
be fixed shortly.

This fixes #19998

* Support other transport types

* Various improvements

- Fix reported typo
- Add transport_test support in accelerate plugin
- Ensure port is an integer

* Improve examples

* Small fixes

- Use correct ConfigureRemotingForAnsible.ps1 script name
- Only use win_ping when remote shell is known to be Powershell
- Add integration tests to CI framework
2017-03-01 11:00:49 -08:00
Matt Martz
6e8e90ceb4 Warn when using the deprecated HEADER_ arguments (#20236)
* Make sure the uri module warns about using the deprecated HEADER_ arguments, so that we can actually deprecate in a future version

* Use module.deprecate

* No need to de-dupe ourselves, looks like it is done somewhere I didn't initially see
2017-03-01 11:35:48 -05:00
John R Barker
2f6213a219 result.commands (not .updates) (#22139) 2017-03-01 13:10:40 +00:00
John R Barker
9f49d4b8f4 iosxr tests to work with 2.3 (#21998) 2017-02-27 14:37:06 +00:00
Peter Sprygada
f95a11a9db fixes eos_eapi to error on wrong transport (#21993) 2017-02-27 09:20:08 -05:00
jhawkesworth
a1047e6273 Adds integration test steps to win_regedit test to cover Extras 2090 (#15641)
* Adds integration test steps to win_regedit test to cover Extras 2090

* Fixed merge conflict and error in win_regedit integration tests

* fixed pep8 space after comma requirement discovered by ci build
2017-02-27 13:05:00 +00:00
Peter Sprygada
1c3d448a29 updates eos_facts integration test cases (#21988) 2017-02-27 07:43:00 -05:00
Dag Wieers
a66d5dcc43 win_chocolatey: Add integration tests (#21930)
And also fix a known issue.
2017-02-27 11:36:52 +00:00
Peter Sprygada
8dbb12a9c4 adds integration tests for nxos_mtu (#21969) 2017-02-26 09:42:41 -05:00
Peter Sprygada
4c354c9c70 adds integration tests cases for nxos_feature (#21966) 2017-02-26 08:12:57 -05:00
Peter Sprygada
0cb2019293 roll up of bug fixs for nxos_evpn_global (#21961)
* updates nxos_evpn_global module
* adds integration test cases
* adds unit test cases
2017-02-26 06:45:26 -05:00
Nathaniel Case
9b9ed59d98 Vyos config fixes (#21862)
* Fix vyos signatures to match new versions

* Fix test cases referring to 'updates' instead of 'commands'

* I think this is an artifact of `connection: network_cli`?
2017-02-25 21:14:40 -05:00