Commit graph

35 commits

Author SHA1 Message Date
Marius Gedminas
2efb692cc4 known_hosts: support --diff (#20349)
* known_hosts: support --diff

* known_hosts: support --diff also without --check

* Add unit tests and fix incorrect diff in one corner case

Tests are good!

* Refactor for readability

* Python 3 compat

* More Python 3 compat

* Add an integration test for known_hosts

* Handle ssh-keygen -HF returning non-zero exit code

AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1.  This is because in ssh-keygen.c there's a function
do_known_hosts() which calls

  exit (find_host && !ctx.found_key);

at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0.  Why is found_key always 0?  Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.

* This test does not need root

* Avoid ssh-ed25519 keys in sample known_hosts file

Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:

  line 5 invalid key: example.net...
  /root/ansible_testing/known_hosts is not a valid known_hosts file.

* Fix Python 3 errors

Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
2017-02-08 09:56:03 -05:00
Dag Wieers
438cd6687f Added tests for sefcontext module 2016-12-22 13:29:13 -08:00
Matt Clay
75e4645ee7 Migrate Linux CI roles to test targets. (#17997) 2016-10-13 09:09:25 -07:00
Matt Clay
374e4348e4 Split out var_blending test into targets dir. (#17996) 2016-10-12 22:22:46 -07:00
Matt Clay
80a5c70ad7 Split integration tests out from Makefile. (#17976) 2016-10-12 14:57:53 -07:00
Adrian Likins
1f03801fcc mv test_git to 'destructive' integration tests (#17526)
The test_git role removes ~/.ssh/known_hosts currently
and that is destructive.
2016-09-29 13:46:34 -04:00
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
2016-09-28 10:52:33 -07:00
Toshio Kuratomi
1f311f0739 Disable mount tests for now. Mount is buggy on too many platforms 2016-09-23 16:35:34 -07:00
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
2016-09-23 12:38:31 -07:00
Michael Scherer
e9ffe2062f Add test for the pause in loop feature (#17336)
See https://github.com/ansible/ansible/pull/17289
2016-09-13 11:12:58 -07:00
Matt Davis
746ea64d30 fix for unspecified retries on until + test (#16963)
fixes #16907
2016-08-04 19:20:45 -04:00
Matt Clay
0ada7eae5e Add test tags for shell and command modules. 2016-07-08 17:41:58 -07:00
Matt Clay
9a6b8ab271 Add more tags to test_async role. 2016-07-07 10:38:41 -07:00
nitzmahone
1f92ade584 add integration test to assert included tasks run in proper order 2016-06-23 17:53:08 -07:00
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
2016-05-10 23:43:07 -04:00
Toshio Kuratomi
85bef402b1 Merge pull request #14614 from gundalow/test_binary
non-destructive says we should run test_binary at v2
2016-04-25 09:45:00 -07:00
Matt Martz
6e9c09d7f7 Utilize urllib3.contrib.pyopenssl functionality for SNI capability in python versions lacking SNI support
Also add SNI tests, move test_uri to destructive since we are messing with packages for SNI testing
2016-04-06 10:14:13 -05:00
John Barker
4fb1839ebe non-destructive says we should run test_binary at v2
We are now using Ansible v2 and these tests pass, so run them.
2016-02-22 21:58:43 +00:00
nitzmahone
349e072a74 fix for dynamic (add_host) hosts not available in hostvars
Looks like there are two pattern caches that need to be cleared for this to work- added the second one.
Added integration tests for add_host to prevent future regressions.
2015-11-16 10:53:10 -08:00
James Cammarata
b520d5bc60 Lots of fixes for integration test bugs 2015-07-10 01:53:59 -04:00
Brian Coca
48827a31bc added minimal testing for special template vars 2015-07-07 20:11:55 -04:00
Toshio Kuratomi
0f9ad9dad2 Update integration tests from @darkk to work with the current uri module code 2015-05-14 14:21:29 -07:00
Toshio Kuratomi
37d1b3f1cf New test that binary contenti.
(and a few unicode tests because they make clearer what we're testing)
works.  disabled for now since they mostly do not pass on 1.8.  We'll
want to enable them when we start integration testing the v2 tree.
2014-12-10 11:37:32 -08:00
James Cammarata
05644686de Fix bug in plugin path caching
Fixes #9263
2014-10-04 21:47:38 -05:00
James Cammarata
cd99821f8a Fix py26 difference in ssl socket connect call from 99ba9d6 2014-09-03 10:04:02 -05:00
James Cammarata
684d46b170 Fixing some parsing issues in authorized_key module
Also adds an integration test for authorized_key for future validation.

Fixes #6700
2014-04-02 15:02:54 -05:00
James Cammarata
f03d6a67c8 Adding new tests for assemble role 2014-02-24 14:27:23 -06:00
Richard C Isaacson
dcbc69b69c Added script to the new integration tests. 2014-02-24 10:57:22 -06:00
Richard C Isaacson
e2a47162d0 Added test for failed_when to non_destructive integration tests. 2014-02-24 09:40:44 -06:00
Richard C Isaacson
0c33e936d4 Adding tests for the command and shell modules. 2014-02-23 14:51:26 -06:00
James Tanner
d29da4cba1 Add iterator tests 2014-02-21 14:26:38 -05:00
James Tanner
65e58c21dd Add test for basic lookups 2014-02-21 11:34:06 -05:00
James Tanner
799fe2c289 Add handlers test 2014-02-21 10:28:27 -05:00
James Tanner
d07032fa5a Add async test role 2014-02-21 10:00:01 -05:00
Michael DeHaan
2177b773c8 Rename tests to test, use old directory name. 2014-02-20 19:11:15 -05:00
Renamed from tests/integration/non_destructive.yml (Browse further)