Commit graph

940 commits

Author SHA1 Message Date
Matt Clay
cb76200c7d PEP 8 E111 & E114 cleanup. (#20838) 2017-01-30 15:01:47 -08:00
Matt Clay
95789f3949 PEP 8 whitespace cleanup. (#20783)
* PEP 8 E271 whitespace cleanup.
* PEP 8 W293 whitespace cleanup.
* Fix whitespace issue from recent PR.
2017-01-27 15:45:23 -08:00
Jordan Borean
971783a7fd Feature/win stat extra info (#19148)
* Added more return results to win_stat

* Changed Win2012 methods to support older versions in setup

* staging of the tests to work with older servers
2017-01-27 14:51:12 -08:00
Matt Clay
63b1e0c277 Fix infrequent PEP 8 issues. 2017-01-27 14:06:21 -08:00
Trond Hindenes
679a3cb1cc Merge pull request #20599 from dagwieers/win_regedit-cleanup
win_regedit: Cleanup, check/diff mode support, HKCC fix
2017-01-27 18:09:27 +01:00
Dag Wieers
0e80ba1867 Fix the integration test to comply recent changes 2017-01-26 20:06:46 +01:00
Matt Clay
31d6b6ef67 Run postgresql tests on FreeBSD. (#20676)
* Use vars for user, group and locale suffix.
* Switch tests from `es_MX` to `es_ES`.
* Enable postgresql tests on freebsd.
* Work-arounds for service restart on freebsd.
2017-01-25 18:45:28 -08:00
Matt Clay
5d5e5e25a2 Only set git config during test if unset.
This makes the git test less destructive.
2017-01-25 18:05:17 -08:00
Patrick Ogenstad
ac527ef86f Check for removal not allowed errors (#19251) 2017-01-25 13:05:44 +00:00
Matt Clay
d8b18d79fa Disable assertions that fail on WS 2016. 2017-01-24 20:08:50 -08:00
Matt Clay
d6cdd91511 Remove win_fetch from CI due to instability. 2017-01-24 17:33:11 -08:00
Ansible Test Runner
ff1a732ffd Increase timeout for http server in uri test. 2017-01-24 14:20:19 -08:00
Matt Clay
836e0b59d2 Fix git remote url change detection. (#20587)
* Fix git remote url change detection.

When comparing paths, unfrackgitpath must be called on both sides
of the comparison. Otherwise comparisons involving symlinks will
return incorrect results.

* Re-enable git test on OS X.

* Return None from unfrackgitpath when path is None.
2017-01-23 16:09:42 -08:00
Matt Clay
61e6e7868c Improve jinja2 test coverage. (#20533)
* Run `template` test on latest jinja2 version.
* Update jinja2 install for groupby_filter.
* Clean test output dir for each test.
2017-01-20 16:38:52 -08:00
Matt Clay
d87ee022bb Enable more ios tests on Shippable. 2017-01-20 13:26:59 -08:00
John R Barker
11c15bbbaf Disable IOS tests for the moment (#20524) 2017-01-20 20:24:54 +00:00
John R Barker
a12033a6e0 integration/targets/ios_* work to support IOS (#20414)
* WIP

* Don't set connection: network_cli in the playbook

* ios_config tests now passing

* Create test loopback device

* delete

* ios_* pass (apart from ios_facts)

* Remove provider lines
2017-01-20 20:18:12 +00:00
James Cammarata
188c3c608a Don't restrict local jinja2 variables to those that start with l_
Per a change in jinja2 2.9, local variables no longer are prefixed
with l_, so this updates AnsibleJ2Vars to pull in all locals (while
excluding some) regardless of name.

Fixes #20063

(cherry picked from commit 4d49b317929b86e1fc1b0cbace825ff73b372dc7)
2017-01-20 07:15:51 -06:00
Matt Clay
9213d0c5b0 Fix and enable more tests for osx and freebsd. (#20482)
* Fix `iterators` test for osx.
* Enable `git` test for osx.
* Enable `get_url` test for osx and freebsd.
* Remove unused SNI_URI from uri test.
* Use ansible hosted SNI host oustside docker.
* Enable `uri` test for osx and freebsd.
* Enable `gathering_facts` test for osx.
* Skip single task on osx until test is fixed.
2017-01-19 17:10:33 -08:00
Matt Martz
537b3b75a6 Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098 (#20362)
* Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098

* Address some of the requested changes

* Quoting

* Print the python path and version

* Be less explicitly verbose, rely on implicit verbosity
2017-01-19 11:39:59 -08:00
Matt Clay
a8fb6f0958 Use jinja2 import instead of pip to get version.
This resolves issues with older versions of pip.
2017-01-19 11:06:47 -08:00
Andrew Gaffney
ac51266e8f Add pipeline-ish method using dd for file transfer over SSH (#18642) 2017-01-19 12:31:14 -05:00
Matt Davis
b2a16379c8 new module: win_path (#20073) 2017-01-17 20:21:04 -08:00
gaudenz
08e08ac775 new module cloudscale_server (#20175) 2017-01-17 23:15:20 +01:00
David M. Lee
fde551fa2a Adding support for Amazon ECR (#19306)
* Adding support for Amazon ECR

This patch adds a new module named ecr, which can create, update or
destroy Amazon EC2 Container Registries. It also handles the management
of ECR policies.

* ecs_ecr: addressed review feeback

 * Renaming ecr to ecs_ecr
 * Fixed docs
   * Removed bad doc about empty string handling
   * Added example of `delete_policy`
 * Removed `policy_text` option; switched policy to `json` type so
   it can accept string or dict
 * Added support for specifying registry_id
 * Added explicit else after returned if clauses
 * Added `force_set_policy` option
 * Improved `set_repository_policy` error handling
 * Fixed policy comparisons when AWS doesn't keep the ordering stable
 * Moved `boto_exception` into the module
2017-01-17 14:45:43 -05:00
John R Barker
64432c8f7c WIP: net_command: Initial tests for VyOS (#20147)
* Conditional include on ansible_network_os

* copy & paste error

* More tests

* More tests

* junos tests (based on vyos)

* remove excessive whitespace

* Pass in ansible_network_os

* net_command for ios

* consistent debug

* wrapp line

* ansible-test changes made in another PR

* ansible-test changes made in another PR
2017-01-17 11:06:34 +00:00
Matt Clay
893e2e0d35 Use ansible-test in integration test README. 2017-01-16 19:01:59 -08:00
Matt Clay
ad65274643 Only test map on jinja2 >= 2.7 2017-01-16 13:41:42 -08:00
Toshio Kuratomi
32fbd4ba24 Test the extract filter without the map filter.
map + extract is the usual way to use it but map isn't available on
older versions of jinja2 that we still work with.  Test extract even on
those versions.
2017-01-16 13:13:34 -08:00
Matt Martz
d25a70846f Only add Content-Type if not specified in headers. Fixes #20046 (#20234)
* Only add Content-Type if not specified in headers. Fixes #20046

* Update documentation to indicate body_format will not override Content-Type if specified in headers
2017-01-13 13:19:38 -05:00
Matt Clay
f534573dcf Enable first network tests on Shippable. (#20208) 2017-01-12 18:23:53 -08:00
berenddeschouwer
b1c57ea443 Installroot OS version check fix (#20180)
Cast to int before checking the OS version.
This prevents the DNF tests from running on
Fedora < 23
2017-01-12 18:02:35 -08:00
Alvaro Aleman
1b2ad94496 Configurable fact path (#18147)
* Make fact_path configurable

* Add docs for fact_path

* Add tests for localfacts

* Default fact gathering settings in PlayContext
2017-01-12 10:49:04 -05:00
Robin Roth
4976429e42 Zypper: Fix update_cache in checkmode (#20143)
Fixes #20139

Refresh does not support dry-run, so don't run it in check mode.
Also add a test for this case.
2017-01-11 18:47:16 +00:00
John R Barker
ec36b4968c Junos aws (#20083)
* junos Use inventory_hostname_short
* Basic Test for validating VyOS bringup in AWS
2017-01-10 11:11:00 -08:00
Matt Clay
cc3d131f50 Fix group_by test to work with jinja2 >= 2.9. 2017-01-09 15:20:34 -08:00
John R Barker
b8ee80ac4e junos Use inventory_hostname_short (#20061)
Don't use hardcoded hostnames
2017-01-09 20:15:16 +00:00
Steve Bussetti
8a8090e658 test related to pulls: #19257 / #19057 (#19346) 2017-01-09 12:08:56 -08:00
John R Barker
fb3bef7f46 Use inventory_hostname_short (#20054)
When using AWS we have to use the full domain name in the inventory file, which
we rather than the short name. This change avoids that ending up being
set in the tests.
2017-01-09 17:21:04 +00:00
Robin Roth
cd02d0ca1d Cleanup git tests (#19737)
* Cleanup git tests
* Split git tests in seperate files
* Remove use of repo_depth_url
* Use native yaml
* Remove unnecessary remote/local clones
* Fix newlines for yamllint
* If the hash is valid (full-length) but doesn't exist, git returns 128 instead of 1.
* Ensure git doesn't use hardlinks for shallow clones
2017-01-06 14:38:53 -08:00
Toshio Kuratomi
95df8977b6 Fix yum install root (#19925)
* Reenable yum install root tests

No need for sos to test installroot.  Something with less deps works
just as well.

* Fix yum installroot.

Fix module import to use fail_json when the modules aren't installed.

Remove wildcard imports

* Lsat task is supposed to remove sos so make that happen
2017-01-05 10:42:43 -08:00
Toshio Kuratomi
84e755b252 Disable the yuminstallroot tests that are failing until the submitter can take a look. 2017-01-05 00:32:15 -08:00
Toshio Kuratomi
cd2516bf8d Revert "Revert "Add --installroot to YUM and DNF modules, issue #11310""
This reverts commit b73ddd5212.
2017-01-05 00:24:20 -08:00
Matt Clay
b73ddd5212 Revert "Add --installroot to YUM and DNF modules, issue #11310" 2017-01-05 00:14:33 -08:00
berenddeschouwer
1fdcda0996 Add --installroot to YUM and DNF modules, issue #11310 (#19861)
* Add --installroot to YUM and DNF modules, issue #11310

This continues ansible-modules-core#1558, and
ansible-modules-core#1669

Allow specifying installroot for the yum and dnf modules
to install and remove packages in a location other than /.

* Remove empty aliases

* Simpler installroot set default logic
2017-01-04 19:20:00 -08:00
Matt Clay
95b59cd76c Remove needs/privileged from postgresql test. (#19907)
* Remove `needs/privileged` from postgresql test.
* Add python 3 support to postgresql tests.
2017-01-04 16:41:18 -08:00
Matt Clay
709a3aa42b Run service test on py3 + unprivileged on docker. (#19841)
* Run service test on py3 + unprivileged on docker.
* Fix service integration test for python 3.
2017-01-04 15:55:57 -08:00
Toshio Kuratomi
e98c0a3009 Fix locale_gen to compare native strings rather than mixing byte and text strings
Fixes #19426
2017-01-04 10:11:33 -08:00
Rene Moser
6c2af29659 tests: add handler listen test cases 2017-01-03 15:00:00 -08:00
Robin Roth
9f2d22425b Run tests on opensuse42.2
* add to shippable
* add to completion/readme
* Fixes #18645
2017-01-03 12:20:10 -08:00
Matt Clay
68346b128f Update Fedora tests to use releases 24 and 25. 2017-01-03 11:12:32 -08:00
John R Barker
c252ac1a7d Make tests run on fresh install (#19566) 2017-01-03 10:53:16 -05:00
Marius Gedminas
b0b7a636d8 authorized_key: support --diff (#19277)
* Refactoring: split readkeys() into readfile() and parsekeys()

* Refactoring: split writekeys() into writefile() and serialize()

* authorized_key: support --diff

* Refactoring: remove no-longer used readkeys()/writekeys()

* Integration test for authorized_key in check mode
2017-01-03 09:32:32 -05:00
Tom Melendez
d09ad82e71 Add regex support to gce_tag module, add unit tests and update integration test. (#19087)
The gce_tag module can support updating tags on multiple instances via an instance_pattern field.  Full Python regex is supported in the instance_pattern field.

'instance_pattern' and 'instance_name' are mutually exclusive and one must be specified.

The integration test for the gce_tag module has been updated to support the instance_pattern parameter.  Unit tests have been added to test the list-manipulation functionality.

Run the integration test with:

TEST_FLAGS='--tags "test_gce_tag"' make gce

Run the unit tests with:

python test/units/modules/cloud/google/test_gce_tag.py
2016-12-29 08:45:20 -05:00
Matt Davis
f96ac8bff0 fix multiple handler notifications (#19655)
Fixes #19647
Adds integration test to catch multiple handler notifications
2016-12-22 21:33:24 -08:00
Rob Cutmore
1da6a67c50 Add tests for Git remote URL changes (#16893)
* Update Git tests for set remote URL changes
* Git: report changed when needed in check mode
2016-12-22 13:46:47 -08:00
Dag Wieers
438cd6687f Added tests for sefcontext module 2016-12-22 13:29:13 -08:00
Will Thames
5f0815d7f4 Fix too-many-quote problem in setup_ec2 role
An inner single-quote pair breaks out of the outer single-quote
pair. Rather than escaping the inner quotes to protect against
this, just use the fact that `str()` is equivalent to `""`.
2016-12-22 10:18:56 -08:00
bart2
cdb35f4ce2 Fixes #16936 - Digest authentication not working in uri module (#18736) 2016-12-21 18:11:42 -08:00
Matt Clay
39f6368015 Update aliases file for uri integration test. 2016-12-14 20:36:50 -08:00
Matt Clay
80c559bdef Test sftp and scp for ssh connection. 2016-12-14 17:34:03 -08:00
Robin Roth
afca957396 Fix UnboundLocalError remote_head in git (#19057)
* Fix UnboundLocalError remote_head in git

Fixes #5505

The use of remote_head was a leftover of #4562.
remote_head is not necessary, since the repo is unchanged anyway and
after is set correctly.

Further changes:
* Set changed=True and msg once local_mods are detected and reset.
* Remove need_fetch that is always True (due to previous if) to improve
clarity
* Don't exit early for local_mods but run submodules update and
switch_version

* Add test for git with local modifications
2016-12-14 08:36:15 -08:00
Dag Wieers
7c71c678fa Fix regression in search path behaviour
This PR fixes a few issues:

- Missing role parent directory for relative paths
- Fix integration tests (add missing stage)
- Redesign integration tests
- Incorrect order with tasks-lookups
- Duplicate paths are listed
- Repetitive tasks/tasks or files/files were possible

==== using copy with test.txt
Before:
```
   491 1481281038.29393: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
        /home/dag/home-made/ansible.testing/test.txt
```

After:
```
 32505 1481280963.22418: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
        /home/dag/home-made/ansible.testing/test.txt
```

==== Using copy with files/test.txt

Before:
```
 31523 1481280499.63052: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/files/files/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
```

After:
```
 31110 1481280299.38778: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
```

==== Using template with files/test.txt.j2
Before:
```
 30074 1481280064.15191: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/files/test.txt.j2
```

After:
```
 29201 1481279823.52752: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/files/test.txt.j2
```

This fixes #19048
2016-12-14 10:33:14 -05:00
Toshio Kuratomi
c6b42028c4 Fixes for uri under python3 and local (non-httptester) testing 2016-12-13 15:46:07 -08:00
Carlos E. Garcia
0b8011436d minor spelling changes 2016-12-13 13:51:13 -05:00
John R Barker
b915e790d3 veos-dut-01 is down, so use veos01 (#19299) 2016-12-13 14:40:52 +00:00
John R Barker
bdc4fa6b99 Add group_vars/ops.yaml (#19288)
Authentication details for ops modules. Was missed during porting
2016-12-13 11:54:51 +00:00
Robin Roth
5bf07454cb Test apache2 force (#18500)
* Use native yaml for apache2 test

* Test removal of default modules with force

a2enmod on debian has `-f`, but not on SUSE (runs there without force).
Therefore don't test that option on SUSE.
The docs already specify that the option is intended for Debian systems
only.
2016-12-12 14:19:47 -08:00
John R Barker
39af9b5a86 Make it clearer where the network tests live (#19242) 2016-12-12 18:09:10 +00:00
Robin Roth
e18bc0d6f0 Add test for auto_import_keys in zypper_repository (#17898)
* tests the bug found in ansible/ansible-modules-extras#3086
2016-12-09 09:47:56 -05:00
John R Barker
d22f7b4919 vyos: Don't run show commands that are over ANSIBLE_VYOS_TERMINAL_LENGTH (#18682) 2016-11-30 17:08:52 +00:00
Matt Clay
6bbd92e422 Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
Virgil Dupras
bf48383610 Fix regression in jinja2 include search path (#18617)
* Fix regression in jinja2 include search path

Since commit 3c39bb5, the 'ansible_search_path' variable is used to set
jinja2's search path for {% include %} directives. However, this path is
the the proper one because our templates live in 'templates' subdirs in
our search path.

This is a regression because previously, our include search path would
include the dirname of the currently interpreted file, which worked most
of the time.

fixes #18526

* Fix template lookup search path

Improve fix in commit c96c853 so that the search path contain both
template-suffixed paths as well as original paths.

ref PR #18617

* Add integration test for template lookups

Tests regression at #18526

This test fails on current devel branch and succeeds on PR #18617
2016-11-29 16:23:06 -05:00
Adrian Likins
9b1ce5dfb9 add integration tests for authorized_key (#18130)
Primarily for behavior related to
https://github.com/ansible/ansible-modules-core/issues/4780
2016-11-29 14:47:22 -05:00
Brian Coca
ca1514cf2a unified boolean function
optimized boolean function
fixes #17815
2016-11-29 12:34:30 -05:00
John R Barker
4875824357 Network dut (#18668)
* Use dedicated account for testing

This also avoids any instance of "vyos" being masked by no_log

* use vyos-dut-01
2016-11-29 15:12:39 +00:00
John R Barker
54c5ea29bb Update inventory.network (#18654) 2016-11-28 16:33:10 +00:00
John R Barker
0793cf3599 HACK test on older vyos machine (#18653) 2016-11-28 16:24:43 +00:00
John R Barker
09550e4f46 Ops (#18652)
* Link to missing ops.yaml

* Add missing ops.yaml
2016-11-28 16:22:17 +00:00
John R Barker
a51d79c7a9 Tests are required for Network modules (#18618)
* Tests are required for Network modules

Also detail how to get help

* Update README.md

* Update README.md
2016-11-24 18:52:46 +00:00
John R Barker
4c1bb31611 Use DUT instance for veos (#18608) 2016-11-24 12:15:24 +00:00
Matt Clay
089ffae107 Make ansible-pull integration tests more robust. 2016-11-23 17:02:34 -08:00
Matt Clay
3fd13aaffe Detect default group in template integration test. 2016-11-23 11:28:28 -08:00
John R Barker
346aa8f1b2 Use DUT instance for vyos (#18599)
We now have a dedicated test machine, so use that
2016-11-23 15:16:28 +00:00
Adrian Likins
25aa757e80 add a intg test for vault encrypted inventory (#18550) 2016-11-22 10:56:37 -05:00
Matt Clay
324702c38f Use output_dir instead of outputdir for tests. 2016-11-21 16:46:59 -08:00
Sam Doran
f68b49057f Add test cases for VyOS commands that don't honor paging settings (#18553)
* Add test cases for VyOS commands that don't honor paging settings

Testing for issue fixed in PR #18546

* Add provider line and fix indentation

For the way we invoke the tests we need to specify the `provider:` 
Also fix the indentation on `register:`
2016-11-21 15:46:46 +00:00
Toshio Kuratomi
493fb4b665 Test that changing the flags on a mounted filesystem works (#18552)
* Test that changing the flags on a mounted filesystem works
2016-11-19 16:24:16 -08:00
Matt Davis
4dba83afc5 disable win_async_wrapper success loop test to keep CI happy 2016-11-18 11:39:06 -08:00
Matt Clay
4d616366c0 Update test to use keyserver.ubuntu.com. 2016-11-18 10:44:17 -08:00
Matt Davis
602bba4a82 retag win_async_wrapper test to run on module changes 2016-11-18 10:30:25 -08:00
Ganesh Nalawade
f6437f1b6e Fix command typo in integration tests README file (#18539) 2016-11-18 10:50:39 +00:00
James Cammarata
4f06a86161 Alternately track listening handlers by uuid if no name is set
Fixes #17846
2016-11-13 15:24:44 -06:00
Adrien Vergé
0e834fc9e4 Fix cosmetic problems in YAML source
This change corrects problems reported by the `yamllint` linter.

Since key duplication problems were removed in 4d48711, this commit
mainly fixes trailing spaces and extra empty lines at beginning/end of
files.
2016-11-11 14:50:57 -08:00
John R Barker
de13f91a50 Update docker-setup-rht.yml 2016-11-11 19:10:57 +00:00
James Cammarata
bd4f7fca27 Fixing incorrect use of version_compare in docker integration test 2016-11-11 12:18:11 -06:00
Tom Melendez
b9e07c8dd7 [GCE] updates to gce integration test (#18097)
* Added test for sequenced-name instance generation (num_instances)
* Added param-check tags to tests that only do argument checking
Should be merged AFTER ansible/ansible-modules-core#4276
2016-11-11 13:17:47 -05:00
Matt Clay
3f785ee173 Remove unnecessary file. 2016-11-11 00:10:06 -08:00
Matt Clay
c955688772 Move ansible ad-hoc tests to integration targets. 2016-11-10 23:58:32 -08:00
John R Barker
947e0f264e Network Tests - Extend examples (#18451) 2016-11-10 13:41:19 +01:00