Commit graph

5382 commits

Author SHA1 Message Date
Jordan Borean
2f66f26991 ansible-test: setup up http runner in between each target (#47100)
* ansible-test: setup up http runner in between each target

* review changes

(cherry picked from commit 9a5561da0f)
2018-10-16 11:02:06 -07:00
Jordan Borean
67c117607c ansible-test: run win httptester with bypass policy (#47090)
(cherry picked from commit 69e1088ec1)
2018-10-16 11:02:06 -07:00
Jordan Borean
1cf3df53f0 win test: add http tester container to Windows tests (#46606)
(cherry picked from commit 6e2897647c)
2018-10-16 11:02:06 -07:00
Jordan Borean
5dd58923a1 ansible-test: add skip/windows/... alias to skip tests on specific Windows versions (#46845)
* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions

* show what tests were skipped

* changes to logic to only skip if all Windows targets are set to skip

* codestyle improvements

* change warning message based on review

* check args type before running the Windows path

(cherry picked from commit 0f5331645f)
2018-10-16 11:02:06 -07:00
Jordan Borean
615d53ab42 win_uri: use variable for httpbin host (#46734)
(cherry picked from commit f34f75be45)
2018-10-16 11:02:06 -07:00
Matt Clay
a95ba6ca39 Fix ansible-test custom docker image traceback.
(cherry picked from commit 712ad9ed64)
2018-10-11 18:32:58 -07:00
Jordan Borean
7b93d6e31b ansible-test: set ulimit to enforce consistent test environment (#46652)
* ansible-test: set ulimit to enforce consistent test environment

* fixed santiy issue

(cherry picked from commit 7b774117ab)
2018-10-09 23:40:12 -07:00
Jordan Borean
c46d799dc5 ansible-test: Create public key creating Windows targets (#43760)
* ansible-test: Create public key creating Windows targets

* Changed to always set SSH Key for Windows hosts

(cherry picked from commit adc0efe10c)
2018-10-09 18:54:41 -07:00
Matt Clay
503c4b9f97 Fix parametrize warning in unit tests.
(cherry picked from commit 1a28898a00)
2018-10-09 18:54:41 -07:00
Matt Clay
9693c67197 Add symlinks sanity test. (#46467)
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.

(cherry picked from commit e2b6047514)
2018-10-09 18:54:41 -07:00
Matt Clay
c68e1aafeb Improve ansible-test environment checking between tests. (#46459)
* Add unified diff output to environment validation.

This makes it easier to see where the environment changed.

* Compare Python interpreters by version to pip shebangs.

This helps expose cases where pip executables use a different
Python interpreter than is expected.

* Query `pip.__version__` instead of using `pip --version`.

This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.

* Remove redundant environment scan between tests.

This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.

(cherry picked from commit 0dc7f38787)
2018-10-09 18:54:41 -07:00
Matt Clay
d2268dcb37 Add file exists check in integration-aliases test.
(cherry picked from commit 33a8be9109)
2018-10-09 18:54:41 -07:00
Matt Clay
6db2c6d9ac Use default-test-container version 1.3.0.
(cherry picked from commit 6d9be66418)
2018-10-09 18:54:41 -07:00
Matt Clay
3dd444d170 Fix ansible-test encoding issues for exceptions.
(cherry picked from commit 0d7a156319)
2018-10-09 18:54:41 -07:00
Matt Clay
0bd9a73d47 Fix ansible-test multi-group smoke test handling. (#46363)
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.

(cherry picked from commit e53390b3b1)
2018-10-09 18:54:41 -07:00
Matt Clay
70c011481a Rebalance shippable/posix/ CI groups.
(cherry picked from commit 33b34f5c82)
2018-10-09 18:54:41 -07:00
Matt Clay
8d86820308 Reduce noise in docs-build test failures.
(cherry picked from commit 4085d01617)
2018-10-09 18:54:41 -07:00
Matt Clay
116554bee3 Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.

(cherry picked from commit 54937ba784)
2018-10-09 18:54:41 -07:00
Matt Clay
ab2f54d864 Fix integration test library search path.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.

(cherry picked from commit d603cd41fe)
2018-10-09 18:54:41 -07:00
Matt Clay
441dfd4cbe Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.

(cherry picked from commit ac492476e5)
2018-10-09 18:54:41 -07:00
Matt Clay
d779f25fa1 Add python.py coverage injector for ansible-test.
This can be used to run Python scripts from the repository with the
correct interpreter and allow collection of code coverage.

Useful for testing contrib inventory scripts.

(cherry picked from commit 45b5685037)
2018-10-09 18:54:41 -07:00
Matt Clay
f5c9977771 Improve error handling for docs-build test.
(cherry picked from commit 2148999048)
2018-10-09 18:54:41 -07:00
Matt Clay
d2eb4c59d3 Improve ansible-test match error handling.
(cherry picked from commit 2056c981ae)
2018-10-09 18:54:41 -07:00
Dag Wieers
3dbb029f18 Fix incorrect use of subprocess.CalledProcessError (#45890)
(cherry picked from commit 24dd87bd0a)
2018-10-09 18:54:41 -07:00
Matt Clay
2fbee1d183 Support comments in ansible-test flat files.
(cherry picked from commit 5a3000af19)
2018-10-09 18:54:41 -07:00
Matt Clay
30250f34ea Make ansible-test available in the bin directory. (#45876)
(cherry picked from commit f3d1f9544b)
2018-10-09 18:54:41 -07:00
Matt Clay
73cfb88d0f Block network access for unit tests in docker.
(cherry picked from commit 99cac99cbc)
2018-10-09 18:54:41 -07:00
Matt Clay
96ab73a874 Minor fixes for unit test delegation.
(cherry picked from commit be199cfe90)
2018-10-09 18:54:41 -07:00
Matt Clay
6870700a23 Run unit tests in parallel. (#45812)
(cherry picked from commit abe8e4c9e8)
2018-10-09 18:54:41 -07:00
Matt Clay
f46998e0bd Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.

(cherry picked from commit 379a7f4f5a)
2018-10-09 18:54:41 -07:00
Matt Clay
da79fdf998 Fix unit test parametrize order on Python 3.5.
(cherry picked from commit 53b230ca74)
2018-10-09 18:54:41 -07:00
Matt Clay
623cafb709 Fix unit tests which modify the source tree. (#45763)
* Fix CNOS unit test log usage.
* Use temp dir for Galaxy unit tests.
* Write to temp files in interfaces_file unit test.
* Fix log placement in netapp_e_ldap unit test.

(cherry picked from commit 0686450cae)
2018-10-09 18:54:41 -07:00
Jordan Borean
d5a84098a8 add support for opening shell on remote Windows host (#43919)
* add support for opening shell on remote Windows host

* added arg completion and fix sanity check

* remove uneeded arg

(cherry picked from commit 6ca4ea0c1f)
2018-10-09 18:54:41 -07:00
Sloane Hertel
46f189d937 Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.

(cherry picked from commit 18dc928e28)
2018-09-28 08:51:51 -07:00
Daniel Speichert
6e90277c69 [stable-2.6] Migrate from MySQLdb to PyMySQL (#40123)
* Migrate from MySQLdb to PyMySQL

* Deduplicate driver loading and failure message

* Explain requirements

* Apply requirements docs change to proxysql too

* Add changelog.
(cherry picked from commit d34cf93f1a)

Co-authored-by: Daniel Speichert <DSpeichert@users.noreply.github.com>
2018-09-25 16:19:51 -07:00
Matt Martz
e7740b80fd [stable-2.6] [stable-2.7] Fix logic to not re-download existing files when force=no (#45495) (#45509)
* [stable-2.7] Fix logic to not re-download existing files when force=no (#45495)

* Fix logic to not re-download existing files when force=no. Fixes #45491

* Reduce logic complexity.
(cherry picked from commit 5785de582f)

Co-authored-by: Matt Martz <matt@sivel.net>

* Backport of get_url fix cannot use result

result was only added in 2.8+.
(cherry picked from commit 99171a9c6f)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 15:57:46 -07:00
Sloane Hertel
0be82f2b08 [2.6] ec2_group: fix regression for targets that are a list containing strings and lists (#45748)
* Fix targets that may be a list containing strings and lists which worked prior to 2.6.

(cherry picked from commit 450fb9f855ae7090acbdea3e726082d4038994f8)

* Add ec2_group integration tests for lists of nested targets

(cherry picked from commit 14e3399db162c7ddaa9cb9aa6c8a476471a376c2)

* changelog

(cherry picked from commit fb17db0876d75cb629a0ed180ead1058e15a737b)
2018-09-25 15:34:04 -07:00
Sloane Hertel
e889001b3a Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754)
(cherry picked from commit 2167ce6cb6)
2018-09-25 15:27:47 -07:00
Matt Martz
e0e266d070 [stable-2.6] Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231).
(cherry picked from commit 2ac647def8)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:49:52 -07:00
Sloane Hertel
daac0514ef [aws unit test utils] only create a recordings directory when the env var is set (#45752)
* Only create placebo recording test directories when the environment variable PLACEBO_RECORD is set
(cherry picked from commit 5467ac3454)
2018-09-25 14:45:29 -07:00
Nilashish Chakraborty
66de502798 Backport 2.6: Return correct version on installed VyOS (#39115) (#45714)
* Return correct version on installed VyOS (#39115)

* Return correct version on installed VyOS

Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from  "Version:      VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well

* Fixed unittests

(cherry picked from commit 235b11f681)

* Added changelog
2018-09-25 14:37:21 -07:00
Felix Fontein
1a14c50ab7 Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility.

* Adding unit test.

* PEP8.

* Changelog.
2018-09-25 14:34:05 -07:00
Matt Martz
268beeb9f9 [stable-2.6] Support nested JSON decoding in AnsibleJSONDecoder (#45924)
* Support nested JSON decoding in AnsibleJSONDecoder

* Add tests for vault portion of AnsibleJSONDecoder
(cherry picked from commit c0915e2)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:15:44 -07:00
Jordan Borean
cd8208a4aa win_say - fix up syntax and test issues (#45450)
(cherry picked from commit c9c141fb6a)
2018-09-25 14:07:37 -07:00
Jordan Borean
e750df9c8a fix Ansible.ModuleUtils.FileUtil to respect ErrorAction if running in a try/catch (#45451)
(cherry picked from commit d4ce1b9f31)
2018-09-25 14:06:47 -07:00
Jordan Borean
0b39c66db7 powershell: do not quote join_path result to reflect ShellBase join_path (#45944)
(cherry picked from commit 198423d6fb)
2018-09-25 14:04:20 -07:00
Jordan Borean
520a2bf89a reordered windows test groups for better efficiency (#45445)
(cherry picked from commit 25ae4f2b73)
2018-09-25 13:45:39 -07:00
Jordan Borean
1565eabe3e go back to FreeBSD 11.1 for tests due to 11.2 stability issues (#45872)
(cherry picked from commit a7d372c3ba)
2018-09-25 13:44:54 -07:00
Jordan Borean
9b5dd1ead3 append AWS region to test instance file (#45877)
(cherry picked from commit 582a4dfa13)
2018-09-25 13:44:42 -07:00
Jordan Borean
ffe364dd5d add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording

(cherry picked from commit 27c10fa502)
2018-09-25 13:44:26 -07:00