Commit Graph

765 Commits (1e8d0110ef44b3535543d466ee34f8d41b1c46de)

Author SHA1 Message Date
Toshio Kuratomi 1efe782b46 Refactor parsing of CLI args so that we can modify them in the base class
Implement tag and skip_tag handling in the CLI() class.  Change tag and
skip_tag command line options to be accepted multiple times on the CLI
and add them together rather than overwrite.

* Make it configurable whether to merge or overwrite multiple --tags arguments
* Make the base CLI class an abstractbaseclass so we can implement
  functionality in parse() but still make subclasses implement it.
* Deprecate the overwrite feature of --tags with a message that the
  default will change in 2.4 and go away in 2.5.

* Add documentation for merge_multiple_cli_flags
* Fix galaxy search so its tags argument does not conflict with generic tags
* Unit tests and more integration tests for tags
8 years ago
Matt Davis aa0ad073b8 bugfixes to JSON junk filter, added unit/integration tests to exercise (#17834) 8 years ago
Matt Clay 21857e8618 Disable privileged mode on Shippable. (#17844) 8 years ago
Adrian Likins 1f03801fcc mv test_git to 'destructive' integration tests (#17526)
The test_git role removes ~/.ssh/known_hosts currently
and that is destructive.
8 years ago
Toshio Kuratomi 4452ee86bd Turn mount test back on (#17797)
* Turn mount test back on

* Mount tests need PRIVILEGED so turn that back on

Revert "Revert "Set PRIVILEGED=true for non_destructive tests. (#17733)" (#17738)"

This reverts commit dc0fb1c212.

* Add a needs_privileged tag so that we can skip mount tests on centos6

Some containers timeout on shippable tests when run with privileged.
Unfortunately, some tests require that in order to run.  Tagging those
allows us to skip those tests on the platforms that timeout when we get
ready to run the integration test in shippable.

* Centos6 times out with PRIVILEGED set so remove that (will disable the mount tests on centos6)

* Remove false start
8 years ago
Matt Clay 6d78397b8b Update get_url test to use httptester. (#17787) 8 years ago
Toshio Kuratomi 1f311f0739 Disable mount tests for now. Mount is buggy on too many platforms 8 years ago
Toshio Kuratomi 0bf92d2b5c Add tests for the mount module (#17718)
* Add tests for the mount module

* Switch from unmounted to absent...

the code for mounting always modifies fstab so we need to always modify
fstab to cleanup as well.

* Fix comments and copyright
8 years ago
Matt Clay cf4d436e07 Remove run_tests.sh and update docs. (#17719)
Removed the obsolete test/utils/run_tests.sh script in favor of
using the newer test/utils/shippable/integration.sh instead.
8 years ago
Tom Melendez 97a1b7ded1 Integration Playbook for Google Cloud DNS module. (#17698) 8 years ago
Toshio Kuratomi 8aa8e07d13 Remove _load_hosts() from Play initialization as it's no longer needed and it breaks using extra_vars defining a list for hosts (#17699)
Thanks to @jimi-c for the solution

Fixes #16583
8 years ago
Matt Clay 3874e653c1 Remove tests for deprecated su and sudo. (#17697) 8 years ago
Tom Melendez 0e85f88f8e test_gce_mig integration test playbook (#17249)
Includes:
* Tests to create, delete, resize, recreate and configure an Autoscaler
* Tests for parameters only.  Use TEST_FLAGS="--tags 'param-check'" to execute only these tests.

Requires:
* An instance template to be configured in your project.
8 years ago
Matt Clay 39c5c558f8 Switch tests from sudo to become. (#17694) 8 years ago
Toshio Kuratomi 7889e1ffc1 Additional tests for check mode idempotence (#17679) 8 years ago
Matt Clay e0ad02c6dd Remove test for deprecated first_available_file. (#17674) 8 years ago
Rob Cutmore 2716fe4362 Add test for checking pip package in check mode (#17360) 8 years ago
Steve Gargan a06da86d52 update consul tests to reflect fixes to the core and session modules (#17451) 8 years ago
Tom Melendez 91a30e59e4 Changes to enable make gce to run. Added sys import so libcloud error is displayed; renamed credentials keys in template file so they work properly with gce_credentials.py. (#16607) 8 years ago
Matt Clay 355b29573c Use default on undefined vars in tests. (#17601) 8 years ago
Matt Clay 16baef1f72 Do not use bare vars in integration tests. (#17599) 8 years ago
Matt Davis f497d771c8 win_shell/win_command changes + tests (#17557) 8 years ago
Matt Clay 7b3cbafbe9 Add python 3 awareness to apt module tests. (#17574)
Also remove unnecessary dependency from ubuntu1604py3 Dockerfile.
8 years ago
René Moser 28feba2fb3 jenkins_job: extend integration tests (#17558) 8 years ago
Michael Scherer e9ffe2062f Add test for the pause in loop feature (#17336)
See https://github.com/ansible/ansible/pull/17289
8 years ago
René Moser 6a3e948a7c jenkins_job: add integration tests (#17499) 8 years ago
Toshio Kuratomi bf29961947 Fixes to the controller text model (#17527)
* Fixes to the controller text model

* Change command line args to text type
* Make display replace undecodable bytes with replacement chars.  This
  is only a problem on pyhton3 where surrogates can enter into the msg
  but sys.stdout doesn't know how to handle them.
* Remove a deprecated playbook syntax in unicode.yml

* Fix up run_cmd to change its parameters to byte string at appropriate times.
8 years ago
nitzmahone 69880f1640 add win_user regression tests
Ensure https://github.com/ansible/ansible-modules-core/issues/4369 doesn't occur again, also adds tests for password set when expired.
8 years ago
Matt Clay 784810a84c Add python 3 support to test_apt_repository. (#17472) 8 years ago
nitzmahone 7a9395b5e0 disable windows loop async test
Fails pretty regularly on Shippable/AWS, never locally- always seems to be on the last async task in the loop.
8 years ago
Matt Davis f239e1e61f windows async changes and tests (#17400) 8 years ago
jhawkesworth 9fe4308670 add very basic tests of win_package, based on existing win_msi tests. (#17383)
* add very basic tests of win_package, based on existing win_msi tests.
8 years ago
Toshio Kuratomi d6ebf9bdc6 Symink integration tests for fetch and stat 8 years ago
Michael Scherer 918d1e038e Do not hardcode python executable in test (#17380)
Based on https://github.com/ansible/ansible/pull/17376
8 years ago
Matt Clay 4ae59b2743 Use ansible_python for interpreter in test_uri. (#17376) 8 years ago
Matt Clay 7cd988f60c Enable more integration tests for python 3. (#17375)
The test_async test target was updated to accommodate changes in
output buffering behavior in python 3. This change in behavior
may need to be addressed in the future.
8 years ago
Michael Scherer 529950680b Disable yum test on python 3 (#17327)
Since yum is not gonna be running on python3 ever, we have to filter it.
8 years ago
Gennady Trafimenkov 2e857cfafd Add mention of integration tests in Docker containers (#16661)
It is quite convinient and easy to run integration tests in Docker containers.

I hope it can motivate more people to write integration tests.
8 years ago
Jonathan Mainguy a4cee11649 Add test for specific privlege grants on database.table (#17328)
For the mysql_user module
8 years ago
Jonathan Mainguy 2248d2464b add unit test for mysql_user (#17335)
this removes all blank users, and then does so again
to ensure changed the first time and ok the second time
8 years ago
Michael Scherer 878d0d5b87 Running the test with a locale other than English make that test fail
While tests are supposed to be run in docker, people might still
want to use them on their own boxes.
8 years ago
Allen Sanabria 03132041fb Include vars updated to work with directories (#17207)
* New features for include_vars

include_vars.py now allows you to include an entire directory and its nested directories of variable files.

Added Features..

* Ignore by default *.md, *.py, and *.pyc
* Ignore any list of files.
* Only include files nested by depth (default=unlimited)
* Match only files matching (valid regex)
* Sort files alphabetically and load in that order.
* Sort directories alphabetically and load in that order.

```
    - include_vars: 'vars/all.yml'

    - name: include all.yml
      include_vars:
        file: 'vars/all.yml'

    - name: include all yml files in vars/all and all nested directories
      include_vars:
        dir: 'vars/all'

    - name: include all yml files in vars/all and all nested directories and save the output in test.
      include_vars:
        dir: 'vars/all'
        name: test

    - name: include all yml files in vars/services
      include_vars:
        dir: 'vars/services'
        depth: 1

    - name: include only bastion.yml files
      include_vars:
        dir: 'vars'
        files_matching: 'bastion.yml'

    - name: include only all yml files exception bastion.yml
      include_vars:
        dir: 'vars'
        ignore_files: 'bastion.yml'
```

* Added whitelist for file extensisions (yaml, yml, json)

* Removed unit tests in favor of integration tests
8 years ago
René Moser 26118a51f8 exo_dns: new module utils and integration tests for exoscale DNS (#17230) 8 years ago
Michael Scherer d8f66defd0 Ignore difference on whitespace (#17302)
While trying to fix the test suite on python3, I noticed
this test fail due to to_json adding more whitespace in
python3 than in python2. So -w should ignored those
differences.
8 years ago
Toshio Kuratomi 380a5801e9 Enable integration tests on python3 that are already working (#17212) 8 years ago
Toshio Kuratomi 51ec35378d xrange and izip_longest aren't available in vanilla python3 (#17226)
Fixes for these are either rewriting to get rid of the need for the
functions or using six.moves to get equivalent functions for both
python2 and python3
8 years ago
Yannig 27b0f3241b new filter human_bytes: convert a string (ex: 1Mo, 1K) into bytes (#12074)
* Rework human_readable and human_to_bytes.
New filter human_to_bytes.

* Fix for python 3.
8 years ago
Adrian Likins e396d5d508 Implement vault encrypted yaml variables. (#16274)
Make !vault-encrypted create a AnsibleVaultUnicode
yaml object that can be used as a regular string object.

This allows a playbook to include a encrypted vault
blob for the value of a yaml variable. A 'secret_password'
variable can have it's value encrypted instead of having
to vault encrypt an entire vars file.

Add __ENCRYPTED__ to the vault yaml types so
template.Template can treat it similar
to __UNSAFE__ flags.

vault.VaultLib api changes:
    - Split VaultLib.encrypt to encrypt and encrypt_bytestring

    - VaultLib.encrypt() previously accepted the plaintext data
      as either a byte string or a unicode string.
      Doing the right thing based on the input type would fail
      on py3 if given a arg of type 'bytes'. To simplify the
      API, vaultlib.encrypt() now assumes input plaintext is a
      py2 unicode or py3 str. It will encode to utf-8 then call
      the new encrypt_bytestring(). The new methods are less
      ambiguous.

    - moved VaultLib.is_encrypted logic to vault module scope
      and split to is_encrypted() and is_encrypted_file().

Add a test/unit/mock/yaml_helper.py
It has some helpers for testing parsing/yaml

Integration tests added as roles test_vault and test_vault_embedded
8 years ago
Matt Clay a695e18615 Add support for OS X CI on Shippable. (#17160) 8 years ago
Matt Clay 04bd6a3619 Make tests more cross platform. (#17154) 8 years ago