Commit graph

1463 commits

Author SHA1 Message Date
Toshio Kuratomi
90fb1fb3fa If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
2016-05-12 11:11:05 -07:00
Toshio Kuratomi
8a84ef80e2 Strip junk after JSON return. (#15822)
Fixes #15601
2016-05-11 17:55:20 -07:00
Toshio Kuratomi
b7cab0533e Remove reload from arg related tests. Changes to how ziploader passes args mean we don't need reload anymore. (#15782) 2016-05-10 08:14:46 -07:00
Toshio Kuratomi
d2e8e8d6a7 Switch to a different url for testing SNI right now. (#15798) 2016-05-10 07:10:28 -07:00
nitzmahone
761cdc794e add jimi-c's unit test for squashed skip results, tweaked is_skipped() logic to pass 2016-05-05 15:30:58 -07:00
Yannig
40c0f34c41 When var name is the same as var content, try to template it before reporting that var is not defined. (#13629)
* When var name is the same as var content, try to template it before reporting that var is not defined.
Add asserts in test_var_blending to check this special corner case.

* Fix integration tests when using debug with list or dict.
2016-05-01 06:48:54 -07:00
Toshio Kuratomi
1e5708514b Fix ziploader for the cornercase of ansible invoking ansible.
* Make ziploader's ansible and ansible.module_utils libraries into
  namespace packages.
* Move __version__ and __author__ from ansible/__init__ to
  ansible/release.py.  This is because namespace packages only load one
  __init__.py.  If that is not the __init__.py with the author and
  version info then those won't be available.
* In ziploader, move the version ito ANSIBLE_CONSTANTS.
* Change PluginLoader to properly construct the path to the plugins even
  when namespace packages are present.
2016-04-29 11:15:24 -07:00
Toshio Kuratomi
430bef907a Fix for unittests on python2.6 or less 2016-04-27 10:46:35 -07:00
Robin Roth
1c447016c3 extend zypper integration tests (#15596)
* extend zypper integration tests

* fix caching issue of local RPMS on openSUSE 42.1 Leap
* add tests for simultaneous install/remove via prefixes +-
* test fail cases (rm patch or URL)
* test patch install (succes, unchanged second run, fail on wrong name)

* add test for pattern install
2016-04-27 10:38:34 -07:00
Toshio Kuratomi
41f5ce80fa Some algorithmic unittests for the apt and docker modules 2016-04-27 10:38:13 -07:00
Toshio Kuratomi
e4a1622f53 Do not check docker or azure module_utils code for py2.4 compat (the libs require py2.6+) 2016-04-26 07:21:36 -07:00
Toshio Kuratomi
85bef402b1 Merge pull request #14614 from gundalow/test_binary
non-destructive says we should run test_binary at v2
2016-04-25 09:45:00 -07:00
Tegan Snyder
bf0da4aa3c add centrify dzdo escalation (#15219)
add dzdo context, and test
2016-04-25 11:24:26 -04:00
Toshio Kuratomi
44e21f7062 Allow AnsibleModules to be instantiated more than once in a module
Fix SELINUX monkeypatch in test_basic
2016-04-23 14:04:45 -07:00
jctanner
4d36b3f7b6 Extend the get_url integration tests to include file schemas. (#15532)
Addresses https://github.com/ansible/ansible-modules-core/issues/3511
2016-04-22 11:38:03 -07:00
Toshio Kuratomi
e893b65a9b Don't pick up whole commented lines in the urlopen code-smell tests 2016-04-22 08:24:56 -07:00
Robin Roth
7a4e4c2b02 extend integration test for zypper_repository (#15387)
* include options refresh and priority introduced in ansible/ansible-modules-extras#1990
* test repo update both based on name and URL
* run on all suse flavors
* test overwriting repos by url or name
2016-04-21 20:10:29 +02:00
Robin Roth
59bad647b6 Revert "Disable new git tests until a fix for rhel6/7 is merged."
This reverts commit 197d3dfe97.
2016-04-20 09:52:02 +02:00
Toshio Kuratomi
03126f7097 Fix cut and paste error of test code 2016-04-19 10:38:44 -07:00
Toshio Kuratomi
197d3dfe97 Disable new git tests until a fix for rhel6/7 is merged. 2016-04-19 08:53:19 -07:00
Toshio Kuratomi
0a31c24938 Merge pull request #15419 from nitzmahone/module_debug_arg_override
add _load_params debug overrides for module args/file passed on cmdline
2016-04-19 07:49:05 -07:00
Brian Coca
33761efd19 Merge pull request #15417 from bcoca/copy_vaulted
Copy vaulted
2016-04-19 10:22:30 -04:00
Robin Roth
e8b1c4e14a add test for git with both depth and version arguments (#15471)
* add test for ansible/ansible-modules-core#3456

combination of options version and depth

* add test of switching to older branch
2016-04-19 07:00:45 -07:00
Matt Davis
822f904aa6 Merge pull request #14813 from mattclay/lxd-plugin
Add lxd connection plugin.
2016-04-19 02:06:31 -07:00
James Cammarata
6eefc11c39 Make the loop variable (item by default) settable per task
Required for include+with* tasks which may include files that also
have tasks containing a with* loop.

Fixes #12736
2016-04-19 01:42:40 -04:00
nitzmahone
5b336832af add _load_params debug overrides for module args/file passed on cmdline
Updated python module wrapper explode method to drop 'args' file next to module.
Both execute() and excommunicate() debug methods now pass the module args via file to enable debuggers that are picky about stdin.
Updated unit tests to use a context manager for masking/restoring default streams and argv.
2016-04-18 11:06:46 -07:00
Matt Davis
6322ed833e Merge pull request #15422 from jhawkesworth/win_regedit_binary_tests
Windows: add win_regedit integration tests (needs https://github.com/ansible/ansible-modules-extras/pull/2034)
2016-04-18 10:56:30 -07:00
James Cammarata
ed35e8bce2 Don't override the http status code when successful in urls.py 2016-04-18 13:20:24 -04:00
Toshio Kuratomi
7833b5bec4 Merge pull request #15420 from robinro/distribution_version_tests
Distribution version tests
2016-04-18 10:05:55 -07:00
Robin Roth
9bb069f873 Apache2 module integration test (#15380)
* add integration test for apache2_module

* fix assert syntax

* check os_family for this test

* add comment why only debian and suse are tested

* move apache2 test to destructive

* install apache2 package
2016-04-18 18:00:02 +02:00
Matt Clay
5fc76df18b Add lxd connection plugin. 2016-04-15 19:10:57 -07:00
Matt Martz
a985bf6a31 Don't pass context to urlopen, instead add it to the handlers. Fixes https://github.com/ansible/ansible-modules-core/issues/3437 2016-04-15 16:10:54 -05:00
Robin Roth
49cdc565c5 remove nose.tools use 2016-04-15 19:40:08 +02:00
Robin Roth
4088aa2b4c get rid of assert_in 2016-04-15 19:30:49 +02:00
Robin Roth
692bf51fde move gen_testcase to hacking/tests
* also use json instead of pprint
2016-04-15 17:14:43 +02:00
Robin Roth
37188ea336 cleanup tests
* use nose test generator
* more comments
* move facts import inside the skipped function, fix python3 warning
2016-04-15 17:14:14 +02:00
Robin Roth
2b104fe6ad fix tests for SLES and CoreOS
* include #15230
2016-04-15 17:13:59 +02:00
Robin Roth
b48e628429 test git version before running test on depth 2016-04-15 09:49:05 +02:00
=
157072a39f Windows: win_regedit integration tests (following https://github.com/ansible/ansible-modules-extras/pull/2034 ) 2016-04-14 21:47:17 +01:00
Cambell
cdf6e3e4bf feature/copy-vault-dataloader: Add method get_real_file(file_path) to dataloader
- get_real_file will decrypt vault encrypted files and return a path to
  a temporary file.

- cleanup_real_file will remove a temporary file created previously with
  get_real_file
2016-04-14 14:12:48 -04:00
Robin Roth
776bffb52b Expand git integration test (#15391)
* add testcases to git for depth

* also in combination with refspec, which gets more tricky

* add testcase for ansible/ansible-modules-core#527
2016-04-14 09:41:10 -07:00
Robin Roth
3c883d8a6d add testcases from refactor PR 2016-04-14 18:26:00 +02:00
Matt Clay
af8258cdf2 Revert "Increase verbosity of connection tests." (#15305) 2016-04-14 11:06:46 -04:00
Toshio Kuratomi
208ad36ce4 Merge pull request #15344 from abadger/ziploader
Ziploader "recursive imports" and caching
2016-04-13 10:27:01 -07:00
Jonathon Klobucar
7bee994e1c Fix for serial when percent amount is less than one host (#15396)
Ansible when there was a percentage that was calculated to be less than
1.0 would run all hosts as the value for a rolling update.

The error is due to the fact that Python will round a
float that is under 1.0 to 0, which will trigger the case of
0 hosts. The 0 host case tells ansible to run all hosts.

The fix will see if the percentage calculation after int
conversion is 0 and will else to 1 host.
2016-04-13 10:49:38 -04:00
Toshio Kuratomi
75546678d9 Fix unittests 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
dcc5dfdf81 Controller-side module caching.
This makes our recursive, ast.parse performance measures as fast as
pre-ziploader baseline.

Since this unittest isn't testing that the returned module data is
correct we don't need to worry about os.rename not having any module
data.  Should devise a separate test for the module and caching code
2016-04-12 08:01:07 -07:00
Matt Martz
dd39f57ae7 Merge pull request #15289 from sivel/sni-urllib3-contrib-try2
Optional Use of urllib3 for SNI verification
2016-04-08 11:26:49 -05:00
nitzmahone
698ae7c383 ensure test_win_user fails on bogus error
We weren't previously checking the error message- it failed as expected, but for the wrong reason.
2016-04-07 18:24:12 -07:00
Strahinja Kustudić
eed6cf5dad Adds 'ansible_check_mode' boolean magic variable
* Makes it possible to pass any options variable to VariableManager
  by changing `load_options_vars(options)` in `lib/ansible/utils/vars.py`
2016-04-08 00:26:02 +02:00
Matt Martz
6e9c09d7f7 Utilize urllib3.contrib.pyopenssl functionality for SNI capability in python versions lacking SNI support
Also add SNI tests, move test_uri to destructive since we are messing with packages for SNI testing
2016-04-06 10:14:13 -05:00
Toshio Kuratomi
4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

* python3 compatible base64 encoding
* zipfile compression (still need to enable toggling this off for
  systems without zlib support in python)
* Allow non-wildcard imports (still need to make this recusrsive so that
  we can have module_utils code that imports other module_utils code.)
* Better tracebacks: module filename is kept and module_utils directory
  is kept so that tracebacks show the real filenames that the errors
  appear in.

* Make sure we import modules that are used into the module_utils files that they are used in.

* Set ansible version in a more pythonic way for ziploader than we were doing in module replacer

* Make it possible to set the module compression as an inventory var

This may be necessary on systems where python has been compiled without
zlib compression.

* Refactoring of module_common code:

* module replacer only replaces values that make sense for that type of
  file (example: don't attempt to replace python imports if we're in
  a powershell module).
* Implement configurable shebang support for ziploader wrapper
* Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG)
  via environment variable.
* Remove strip_comments param as we're never going to use it (ruins line
  numbering)

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

* Port test-module to the ziploader-aware modify_module()

* strip comments and blank lines from the wrapper so we send less over the wire.

* Comments cleanup

* Remember to output write the module line itself in powershell modules

* for line in lines strips the newlines so we have to add them back in
2016-04-05 11:06:17 -07:00
jpic
4985411816 Test other use-cases for PluginLoader's config 2016-04-05 14:45:40 +02:00
jpic
da175d0a57 Bugfix: proper plugin configuration was reset
Before this patch, if config was ['/some/path'] then it would enter the
else block and config would be set to [].

The regression this patch fixes was introduced by 700db154.
2016-04-05 14:41:49 +02:00
Toshio Kuratomi
4b0f65a3e5 Merge pull request #15207 from mattclay/verbose-test
Increase verbosity of connection tests.
2016-03-31 22:02:19 -07:00
Matt Davis
3f70d7a70d Merge pull request #15144 from mattclay/winrm-test
Add winrm tests and fix exposed unicode errors.
2016-03-31 16:30:45 -07:00
James Cammarata
180a0a8e77 Fixing up the logic in the test_script tests removal portion 2016-03-31 15:59:19 -04:00
Matt Clay
262c341cda Add connection tests for winrm connection plugin.
These are the same tests used for the other connection plugins,
adapted to use winrm modules and Windows friendly paths.
2016-03-31 08:32:41 -07:00
Matt Clay
a0361626c9 Increase verbosity of connection tests. 2016-03-30 06:57:53 -07:00
James Cammarata
5fdac707fd New unit tests for #13630 fix 2016-03-28 15:54:07 -04:00
René Moser
f2a81e580d Merge pull request #15169 from mgruener/test_cloudflare_dns
Integration tests for the cloudflare_dns module
2016-03-26 09:39:52 +01:00
James Cammarata
d00ac6e2d1 Merge pull request #15072 from rajatguptarg/fix-requirements
Add pycrypto as a requirement to run tests
2016-03-26 00:39:01 -04:00
Michael Gruener
94806e1953 Add integration tests for the cloudflare_dns module 2016-03-25 21:22:29 +01:00
Brian Coca
1ebc2fda71 removes python requirement to script
mistakenly added when checksum was made to use stat module
fixed assertion in test
2016-03-24 16:17:58 -07:00
Matt Clay
943e4d37f5 Run more connection tests in Docker.
Connection tests are now run before non_destructive to make sure
that the known_hosts file in our Docker image has not been removed.
2016-03-23 21:21:52 -07:00
Toshio Kuratomi
52e9209491 Don't create world-readable module and tempfiles without explicit user permission 2016-03-23 09:52:19 -07:00
Toshio Kuratomi
1802e09b08 Exclude .tox from paths scanned for urlopen 2016-03-23 08:49:37 -07:00
Toshio Kuratomi
d3583108ec Fix log_invocation test on python2 with hash randomization 2016-03-23 08:01:21 -07:00
Matt Martz
ad30bad14f Skip test_module_utils_basic__log_invocation until we can figure out the cause of the failure 2016-03-22 21:59:03 -05:00
Matt Martz
a6d52ce098 Ensure that any command in run_tests.sh that fails results in immediate failure 2016-03-22 20:41:37 -05:00
Toshio Kuratomi
c3548677de Add TEST_FLAGS to test_hash 2016-03-22 13:19:29 -07:00
James Cammarata
6afed7083a Revert "Use docker cp instead of docker volumes to allow for testing with remote docker servers"
This reverts commit 18599047cd.
2016-03-22 15:37:47 -04:00
James Cammarata
90ffb8d8f0 Also remove volumes when removing containers 2016-03-22 13:53:54 -04:00
James Cammarata
9a2c1cf94d Force removal of docker container after test ends 2016-03-22 11:45:26 -04:00
Matt Martz
18599047cd Use docker cp instead of docker volumes to allow for testing with remote docker servers 2016-03-22 10:54:57 -04:00
James Cammarata
081c33c451 Adding a docker pull to the run_tests.sh script 2016-03-22 09:49:19 -04:00
James Cammarata
395ff361d4 Adding acl package to all docker images 2016-03-22 07:54:13 -04:00
Toshio Kuratomi
3511abb9d9 Merge pull request #15055 from ansible/ansible_sudo_pass-should-override-cli
Fix ansible_sudo_pass inventory variable so that it overrides setting of sudo password from the command line
2016-03-21 13:31:35 -07:00
Brian Coca
9c6b49fd3d Merge pull request #15004 from agx/zypper-repository-integration-tests
Integration tests for zypper repository
2016-03-21 11:00:50 -07:00
Toshio Kuratomi
ed9e164b80 Fix ansible_sudo_pass inventory variable so that it overrides setting of sudo password from the command line 2016-03-21 10:20:40 -07:00
Rajat Gupta
dd27157b9d Add pycrypto as a requirement to run tests 2016-03-21 21:37:18 +05:30
James Cammarata
7460f76f8d Merge pull request #15052 from mattclay/travis-docker-ssh
Add ssh client and server to docker containers.
2016-03-20 16:41:10 -04:00
Matt Clay
4224c11b5f Combine new RUN commands into one RUN command. 2016-03-20 10:48:11 -07:00
Toshio Kuratomi
6824f3a7cc Change url so that we don't test https in the tests for file perms 2016-03-20 08:49:40 -07:00
Toshio Kuratomi
cbd93b6ad3 Add integration test for #11821 2016-03-20 07:59:00 -07:00
Matt Clay
da99e4e0aa Add ssh client and server to docker containers.
This will allow for future integration tests using ssh to localhost
from within docker containers running on Travis.
2016-03-19 21:33:23 -07:00
nitzmahone
b95286c88e re-integrate test_test_infra output checking
added secondary run with overridden inventory/test args per bcoca request
2016-03-18 10:14:22 -07:00
nitzmahone
6578e63e63 improve test_test_infra debug messaging, rc check 2016-03-18 08:51:43 -07:00
Toshio Kuratomi
bdf90d20dd Add :Z to mount the volume. This is a docker-1.7+ option that makes the mount properly relabel for selinux 2016-03-18 07:47:09 -07:00
Brian Coca
db61e9be0c add ansible_executable inventory var
also handle the overrides appropriately
also new executable to set shell type
2016-03-17 18:54:37 -07:00
Toshio Kuratomi
e80cd8bcaf Merge pull request #14908 from mattclay/mysql-connect-timeout
Document mysql connect_timeout and update tests.
2016-03-17 07:18:01 -07:00
James Cammarata
8eadc1d8eb Adding more unit tests for AnsibleModule things in basic.py 2016-03-17 02:02:15 -04:00
Matt Clay
9a922fcf0d Update test to use mysql connect_timeout option. 2016-03-16 22:31:48 -07:00
Guido Günther
2095d1ab33 Integration tests for zypper repository 2016-03-16 19:56:56 +01:00
Rene Moser
5d5d905e36 cloudstack: new integration tests test_cs_resourcelimit 2016-03-15 21:41:08 +01:00
Rene Moser
4d6a15ebc3 cloudstack: new integration tests test_cluster 2016-03-15 21:41:08 +01:00
Rene Moser
d50026b108 cloudstack: new integration tests test_cs_pod 2016-03-15 21:41:08 +01:00
Rene Moser
ae6d2a5602 cloudstack: new integration tests test_cs_instance_facts 2016-03-15 21:40:45 +01:00
Rene Moser
d9f7589460 cloudstack: new integration tests test_cs_configuration 2016-03-15 21:39:09 +01:00
René Moser
7587c20d27 Merge pull request #13183 from resmo/for-ansible
[2.1] cloudstack: add tests for cs_volume
2016-03-15 21:30:01 +01:00