Commit Graph

1620 Commits (d64eaae2320eecdf69a2f5f4dfdcffd3625a058f)

Author SHA1 Message Date
Matt Clay 9a6b8ab271 Add more tags to test_async role. 8 years ago
Matt Clay fdf22b5a40 Support module tests on a single image. (#16620) 8 years ago
Matt Clay 696feacbb6 Add script to generate module tests. (#16617) 8 years ago
Robin Roth d0ccedc617 Fix git shallow update (#16224)
* add git shallow fetch test

covers https://github.com/ansible/ansible-modules-core/issues/3782

updating a repo with depth=1 fails silently if version==HEAD

* raise git version support supporting depth to 1.9.1
8 years ago
Robin Roth 1f04130c00 add more distribution version tests (#16563)
* ubuntu 16.04
* solaris 10, 11
* fedora 22, 25

Thanks Peter Oliver for providing the test data
8 years ago
Robin Roth 8021adfe97 use git-core ppa instead of menulibre
menulibre is no longer actively maintained and does not support 16.04
8 years ago
Robin Roth a5e394d23a reenable apt_repository tests in ubuntu 16.04
fixes #15718
8 years ago
matsu-chara 9f8b0cabcd fix default/main.yml to defaults/main.yml 8 years ago
Matt Clay 4e369a31db Fix test_async. (#16552)
* Conditionally run test_async in docker containers.
* Revise test_async test.
8 years ago
Matt Clay 292785ff2b Parse async response in async action. (#16534)
* Parse async response in async action.
* Add async test for non-JSON data before module output.
* Fix existing async unit test.

Resolves #16156
8 years ago
Abhijit Menon-Sen 950cc26aab Use loop_control.loop_var directly
6eefc11c converted task.loop_control into an object, but while the other
callers were updated to use .loop_var instead of .get('loop_var'), this
site was overlooked.

This can be reproduced by including with loop_control a file that does
set_fact; a simple regression test along these lines is included.
8 years ago
Matt Clay fbfadc47c7 Update shippable shared dir for COPY_SOURCE. (#16511)
Tests now use '/shared' instead of '/tmp/shared-dir' when using
COPY_SOURCE. This avoids issues with containers purging '/tmp'.
8 years ago
Matt Clay f1e1558f4f Unpin yamllint now that version 1.3.2 is out. (#16479)
The newer version of yamllint fixes the UnicodeEncodeError
which previously required pinning the version to 1.2.2.
8 years ago
jctanner 4ba60d00c8 Refactor the parameter splitting in ini lookup to handle more path formats (#16477)
Refactor the parameter splitting in ini lookup to handle more path formats.

Fixes #16468
8 years ago
Matt Clay 394430a61e Switch test_lookups to badssl/local testing. (#16466)
* Switch test_lookups to badssl/local testing.
* Use var for checking badssl host content.
8 years ago
Matt Clay 81a49912b0 Pin yamllint to 1.2.2 to avoid issues in 1.3.0. (#16464)
This also moves shippable test requirements to external files.
8 years ago
Pilou b361bf90d7 Lookup password omit salt (#16361)
* Lookup unencrypted password must not include salt
* Integration test lookup: remove previous directory
* Test that lookup password doesn't return salt
* Lookup password: test behavior with empty encrypt parameter

Closes #16189
8 years ago
Matt Clay 1b29c87936 Test ansible version and ping during sanity tests. (#16441) 8 years ago
YueMing Qin 310692abe0 Changes to be committed: (#16430)
renamed:    lookup_pipe.py -> lookup_pipe.yml
8 years ago
nitzmahone 1f92ade584 add integration test to assert included tasks run in proper order 8 years ago
Matt Clay 8a55a446bf Fix fedora23 Dockerfile after fedora:23 updates. 8 years ago
Pilou 7ffbbd34f4 Add python-passlib to docker images. (#16376)
Related to #16361
8 years ago
Matt Clay 7de23a1c5b Update opensuseleap Dockerfile.
- Do not update base image packages unnecessarily.
- Fix incorrect package names.
- Remove commented out RUN statements.
- Sort list of packages to install.
8 years ago
jctanner b7f9037b5b Add test for multi-options in authorized_key (#16375)
Addresses https://github.com/ansible/ansible-modules-core/issues/1715
9 years ago
James Cammarata ca6ee4c789 FEATURE: handler listeners
Fixes ansible/proposals#8
9 years ago
James Cammarata 8218591fec Track notified handlers by object rather than simply their name
Due to the fact that roles may be instantiated with different sets of
params (multiple inclusions of the same role or via role dependencies),
simply tracking notified handlers by name does not work. This patch
changes the way we track handler notifications by using the handler
object itself instead of just the name, allowing for multiple internal
instances. Normally this would be bad, but we also modify the way we
search for handlers by first looking at the notifying tasks dependency
chain (ensuring that roles find their own handlers first) and then at
the main list of handlers, using the first match it finds.

This patch also modifies the way we setup the internal list of handlers,
which should allow us to correctly identify if a notified handler exists
more easily.

Fixes #15084
9 years ago
Nate Coraor 706778ee7f Fix distro detection for Solaris derivatives 9 years ago
nitzmahone 7bc3be64ae fix win_setup integration test to match fact name 9 years ago
= 9857af2b6e added further tests for win_regedit to cover the changes made
under https://github.com/ansible/ansible-modules-extras/pull/2436
9 years ago
jctanner 587d3c368b Fix synchronize+vagrant dest assertions that were incorrect. (#16291)
Addresses #16284
9 years ago
Matt Clay cabbafb650 Update Fedora and CentOS docker images.
- Reduce image size by skipping weak package references.
- Consolidate and sort packages to install.
- Improve consistency between versions.
- Combine yum/dnf install and clean to avoid unwanted caching.
- Don't update existing packages from base image unnecessarily.
9 years ago
Matt Clay 82b978e186 Add curl to Ubuntu docker images. 9 years ago
Matt Clay 349b06974e Update Ubuntu docker images.
- Reduce image size by skipping recommended packages.
- Consolidate and sort packages to install.
- Improve consistency between Ubuntu versions.
- Combine apt-get update and install to avoid caching stale updates.
9 years ago
Matt Clay 2f1fc5a324 Update integration test runner on shippable. 9 years ago
Matt Clay 62e6f6b885 Add junit-xml to docker images. 9 years ago
jctanner 3b3ab605f6 Add a get_url test for www.google.com (#16212)
Add a get_url test for www.google.com

Addresses #16191
9 years ago
Dag Wieers d91df20620 Fix unit tests for module_name commit #16087 9 years ago
Brian Coca a529a60478 raw should not use default executable (#16085)
also removed unused cruft in script
9 years ago
Toshio Kuratomi 872f3c5503 Revert "Add git shallow fetch test (#16055)" -- Broke integration tests:
https://app.shippable.com/runs/57599a7897ae890c00c2898d

This reverts commit e81f14ab48.
9 years ago
Robin Roth e81f14ab48 Add git shallow fetch test (#16055)
* add git shallow fetch test

covers https://github.com/ansible/ansible-modules-core/issues/3782

updating a repo with depth=1 fails silently if version==HEAD

* disable git shallow tests for old git versions

Older git versions don't treat the --depth option correctly.
While the git module tried to work around this and introduced subtle
bugs, ansible/ansible-modules-core#3794 falls back to full checkouts.
Don't run the tests then.
9 years ago
James Cammarata fbec2d9692 Expand return code values returned by TQM and strategies
This allows the PlaybookExecutor to receive more information regarding
what happened internal to the TaskQueueManager and strategy, to determine
things like whether or not the play iteration should stop.

Fixes #15523
9 years ago
Matt Clay 03597143d0 Detect use of Travis tests on Shippable.
This can occur when building pre-Shippable branches or PRs.
9 years ago
James Cammarata 61f132a609 Adding unit tests for playbook group/host vars 9 years ago
Toshio Kuratomi 5a3493be5f Port urls.py to python3 and other byte vs text fixes (#16124)
* Port urls.py to python3

Fixes (largely normalizing byte vs text strings) for python3

* Rework what we do with attributes that aren't set already.

* Comments
9 years ago
Matt Clay 6e1e86028f Split integration tests into multiple groups.
This will allow tests to complete much faster.
9 years ago
Toshio Kuratomi 73bb06ae84 Fix the code-smell tests for six again 9 years ago
Adrien Vergé 4d48711242 Fix YAML source and check it on Shippable (#15678)
Fix YAML source and check it on Shippable
9 years ago
Matt Clay 643a7ec01d Merge pull request #16126 from mattclay/shippable-fix
Update how shippable scripts are called.
9 years ago
Matt Clay 7a533406f9 Merge pull request #13145 from Mic92/devel
lxc connection plugin
9 years ago
Matt Clay 6d74f43eff Update how shippable scripts are called. 9 years ago
Saran Ahluwalia fda927a14b added failing test for testing if executable is not empty string 9 years ago
Matt Clay b0e1efbd62 Add full support for Shippable CI. 9 years ago
Toshio Kuratomi 08fd017d99 Test file needed to be renamed 9 years ago
Toshio Kuratomi 2a5ef4496a Workaround test failures on OSX controllers for now -- will have to look
more heavily into normailizing the unicode later.
9 years ago
Toshio Kuratomi f86df7c88b Test that task.args are also set properly (#15950) 9 years ago
Adrian Likins 644f0fb190 Merge pull request #15178 from alikins/galaxy_info_output
galaxy info displayed 'galaxy_info' section wrong [fix for #15177]
9 years ago
Brian Coca 3387d557bc Revert "Add prefixing and suffixing fuctionality to assemble module" (#16084) 9 years ago
Matt Clay e45b3b89a2 Skip some service tests for systemd. 9 years ago
jctanner c52cea8db3 Add a framework, fixtures and test for common synchronize scenarios. (#15983)
* Add a framework, fixtures and test for common synchronize scenarios.

Addresses #15905
9 years ago
Chris Houseknecht ce34397cf8 Merge pull request #10399 from underyx/assemble-with-prefix-and-suffix
Add prefixing and suffixing fuctionality to assemble module
9 years ago
jctanner 373b23cc24 Fix mock loader for osx /etc symlinks (#16074)
Fix role based unit tests for osx via mock.patch
9 years ago
Robin Roth c06884eff0 Run tests on ubuntu1604 and opensuseleap (#15936)
* reduce async sleep time in test
* make zypper test less destructive (don't break following uses of zypper)
* fix ca cert on suse
* fix/enable postgres/mysql on opensuseleap
* fix mysql test for mysql versions 5.7.6 and newer
* skip sni_host check on ubuntu1604
* add HTTPTESTER flag for test_uri

ubuntu 16.04 uses dash which drops env variables containing a dot
we work around this by adding an explicit env variable to enable httptester
9 years ago
Bence Nagy 13210e346f Add integration test for assemble with a header and a footer 9 years ago
Matt Clay 027006b846 Don't use TEST_FLAGS for the test_tags target.
This allows use of --skip-tag in TEST_FLAGS without conflicting with the test.
9 years ago
Matt Clay 844b415066 Mark tasks expected to fail with EXPECTED FAILURE.
This allows for automated identification of tasks which are
expected to fail, but which cannot use ignore_errors because
they need to fail.
9 years ago
Adrian Likins 1468538414 galaxy info displayed 'galaxy_info' section wrong
The output of 'ansible-galaxy info' was formatting the
'galaxy_info' key with one char per line.

Previously, when building the output string, items in
role_info that had a dict for value, the label for
it's key ('galaxy_info' for ex) was being added to
the text list in addition to being appended. Only
the append is needed.

Also added a unit test in test/units/cli/test_galaxy.py,
but skip it on py3 until galaxy is py3 compatible.

fixes #15177
9 years ago
jctanner 018d3c3118 Add a new vmware inventory script backed by pyvmomi (#15967)
Add a new dynamic vmware inventory script backed by pyvmomi
9 years ago
Jörg Thalheim 88482234e6
lxc connection plugin 9 years ago
Toshio Kuratomi c03555b650 Fix unarchive failures when the destination is a symlink to a directory (#15999)
Also add integration tests for this problem and unicode filenames inside
a tarball.

Fixes #3725
9 years ago
Matt Clay b755bcd875 Corrected reference to httptester container. 9 years ago
Matt Martz 164f247ec8 Add httptester docker container files and update run_tests.sh to use ansible/httptester 9 years ago
Brian Coca 329c62e914 docker was deprecated, test now reflects new name 9 years ago
Toshio Kuratomi 650bfdce8f Update grep for six to not falsely trigger when six is only a substring of a different library 9 years ago
Robin Roth 0edec45c3d install packages for tests (#15979)
* curl is needed for test_binary_modules
* glibc-i18ndata is needed for postgresql (localedef)
9 years ago
John R Barker 1861151fa4 [WIP] Extra test and build dependencies in Docker images (#15692)
* Merge conflicts:

* [skip ci] Revert changes to run_tests.sh

gundalow will update this in a different PR

* [skip ci] Add in ubuntu1604 and opensuseleap

NOTE: We are not configuring anything to use these new images yet.
Therefore no impact on Travis performance

* python-mysql for opensuse

* It's mysql-server on centos6
9 years ago
Toshio Kuratomi b41b6b2ec5 Update test off make_become for ssh pty race mitigation (#15931) 9 years ago
nitzmahone 42f6114b61 fix windows integration tests to run under kerberos users 9 years ago
Michael Scherer 376fc21f92 Add a exception for module_utils/six.py regarding code smell (#15878)
Since six replace urlopen, it is normal to trigger the test,
hence the exception
9 years ago
Michael Scherer cc61531a74 Do not test vca and vmware.py for py2.4 (#15887)
Since both of them depend on libraries not
working on python 2.4, we shouldn't restrict
ourself on 2.4, cf https://github.com/ansible/ansible/pull/15870
9 years ago
Robin Roth 85477fa215 Don't use 'from ansible.module_utils import foo' style here as it breaks (#15756)
py.test"
9 years ago
Toshio Kuratomi c1cc9f1f23 Merge pull request #15845 from abadger/ziploader-constants
Ship constants to the modules via internal module params rather than a secondary dict
9 years ago
Toshio Kuratomi 186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 9 years ago
Matt Davis bc7405efc9 Merge pull request #15797 from robinro/patch-1
reduce async timeout in unittests
9 years ago
Matt Martz 196453b9b2 Merge pull request #13771 from sivel/binary-modules
First pass at allowing binary modules
9 years ago
Matt Martz 651b83d8be Run test_binary_modules 9 years ago
Matt Martz 0faddfa168 Move binary module detection into executor/module_common.py 9 years ago
Matt Martz 3466e73c50 Resolve test failures 9 years ago
Matt Martz 2d18607f1e Add GPL3 header to helloworld.go 9 years ago
Matt Martz 6ad8ec0919 Add integration tests for binary modules 9 years ago
Toshio Kuratomi 292f0ed0d6 If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
9 years ago
Toshio Kuratomi 8a184381af Strip junk after JSON return. (#15822)
Fixes #15601
9 years ago
James Cammarata 67c32ac30a Merge branch 'samples-to-test' of https://github.com/dagwieers/ansible into dagwieers-samples-to-test 9 years ago
Matt Martz accf40d8a8 Use httptester docker image for http tests (#15811)
* Use httptester docker image for http tests

* When not running with an httptester linked container, use public test sites
9 years ago
Toshio Kuratomi c730af5dc2 Remove reload from arg related tests. Changes to how ziploader passes args mean we don't need reload anymore. (#15782) 9 years ago
Toshio Kuratomi 7ccb08cc7e Switch to a different url for testing SNI right now. (#15798) 9 years ago
Robin Roth 254cf9ea68 reduce async timeout
reduce from 3 sec to 0.1 sec; the 3 sec sleep was about half of the total unittest time on my development machine...
9 years ago
Toshio Kuratomi 5c7ad654db Add some more tests for item squashing 9 years ago
nitzmahone 133395db30 add jimi-c's unit test for squashed skip results, tweaked is_skipped() logic to pass 9 years ago
Brian Coca 2af8e3b9d8 fix default for removing images 9 years ago
Brian Coca 27a1ae4732 added ability to also subset make tests 9 years ago
Rene Moser 5583027f99 tests, postgresql: add ubuntu 16.04 support 9 years ago
Rene Moser 39e4caafb2 tests, apt_repository: disable Ubuntu 16.04 as there is no package yet 9 years ago
Rene Moser c20d1fced7 tests: fix tests on Debian 8 9 years ago
Robin Roth cf62a62b83 use userdir module as example instead of alias (#15540)
* alias module is very basic and removing it leads to the suse default
  config failing
* future improvements might test different modules and the effect of
  them being removed
9 years ago
Brian Coca 47d58c30e4 another var 'defaulted' in run_tests 9 years ago
Brian Coca 3669ab2456 added defaults for 'optional' vars 9 years ago
Brian Coca 52a714143f fine tuned shell switches for run_tests.sh 9 years ago
Yannig 3901556b35 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.
9 years ago
Robin Roth 1d6608e84f Dist version fix for Red Hat and more tests (#15663)
* add tests for centos6, rhel6 and rhel7

* gen_distribution_version_testcase with python2.6

* remove unused imports

* fix redhat/vmware/... parsing

* add centos7 test case
9 years ago
Toshio Kuratomi 1b78fd57b1 Merge pull request #15656 from abadger/ziploader-namespace
Fix ziploader for the cornercase of ansible invoking ansible.
9 years ago
Matt Davis ca5080d56b Merge pull request #15570 from jhawkesworth/regedit_fix_str_compare_tests
win_regedit integration test to cover change to allow empty string comparison
9 years ago
Toshio Kuratomi 487e6562ca 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 ziplaoder, move the version ito ANSIBLE_CONSTANTS.
* Change PluginLoader to properly construct the path to the plugins even
  when namespace packages are present.
9 years ago
Toshio Kuratomi d652b2edc0 Fix for unittests on python2.6 or less 9 years ago
Robin Roth 12f7f50f31 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
9 years ago
Toshio Kuratomi 7e1fbe2e03 Some algorithmic unittests for the apt and docker modules 9 years ago
Toshio Kuratomi e4a1622f53 Do not check docker or azure module_utils code for py2.4 compat (the libs require py2.6+) 9 years ago
Toshio Kuratomi 85bef402b1 Merge pull request #14614 from gundalow/test_binary
non-destructive says we should run test_binary at v2
9 years ago
Tegan Snyder bf0da4aa3c add centrify dzdo escalation (#15219)
add dzdo context, and test
9 years ago
= bd74091ed9 win_regedit integration test to cover change to allow empty strings to be compared 9 years ago
Toshio Kuratomi 44e21f7062 Allow AnsibleModules to be instantiated more than once in a module
Fix SELINUX monkeypatch in test_basic
9 years ago
jctanner 4d36b3f7b6 Extend the get_url integration tests to include file schemas. (#15532)
Addresses https://github.com/ansible/ansible-modules-core/issues/3511
9 years ago
Toshio Kuratomi e893b65a9b Don't pick up whole commented lines in the urlopen code-smell tests 9 years ago
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
9 years ago
Robin Roth 59bad647b6 Revert "Disable new git tests until a fix for rhel6/7 is merged."
This reverts commit 197d3dfe97.
9 years ago
Toshio Kuratomi 03126f7097 Fix cut and paste error of test code 9 years ago
Toshio Kuratomi 197d3dfe97 Disable new git tests until a fix for rhel6/7 is merged. 9 years ago
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
9 years ago
Brian Coca 33761efd19 Merge pull request #15417 from bcoca/copy_vaulted
Copy vaulted
9 years ago
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
9 years ago
Matt Davis 822f904aa6 Merge pull request #14813 from mattclay/lxd-plugin
Add lxd connection plugin.
9 years ago
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
9 years ago
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.
9 years ago
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)
9 years ago
James Cammarata ed35e8bce2 Don't override the http status code when successful in urls.py 9 years ago
Toshio Kuratomi 7833b5bec4 Merge pull request #15420 from robinro/distribution_version_tests
Distribution version tests
9 years ago
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
9 years ago
Matt Clay 5fc76df18b Add lxd connection plugin. 9 years ago
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 9 years ago
Robin Roth 49cdc565c5 remove nose.tools use 9 years ago
Robin Roth 4088aa2b4c get rid of assert_in 9 years ago
Robin Roth 692bf51fde move gen_testcase to hacking/tests
* also use json instead of pprint
9 years ago
Robin Roth 37188ea336 cleanup tests
* use nose test generator
* more comments
* move facts import inside the skipped function, fix python3 warning
9 years ago
Robin Roth 2b104fe6ad fix tests for SLES and CoreOS
* include #15230
9 years ago
Robin Roth b48e628429 test git version before running test on depth 9 years ago
= 157072a39f Windows: win_regedit integration tests (following https://github.com/ansible/ansible-modules-extras/pull/2034 ) 9 years ago
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
9 years ago
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
9 years ago
Robin Roth 3c883d8a6d add testcases from refactor PR 9 years ago
Matt Clay af8258cdf2 Revert "Increase verbosity of connection tests." (#15305) 9 years ago
Toshio Kuratomi 208ad36ce4 Merge pull request #15344 from abadger/ziploader
Ziploader "recursive imports" and caching
9 years ago