1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets
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
..
add_host Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
ansible Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
apache2_module Test apache2 force (#18500) 2016-12-12 14:19:47 -08:00
apt Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
apt_repository Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
args Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
asa_acl Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
asa_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
asa_config Check for removal not allowed errors (#19251) 2017-01-25 13:05:44 +00:00
assemble Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
async Fix infrequent PEP 8 issues. 2017-01-27 14:06:21 -08:00
async_extra_data Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
authorized_key authorized_key: support --diff (#19277) 2017-01-03 09:32:32 -05:00
become Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
binary Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
binary_modules Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
binary_modules_posix Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
binary_modules_winrm Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
blocks Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
changed_when Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
check_mode Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
cloudscale_server new module cloudscale_server (#20175) 2017-01-17 23:15:20 +01:00
command_shell Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
conditionals Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection Split integration tests out from Makefile. (#17976) 2016-10-12 14:57:53 -07:00
connection_chroot Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_docker Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_jail Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_libvirt_lxc Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_local Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_lxc Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_lxd Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_paramiko_ssh Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
connection_posix Split integration tests out from Makefile. (#17976) 2016-10-12 14:57:53 -07:00
connection_ssh Add pipeline-ish method using dd for file transfer over SSH (#18642) 2017-01-19 12:31:14 -05:00
connection_winrm Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
copy Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
delegate_to Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
dellos6_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dellos6_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
dellos6_facts Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dellos9_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dellos9_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
dellos9_facts Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dellos10_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dellos10_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
dellos10_facts Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
dnf Installroot OS version check fix (#20180) 2017-01-12 18:02:35 -08:00
docker Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
embedded_module Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
environment Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
eos_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
eos_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
eos_eapi Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
eos_facts Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
eos_template Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
facts_d Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
failed_when Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
fetch Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
file Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
filters Use jinja2 import instead of pip to get version. 2017-01-19 11:06:47 -08:00
gathering_facts Fix and enable more tests for osx and freebsd. (#20482) 2017-01-19 17:10:33 -08:00
gem Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
get_url Fix and enable more tests for osx and freebsd. (#20482) 2017-01-19 17:10:33 -08:00
git Only set git config during test if unset. 2017-01-25 18:05:17 -08:00
group_by Fix group_by test to work with jinja2 >= 2.9. 2017-01-09 15:20:34 -08:00
groupby_filter Improve jinja2 test coverage. (#20533) 2017-01-20 16:38:52 -08:00
handlers tests: add handler listen test cases 2017-01-03 15:00:00 -08:00
hash Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
hg Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
hosts_field Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
ignore_errors Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
include_vars Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
includes Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
ios_command Enable more ios tests on Shippable. 2017-01-20 13:26:59 -08:00
ios_config Enable more ios tests on Shippable. 2017-01-20 13:26:59 -08:00
ios_facts iosxr tests: Initial work for 2.3 (#20883) 2017-01-31 19:10:14 +00:00
ios_template Enable more ios tests on Shippable. 2017-01-20 13:26:59 -08:00
iosxr_command iosxr tests: Initial work for 2.3 (#20883) 2017-01-31 19:10:14 +00:00
iosxr_config iosxr tests: Initial work for 2.3 (#20883) 2017-01-31 19:10:14 +00:00
iosxr_facts iosxr tests: Initial work for 2.3 (#20883) 2017-01-31 19:10:14 +00:00
iosxr_template Set block indentation to 1 on iosxr templates (#21105) 2017-02-07 21:13:20 +01:00
iterators Fix and enable more tests for osx and freebsd. (#20482) 2017-01-19 17:10:33 -08:00
junos_command junos Use inventory_hostname_short (#20061) 2017-01-09 20:15:16 +00:00
junos_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
junos_netconf Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
junos_template Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
known_hosts known_hosts: support --diff (#20349) 2017-02-08 09:56:03 -05:00
lineinfile Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
locale_gen Fix locale_gen to compare native strings rather than mixing byte and text strings 2017-01-04 10:11:33 -08:00
lookup_paths Fix regression in search path behaviour 2016-12-14 10:33:14 -05:00
lookup_properties Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
lookups Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
loops Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
module_utils Module utils default path (#20913) 2017-02-02 17:48:53 -08:00
mount Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
mysql_db Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
mysql_user Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
mysql_variables Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
net_command WIP: net_command: Initial tests for VyOS (#20147) 2017-01-17 11:06:34 +00:00
no_log Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
nxos_command Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
nxos_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
nxos_facts Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
nxos_nxapi Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
nxos_template Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
ops_command Make tests run on fresh install (#19566) 2017-01-03 10:53:16 -05:00
parsing Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
ping Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
pip Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
postgresql Run postgresql tests on FreeBSD. (#20676) 2017-01-25 18:45:28 -08:00
prepare_eos_tests/tasks Migrate Network Tests into ansible/ansible (#18233) 2016-10-28 19:50:29 +01:00
prepare_http_tests Fix and enable more tests for osx and freebsd. (#20482) 2017-01-19 17:10:33 -08:00
prepare_ios_tests integration/targets/ios_* work to support IOS (#20414) 2017-01-20 20:18:12 +00:00
prepare_iosxr_tests iosxr tests: Initial work for 2.3 (#20883) 2017-01-31 19:10:14 +00:00
prepare_nxos_tests/tasks Migrate Network Tests into ansible/ansible (#18233) 2016-10-28 19:50:29 +01:00
prepare_tests/tasks Migrate Linux CI roles to test targets. (#17997) 2016-10-13 09:09:25 -07:00
prepare_win_tests Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
pull_limit_inventory Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
pull_no_127 Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
pull_run Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
script Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
sefcontext Added tests for sefcontext module 2016-12-22 13:29:13 -08:00
service Run service test on py3 + unprivileged on docker. (#19841) 2017-01-04 15:55:57 -08:00
setup_mysql_db Fix cosmetic problems in YAML source 2016-11-11 14:50:57 -08:00
setup_postgresql_db Run postgresql tests on FreeBSD. (#20676) 2017-01-25 18:45:28 -08:00
special_vars Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
stat Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
subversion Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
synchronize Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
tags Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
task_ordering Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
template Improve jinja2 test coverage. (#20533) 2017-01-20 16:38:52 -08:00
template_jinja2_latest Improve jinja2 test coverage. (#20533) 2017-01-20 16:38:52 -08:00
templating_settings Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
test_infra Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
unarchive Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
unicode Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
until Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
uri Increase timeout for http server in uri test. 2017-01-24 14:20:19 -08:00
var_blending Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
var_precedence Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
vault added docs for vault and made trigger shorter: !vault (#20985) 2017-02-03 15:28:50 -05:00
vyos_command vyos: Don't run show commands that are over ANSIBLE_VYOS_TERMINAL_LENGTH (#18682) 2016-11-30 17:08:52 +00:00
vyos_config Use inventory_hostname_short (#20054) 2017-01-09 17:21:04 +00:00
win_async_wrapper refactoring async 2017-02-06 19:32:00 -05:00
win_command Fix broken Shippable 2017-01-31 16:47:16 -08:00
win_copy Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_feature Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_fetch Remove win_fetch from CI due to instability. 2017-01-24 17:33:11 -08:00
win_file Fix 'touch' mode so it creates zero size files. (#20876) 2017-02-03 13:36:47 +01:00
win_get_url Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_group Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_lineinfile Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_msi Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_package Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_path new module: win_path (#20073) 2017-01-17 20:21:04 -08:00
win_ping Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_raw Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_regedit Fix the integration test to comply recent changes 2017-01-26 20:06:46 +01:00
win_regmerge minor spelling changes 2016-12-13 13:51:13 -05:00
win_script Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_service Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_setup Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_shell Fix broken Shippable 2017-01-31 16:47:16 -08:00
win_shortcut win_shortcut: Add missing $check_mode definition + bugfix + tests (#20911) 2017-02-02 10:29:56 +01:00
win_slurp Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_stat Fix win_stat test for changes from PR #20876 2017-02-03 12:58:11 -08:00
win_template Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
win_user Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
yum Installroot OS version check fix (#20180) 2017-01-12 18:02:35 -08:00
zypper Zypper: Fix update_cache in checkmode (#20143) 2017-01-11 18:47:16 +00:00
zypper_repository Add test for auto_import_keys in zypper_repository (#17898) 2016-12-09 09:47:56 -05:00