Commit graph

309 commits

Author SHA1 Message Date
Matt Clay
8066acc90c
Support skip of platforms by version in tests. (#48826)
* Support skip of platforms by version in tests.

Previously a remote platform could be skipped completely using the alias:

`skip/{platform}` such as `skip/rhel`

Now a specific platform version can be skipped using the alias:

`skip/{platform}{version}` such as `skip/rhel7.6`

This feature is available for platforms specified with the `--remote` option.

* Add skip by version to the docs.
2018-11-16 16:38:47 -08:00
Will Thames
aaf29c785f Provide Kubernetes resource validation to k8s module (#43352)
* Provide Kubernetes resource validation to k8s module

Use kubernetes-validate to validate Kubernetes resource
definitions against the published schema

* Additional tests for kubernetes-validate

* Improve k8s error messages on exceptions

Parse the response body for the message rather than returning
a JSON blob

If we've validated and there are warnings, return those too - they
can be more helpful

```
"msg": "Failed to patch object: {\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},
       \"status\":\"Failure\",\"message\":\"[pos 334]: json: decNum: got first char 'h'\",\"code\":500}\n",
```
vs
```
"msg": "Failed to patch object: [pos 334]: json: decNum: got first char 'h'\nresource
        validation error at spec.replicas: 'hello' is not of type u'integer'",
```

* Update versions used

In particular openshift/origin:3.9.0

* Add changelog for k8s validate change
2018-11-16 12:44:59 +00:00
Matt Clay
fa53b4805b Fix ansible-test interpreter tracking.
Track the interpreter for each copy of the injector by the interpreter
path instead of the interpreter version. This avoids the possibility
of mixing different interpreters with the same version.
2018-11-14 13:58:03 -08:00
Matt Clay
aa7fe919d3 Fix ansible-test merge change detection. 2018-11-14 12:27:40 -08:00
Matt Clay
d6bf45cd9d Correct ansible-test injector python behavior.
Inject a symlink to the correct python into the copied injector
directory instead of altering the shebang of the injector. This
has the side-effect of also intercepting `python` for integration
tests which simplifies cases where it needs to be directly invoked
without collecting code coverage.
2018-11-14 12:17:09 -08:00
Matt Clay
eec21a3d12 Use correct interpreter for ansible-test injector. 2018-11-13 22:50:34 -08:00
Matt Clay
c25db4ee8d Add change classification for powershell wrappers. 2018-11-13 22:47:06 -08:00
Deric Crago
7f3c21f628 bump version of 'vcenter-test-container' to '1.4.0' (govmomi v0.19.0) 2018-11-05 11:57:15 -08:00
Felix Fontein
92d9569bc9 ACME: add support for POST-as-GET if GET fails with 405. (#44988)
* Add support for POST-as-GET if GET fails with 405.

* Bumping ACME test container version to 1.4. This includes letsencrypt/pebble#162 and letsencrypt/pebble#168.

* Also use POST-as-GET for account data retrival.

This is not yet supported by any ACME server (see letsencrypt/pebble#171),
so we fall back to a regular empty update if a 'malformedRequest' error is
returned.

* Using newest ACME test container image.

Includes letsencrypt/pebble#171 and letsencrypt/pebble#172, which make Pebble behave closer to the current specs.

* Remove workaround for old Pebble version.

* Add changelog entry.

* First try POST-as-GET, then fall back to unauthenticated GET.
2018-10-29 10:32:53 +01:00
Paul Belanger
e844bfe1d4 Force PEM SSH keys for paramiko
Trying to get ansible-test working on my fedora-28 system, I noticed I
was getting invalid keys from paramiko. It looks like this is because
ssh-keygen is now defaulting to RFC4716 format for private / public
keys.

For now, we can still use PEM based SSH keys, but the long term fix here
is to report a bug to paramiko and support RFC4716 for rsa keys.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-10-18 21:25:55 -07:00
Jordan Borean
9a5561da0f
ansible-test: setup up http runner in between each target (#47100)
* ansible-test: setup up http runner in between each target

* review changes
2018-10-16 18:09:17 +10:00
Jordan Borean
69e1088ec1
ansible-test: run win httptester with bypass policy (#47090) 2018-10-16 08:07:02 +10:00
Matt Clay
38eba60849 Fix ansible-test --exclude with delegation.
Previously the option worked with integration commands but not units or sanity.
2018-10-15 14:05:37 -07:00
Matt Clay
76bf861308
Upgrade pylint to version 2.1.1. (#47036)
* Fix issues reported by the latest pylint.
* Split pylint runs into more contexts.
* Upgrade pylint.
2018-10-14 22:59:52 -07:00
jctanner
0b15ad00c1
Add a test target for the foreman inventory script (#46837)
Add a test target for the foreman inventory script
2018-10-14 20:51:25 -04:00
Matt Clay
3033fd96b0
Move unit test compat code out of lib/ansible/. (#46996)
* Move ansible.compat.tests to test/units/compat/.
* Fix unit test references to ansible.compat.tests.
* Move builtins compat to separate file.
* Fix classification of test/units/compat/ dir.
2018-10-12 20:01:14 -07:00
Jordan Borean
6e2897647c
win test: add http tester container to Windows tests (#46606) 2018-10-13 08:20:00 +10:00
Jordan Borean
0f5331645f
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
2018-10-12 15:32:46 +10:00
Matt Clay
ec88510fd4 Add OUTPUT_DIR env var to integration tests. 2018-10-11 20:34:12 -07:00
Matt Clay
712ad9ed64 Fix ansible-test custom docker image traceback. 2018-10-11 10:49:38 -07:00
Jordan Borean
7b774117ab
ansible-test: set ulimit to enforce consistent test environment (#46652)
* ansible-test: set ulimit to enforce consistent test environment

* fixed santiy issue
2018-10-09 12:18:49 +10:00
Matt Clay
e2b6047514
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.
2018-10-04 07:02:42 -07:00
Matt Clay
0dc7f38787
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.
2018-10-03 21:41:27 -07:00
Matt Clay
33a8be9109 Add file exists check in integration-aliases test. 2018-10-03 15:40:30 -07:00
Jordan Borean
e972287c35 win_exec: refactor PS exec runner (#45334)
* win_exec: refactor PS exec runner

* more changes for PSCore compatibility

* made some changes based on the recent review

* split up module exec scripts for smaller payload

* removed C# module support to focus on just error msg improvement

* cleaned up c# test classifier code
2018-10-02 15:55:53 -07:00
Matt Clay
0d7a156319 Fix ansible-test encoding issues for exceptions. 2018-10-02 13:36:43 -07:00
Matt Clay
e53390b3b1
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.
2018-10-02 12:26:14 -07:00
Matt Clay
54937ba784 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.
2018-09-21 20:11:38 -07:00
Matt Clay
d603cd41fe 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.
2018-09-21 13:53:09 -07:00
Matt Clay
ac492476e5
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.
2018-09-21 11:38:22 -07:00
Matt Clay
2056c981ae Improve ansible-test match error handling. 2018-09-21 00:05:33 -07:00
Jordan Borean
27c10fa502
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
2018-09-21 16:09:54 +10:00
Matt Clay
5a3000af19 Support comments in ansible-test flat files. 2018-09-20 00:48:00 -07:00
Matt Clay
f3d1f9544b
Make ansible-test available in the bin directory. (#45876) 2018-09-19 17:58:55 -07:00
Jordan Borean
582a4dfa13
append AWS region to test instance file (#45877) 2018-09-20 10:56:56 +10:00
Matt Clay
99cac99cbc Block network access for unit tests in docker. 2018-09-18 17:53:04 -07:00
Matt Clay
be199cfe90 Minor fixes for unit test delegation. 2018-09-18 16:12:15 -07:00
Matt Clay
abe8e4c9e8
Run unit tests in parallel. (#45812) 2018-09-18 13:58:22 -07:00
Matt Clay
379a7f4f5a
Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
2018-09-18 08:37:14 -07:00
Matt Clay
4173a30941 Remove obsolete default container. 2018-09-05 15:29:00 -07:00
Matt Clay
998badbda5 Fix ansible-test virtualenv use in import test. 2018-09-04 10:07:48 -07:00
Matt Clay
c1173a2aec Add seccomp support to ansible-test. 2018-08-30 16:38:31 -07:00
Matt Clay
773c0982b0 Switch distro test containers to quay.io images. 2018-08-29 15:52:58 -07:00
René Moser
56996c7348
test: cloudstack-test-container v1.2.0 (#44764) 2018-08-28 16:49:34 +02:00
Matt Clay
c0aaf0fff7 Fix change detection on retried Shippable jobs. 2018-08-27 20:57:09 -07:00
Sumit Jaiswal
1d2bb34992
Includes support for Reverse-Mapping zone in nios_zone module (#44525)
* support reverse mapping

* support reverse mapping

* support reverse mapping

* fix shippable errors

* fix shippable errors

* fix shippable errors
2018-08-23 03:07:30 +00:00
Felix Fontein
ad0d10db0d ACME: improve tests (new Pebble version, strict mode) (#44518)
* Bump ACME test container version.

* Re-adding key rollover test.
2018-08-22 22:15:35 +02:00
Jordan Borean
6982dfc756 psrp: Added new Windows connection plugin (#41729)
* psrp: Added new Windows connection plugin

* Tweaks to connection options from review
2018-08-21 16:43:13 -07:00
Felix Fontein
d8d366ef37 ACME: using new acme-test-container (#44095)
* Using new acme-test-container image.

* Add test for cleaning account contacts.
2018-08-14 07:35:15 -07:00
Matt Clay
56cc681d8c
Classify inventory plugins. (#44091)
* Classify inventory plugins.
* Rename inventory integration test targets.
2018-08-13 12:26:37 -07:00