From 3c58215a91769362cc49f9f53a7acb0eaed7b904 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 2 Nov 2021 20:07:28 +0000 Subject: [PATCH 01/44] tests: Tag Ansible tests This makes it easier to run subsets using ANSIBLE_RUN_TAGS=... --- tests/ansible/all.yml | 4 +++- tests/ansible/integration/action/copy.yml | 2 ++ .../integration/action/fixup_perms2__copy.yml | 2 ++ .../action/low_level_execute_command.yml | 2 ++ .../integration/action/make_tmp_path.yml | 2 ++ .../action/make_tmp_path__double.yml | 2 ++ .../integration/action/remote_expand_user.yml | 2 ++ .../integration/action/remote_file_exists.yml | 3 ++- .../integration/action/remove_tmp_path.yml | 2 ++ .../integration/action/synchronize.yml | 2 ++ .../integration/action/transfer_data.yml | 2 ++ tests/ansible/integration/all.yml | 18 +++++++++++++++++ .../integration/async/multiple_items_loop.yml | 2 ++ .../async/result_binary_producing_json.yml | 2 ++ .../async/result_binary_producing_junk.yml | 2 ++ .../async/result_shell_echo_hi.yml | 2 ++ .../integration/async/runner_new_process.yml | 2 ++ .../integration/async/runner_one_job.yml | 2 ++ .../async/runner_timeout_then_polling.yml | 2 ++ .../async/runner_two_simultaneous_jobs.yml | 2 ++ .../async/runner_with_polling_and_timeout.yml | 3 ++- .../integration/become/su_password.yml | 3 +++ .../integration/become/sudo_flags_failure.yml | 3 +++ .../integration/become/sudo_nonexistent.yml | 3 +++ .../integration/become/sudo_nopassword.yml | 5 ++++- .../integration/become/sudo_password.yml | 3 +++ .../integration/become/sudo_requiretty.yml | 3 +++ .../connection/become_same_user.yml | 2 ++ .../connection/disconnect_during_module.yml | 3 +++ .../disconnect_resets_connection.yml | 3 +++ .../integration/connection/exec_command.yml | 2 ++ .../integration/connection/home_dir.yml | 2 ++ .../integration/connection/put_large_file.yml | 3 +++ .../integration/connection/put_small_file.yml | 3 +++ .../ansible/integration/connection/reset.yml | 2 ++ .../integration/connection/reset_become.yml | 2 ++ .../delegate_to_template.yml | 2 ++ .../connection_delegation/local_action.yml | 2 ++ .../osa_container_standalone.yml | 3 +++ .../osa_delegate_to_self.yml | 3 +++ .../stack_construction.yml | 20 +++++++++++++++++++ .../connection_loader/local_blemished.yml | 3 +++ .../paramiko_unblemished.yml | 3 +++ .../connection_loader/ssh_blemished.yml | 3 +++ .../context_service/disconnect_cleanup.yml | 2 ++ .../context_service/lru_one_target.yml | 2 ++ .../context_service/reconnection.yml | 2 ++ .../context_service/remote_name.yml | 3 ++- .../integration/glibc_caches/resolv_conf.yml | 2 ++ .../ansible_2_8_tests.yml | 2 ++ .../interpreter_discovery/complex_args.yml | 2 ++ .../integration/local/cwd_preserved.yml | 3 ++- .../integration/local/env_preserved.yml | 2 ++ .../module_utils/adjacent_to_playbook.yml | 3 ++- .../module_utils/adjacent_to_role.yml | 2 ++ .../module_utils/from_config_path.yml | 3 ++- .../module_utils/from_config_path_pkg.yml | 3 ++- .../module_utils/overrides_builtin.yml | 2 ++ .../playbook_semantics/become_flags.yml | 4 ++++ .../playbook_semantics/delegate_to.yml | 2 ++ .../playbook_semantics/environment.yml | 2 ++ .../playbook_semantics/with_items.yml | 2 ++ .../process/unix_socket_cleanup.yml | 2 ++ tests/ansible/integration/runner/atexit.yml | 2 ++ .../runner/builtin_command_module.yml | 2 ++ .../runner/crashy_new_style_module.yml | 2 ++ .../runner/custom_bash_hashbang_argument.yml | 2 ++ .../runner/custom_bash_old_style_module.yml | 2 ++ .../runner/custom_bash_want_json_module.yml | 2 ++ .../runner/custom_binary_producing_json.yml | 2 ++ .../runner/custom_binary_producing_junk.yml | 4 ++++ .../runner/custom_binary_single_null.yml | 5 ++++- .../runner/custom_perl_json_args_module.yml | 2 ++ .../runner/custom_perl_want_json_module.yml | 2 ++ .../runner/custom_python_json_args_module.yml | 2 ++ ...m_python_new_style_missing_interpreter.yml | 2 ++ .../runner/custom_python_new_style_module.yml | 2 ++ .../custom_python_prehistoric_module.yml | 2 ++ .../runner/custom_python_want_json_module.yml | 2 ++ .../runner/custom_script_interpreter.yml | 3 ++- .../runner/environment_isolation.yml | 3 ++- .../integration/runner/etc_environment.yml | 2 ++ .../integration/runner/forking_active.yml | 2 ++ .../runner/forking_correct_parent.yml | 3 +++ .../integration/runner/forking_inactive.yml | 3 ++- .../integration/runner/missing_module.yml | 3 +++ tests/ansible/integration/ssh/config.yml | 2 ++ tests/ansible/integration/ssh/timeouts.yml | 2 ++ .../strategy/_mixed_mitogen_vanilla.yml | 8 ++++++-- .../strategy/_mixed_vanilla_mitogen.yml | 7 ++++++- .../strategy/mixed_vanilla_mitogen.yml | 2 ++ .../integration/stub_connections/kubectl.yml | 2 ++ .../integration/stub_connections/lxc.yml | 2 ++ .../integration/stub_connections/lxd.yml | 2 ++ .../stub_connections/mitogen_doas.yml | 2 ++ .../stub_connections/mitogen_sudo.yml | 2 ++ .../stub_connections/setns_lxc.yml | 2 ++ .../stub_connections/setns_lxd.yml | 2 ++ tests/ansible/integration/transport/all.yml | 2 ++ tests/ansible/regression/all.yml | 15 ++++++++++++++ ..._109__target_has_old_ansible_installed.yml | 2 ++ .../issue_113__duplicate_module_imports.yml | 2 ++ .../issue_118__script_not_marked_exec.yml | 2 ++ .../issue_122__environment_difference.yml | 2 ++ .../regression/issue_140__thread_pileup.yml | 1 + ...ue_152__local_action_wrong_interpreter.yml | 2 ++ .../issue_152__virtualenv_python_fails.yml | 2 ++ .../issue_154__module_state_leaks.yml | 2 ++ .../issue_177__copy_module_failing.yml | 2 ++ ...32_ansiblemoduleerror_first_occurrence.yml | 2 ++ .../regression/issue_558_unarchive_failed.yml | 2 ++ .../issue_590__sys_modules_crap.yml | 2 ++ .../issue_591__setuptools_cwd_crash.yml | 2 ++ .../issue_615__streaming_transfer.yml | 2 ++ .../issue_655__wait_for_connection_error.yml | 2 ++ 115 files changed, 309 insertions(+), 16 deletions(-) diff --git a/tests/ansible/all.yml b/tests/ansible/all.yml index 06f3acdb..e8bf26f2 100644 --- a/tests/ansible/all.yml +++ b/tests/ansible/all.yml @@ -1,4 +1,6 @@ - include: setup/all.yml + tags: setup - include: regression/all.yml + tags: regression - include: integration/all.yml - + tags: integration diff --git a/tests/ansible/integration/action/copy.yml b/tests/ansible/integration/action/copy.yml index 1cab2b34..611ff3f2 100644 --- a/tests/ansible/integration/action/copy.yml +++ b/tests/ansible/integration/action/copy.yml @@ -82,3 +82,5 @@ - /tmp/copy-large-inline-file.out # end of cleaning out files (again) + tags: + - copy diff --git a/tests/ansible/integration/action/fixup_perms2__copy.yml b/tests/ansible/integration/action/fixup_perms2__copy.yml index e5b10005..1ba19e6f 100644 --- a/tests/ansible/integration/action/fixup_perms2__copy.yml +++ b/tests/ansible/integration/action/fixup_perms2__copy.yml @@ -114,3 +114,5 @@ - /tmp/copy-with-mode.out # end of cleaning out files + tags: + - fixup_perms2__copy diff --git a/tests/ansible/integration/action/low_level_execute_command.yml b/tests/ansible/integration/action/low_level_execute_command.yml index 7dc74473..7f91bdf8 100644 --- a/tests/ansible/integration/action/low_level_execute_command.yml +++ b/tests/ansible/integration/action/low_level_execute_command.yml @@ -41,3 +41,5 @@ ["root"], ) fail_msg: raw={{raw}} + tags: + - low_level_execute_command diff --git a/tests/ansible/integration/action/make_tmp_path.yml b/tests/ansible/integration/action/make_tmp_path.yml index ab2db0fb..bfebeffd 100644 --- a/tests/ansible/integration/action/make_tmp_path.yml +++ b/tests/ansible/integration/action/make_tmp_path.yml @@ -160,3 +160,5 @@ - out.module_path.startswith(good_temp_path2) - out.module_tmpdir.startswith(good_temp_path2) fail_msg: out={{out}} + tags: + - make_tmp_path diff --git a/tests/ansible/integration/action/make_tmp_path__double.yml b/tests/ansible/integration/action/make_tmp_path__double.yml index 8b24d322..811e159d 100644 --- a/tests/ansible/integration/action/make_tmp_path__double.yml +++ b/tests/ansible/integration/action/make_tmp_path__double.yml @@ -18,3 +18,5 @@ script: | assert not self._remote_file_exists("{{ out.t1 }}") assert not self._remote_file_exists("{{ out.t2 }}") + tags: + - make_tmp_path_double diff --git a/tests/ansible/integration/action/remote_expand_user.yml b/tests/ansible/integration/action/remote_expand_user.yml index 851da502..8e31f657 100644 --- a/tests/ansible/integration/action/remote_expand_user.yml +++ b/tests/ansible/integration/action/remote_expand_user.yml @@ -110,3 +110,5 @@ - assert: that: out.result == '$HOME/foo' fail_msg: out={{out}} + tags: + - remote_expand_user diff --git a/tests/ansible/integration/action/remote_file_exists.yml b/tests/ansible/integration/action/remote_file_exists.yml index 209f7830..2d206930 100644 --- a/tests/ansible/integration/action/remote_file_exists.yml +++ b/tests/ansible/integration/action/remote_file_exists.yml @@ -35,4 +35,5 @@ - file: path: /tmp/does-exist state: absent - + tags: + - remote_file_exists diff --git a/tests/ansible/integration/action/remove_tmp_path.yml b/tests/ansible/integration/action/remove_tmp_path.yml index 19d18e34..19ae22e3 100644 --- a/tests/ansible/integration/action/remove_tmp_path.yml +++ b/tests/ansible/integration/action/remove_tmp_path.yml @@ -37,3 +37,5 @@ - file: path: /tmp/remove_tmp_path_test state: absent + tags: + - remove_tmp_path diff --git a/tests/ansible/integration/action/synchronize.yml b/tests/ansible/integration/action/synchronize.yml index 64ff9735..a6cd277e 100644 --- a/tests/ansible/integration/action/synchronize.yml +++ b/tests/ansible/integration/action/synchronize.yml @@ -72,3 +72,5 @@ # - /tmp/synchronize-action-key # - /tmp/sync-test # - /tmp/sync-test.out + tags: + - synchronize diff --git a/tests/ansible/integration/action/transfer_data.yml b/tests/ansible/integration/action/transfer_data.yml index 0f56672c..e0f42d0e 100644 --- a/tests/ansible/integration/action/transfer_data.yml +++ b/tests/ansible/integration/action/transfer_data.yml @@ -46,3 +46,5 @@ - file: path: /tmp/transfer-data state: absent + tags: + - transfer_data diff --git a/tests/ansible/integration/all.yml b/tests/ansible/integration/all.yml index 8c059fc4..6bd5059a 100644 --- a/tests/ansible/integration/all.yml +++ b/tests/ansible/integration/all.yml @@ -4,20 +4,38 @@ # - include: action/all.yml + tags: action - include: async/all.yml + tags: async - include: become/all.yml + tags: become - include: connection/all.yml + tags: connection - include: connection_delegation/all.yml + tags: connection_delegation - include: connection_loader/all.yml + tags: connection_loader - include: context_service/all.yml + tags: context_service - include: glibc_caches/all.yml + tags: glibc_caches - include: interpreter_discovery/all.yml + tags: interpreter_discovery - include: local/all.yml + tags: local - include: module_utils/all.yml + tags: module_utils - include: playbook_semantics/all.yml + tags: playbook_semantics - include: process/all.yml + tags: process - include: runner/all.yml + tags: runner - include: ssh/all.yml + tags: ssh - include: strategy/all.yml + tags: strategy - include: stub_connections/all.yml + tags: stub_connections - include: transport_config/all.yml + tags: transport_config diff --git a/tests/ansible/integration/async/multiple_items_loop.yml b/tests/ansible/integration/async/multiple_items_loop.yml index 05db9652..24d43083 100644 --- a/tests/ansible/integration/async/multiple_items_loop.yml +++ b/tests/ansible/integration/async/multiple_items_loop.yml @@ -35,3 +35,5 @@ - out.results[1].rc == 0 - out.results[1].delta > '0:00:05' fail_msg: out={{out}} + tags: + - multiple_items_loop diff --git a/tests/ansible/integration/async/result_binary_producing_json.yml b/tests/ansible/integration/async/result_binary_producing_json.yml index 427fa58b..b05b24bf 100644 --- a/tests/ansible/integration/async/result_binary_producing_json.yml +++ b/tests/ansible/integration/async/result_binary_producing_json.yml @@ -55,3 +55,5 @@ fail_msg: async_out={{async_out}} vars: async_out: "{{result.content|b64decode|from_json}}" + tags: + - result_binary_producing_json diff --git a/tests/ansible/integration/async/result_binary_producing_junk.yml b/tests/ansible/integration/async/result_binary_producing_junk.yml index 25ad65cf..afdf0c2f 100644 --- a/tests/ansible/integration/async/result_binary_producing_junk.yml +++ b/tests/ansible/integration/async/result_binary_producing_junk.yml @@ -42,3 +42,5 @@ fail_msg: async_out={{async_out}} vars: async_out: "{{result.content|b64decode|from_json}}" + tags: + - result_binary_producing_junk diff --git a/tests/ansible/integration/async/result_shell_echo_hi.yml b/tests/ansible/integration/async/result_shell_echo_hi.yml index 047913e5..d7905e2e 100644 --- a/tests/ansible/integration/async/result_shell_echo_hi.yml +++ b/tests/ansible/integration/async/result_shell_echo_hi.yml @@ -46,3 +46,5 @@ when: ansible_version.full > '2.4' vars: async_out: "{{result.content|b64decode|from_json}}" + tags: + - result_shell_echo_hi diff --git a/tests/ansible/integration/async/runner_new_process.yml b/tests/ansible/integration/async/runner_new_process.yml index 1644364f..fbc7261f 100644 --- a/tests/ansible/integration/async/runner_new_process.yml +++ b/tests/ansible/integration/async/runner_new_process.yml @@ -55,3 +55,5 @@ - async_result1.pid != async_result2.pid fail_msg: async_result1={{async_result1}} async_result2={{async_result2}} when: is_mitogen + tags: + - runner_new_process diff --git a/tests/ansible/integration/async/runner_one_job.yml b/tests/ansible/integration/async/runner_one_job.yml index b8a7a564..cf33ae56 100644 --- a/tests/ansible/integration/async/runner_one_job.yml +++ b/tests/ansible/integration/async/runner_one_job.yml @@ -65,3 +65,5 @@ - result1.failed == False fail_msg: result1={{result1}} when: ansible_version.full is version('2.4', '>') + tags: + - runner_one_job diff --git a/tests/ansible/integration/async/runner_timeout_then_polling.yml b/tests/ansible/integration/async/runner_timeout_then_polling.yml index 0847a95f..6fc46ba7 100644 --- a/tests/ansible/integration/async/runner_timeout_then_polling.yml +++ b/tests/ansible/integration/async/runner_timeout_then_polling.yml @@ -33,3 +33,5 @@ - result.msg == "Job reached maximum time limit of 1 seconds." fail_msg: result={{result}} when: is_mitogen + tags: + - runner_timeout_then_polling diff --git a/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml b/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml index fd5292d1..af102f19 100644 --- a/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml +++ b/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml @@ -63,3 +63,5 @@ - result2.stdout == 'im_alive' fail_msg: result2={{result2}} when: ansible_version.full > '2.8' # ansible#51393 + tags: + - runner_two_simultaneous_jobs diff --git a/tests/ansible/integration/async/runner_with_polling_and_timeout.yml b/tests/ansible/integration/async/runner_with_polling_and_timeout.yml index c7d9338e..a5cbabef 100644 --- a/tests/ansible/integration/async/runner_with_polling_and_timeout.yml +++ b/tests/ansible/integration/async/runner_with_polling_and_timeout.yml @@ -23,4 +23,5 @@ job1.msg == "async task did not complete within the requested time - 1s" or job1.msg == "Job reached maximum time limit of 1 seconds." fail_msg: job1={{job1}} - + tags: + - runner_with_polling_and_timeout diff --git a/tests/ansible/integration/become/su_password.yml b/tests/ansible/integration/become/su_password.yml index 9e1d0cf4..7bd6db5a 100644 --- a/tests/ansible/integration/become/su_password.yml +++ b/tests/ansible/integration/become/su_password.yml @@ -59,3 +59,6 @@ - out.stdout == 'mitogen__user1' fail_msg: out={{out}} when: is_mitogen + tags: + - su + - su_password diff --git a/tests/ansible/integration/become/sudo_flags_failure.yml b/tests/ansible/integration/become/sudo_flags_failure.yml index c66db6e3..971890dd 100644 --- a/tests/ansible/integration/become/sudo_flags_failure.yml +++ b/tests/ansible/integration/become/sudo_flags_failure.yml @@ -22,3 +22,6 @@ ("sudo: unrecognized option `--derps'" in out.module_stdout) or ("sudo: unrecognized option '--derps'" in out.module_stderr) fail_msg: out={{out}} + tags: + - sudo + - sudo_flags_failure diff --git a/tests/ansible/integration/become/sudo_nonexistent.yml b/tests/ansible/integration/become/sudo_nonexistent.yml index 0f1de8ba..d0e43214 100644 --- a/tests/ansible/integration/become/sudo_nonexistent.yml +++ b/tests/ansible/integration/become/sudo_nonexistent.yml @@ -31,3 +31,6 @@ - ansible_facts.distribution not in ["MacOSX"] or ansible_version.full is version("2.11", ">=", strict=True) or is_mitogen + tags: + - sudo + - sudo_nonexistent diff --git a/tests/ansible/integration/become/sudo_nopassword.yml b/tests/ansible/integration/become/sudo_nopassword.yml index 6b074667..110c95b4 100644 --- a/tests/ansible/integration/become/sudo_nopassword.yml +++ b/tests/ansible/integration/become/sudo_nopassword.yml @@ -1,6 +1,6 @@ # Verify passwordless sudo behaviour in various cases. -- name: integration/become/sudo_basic.yml +- name: integration/become/sudo_nopassword.yml hosts: test-targets any_errors_fatal: true tasks: @@ -24,3 +24,6 @@ that: - out.stdout == 'root' fail_msg: out={{out}} + tags: + - sudo + - sudo_nopassword diff --git a/tests/ansible/integration/become/sudo_password.yml b/tests/ansible/integration/become/sudo_password.yml index d2aa1d48..a0a1dec9 100644 --- a/tests/ansible/integration/become/sudo_password.yml +++ b/tests/ansible/integration/become/sudo_password.yml @@ -70,3 +70,6 @@ # - assert: # that: # - out.stdout == 'mitogen__pw_required' + tags: + - sudo + - sudo_password diff --git a/tests/ansible/integration/become/sudo_requiretty.yml b/tests/ansible/integration/become/sudo_requiretty.yml index dd62d9a0..0bdfaa26 100644 --- a/tests/ansible/integration/become/sudo_requiretty.yml +++ b/tests/ansible/integration/become/sudo_requiretty.yml @@ -35,3 +35,6 @@ # that: # - out.stdout == 'mitogen__require_tty_pw_required' # when: is_mitogen + tags: + - sudo + - sudo_requiretty diff --git a/tests/ansible/integration/connection/become_same_user.yml b/tests/ansible/integration/connection/become_same_user.yml index 7e5e5244..9f720e5c 100644 --- a/tests/ansible/integration/connection/become_same_user.yml +++ b/tests/ansible/integration/connection/become_same_user.yml @@ -39,3 +39,5 @@ - out.result|length == 2 # no sudo fail_msg: out={{out}} when: is_mitogen + tags: + - become_same_user diff --git a/tests/ansible/integration/connection/disconnect_during_module.yml b/tests/ansible/integration/connection/disconnect_during_module.yml index 723f61fc..1c7b544a 100644 --- a/tests/ansible/integration/connection/disconnect_during_module.yml +++ b/tests/ansible/integration/connection/disconnect_during_module.yml @@ -26,3 +26,6 @@ - out.rc == 4 - "'Mitogen was disconnected from the remote environment while a call was in-progress.' in out.stdout" fail_msg: out={{out}} + tags: + - disconnect + - disconnect_during_module diff --git a/tests/ansible/integration/connection/disconnect_resets_connection.yml b/tests/ansible/integration/connection/disconnect_resets_connection.yml index 5f02a8d5..3a6f712a 100644 --- a/tests/ansible/integration/connection/disconnect_resets_connection.yml +++ b/tests/ansible/integration/connection/disconnect_resets_connection.yml @@ -45,3 +45,6 @@ except AnsibleConnectionFailure: e = sys.exc_info()[1] assert str(e).startswith('Mitogen was disconnected') + tags: + - disconnect + - disconnect_resets_connection diff --git a/tests/ansible/integration/connection/exec_command.yml b/tests/ansible/integration/connection/exec_command.yml index a0dd71f7..125def1b 100644 --- a/tests/ansible/integration/connection/exec_command.yml +++ b/tests/ansible/integration/connection/exec_command.yml @@ -18,3 +18,5 @@ - out.result[1].decode() == "hello, world\r\n" - out.result[2].decode().startswith("Shared connection to ") fail_msg: out={{out}} + tags: + - exec_command diff --git a/tests/ansible/integration/connection/home_dir.yml b/tests/ansible/integration/connection/home_dir.yml index 10154450..1dbaa5d3 100644 --- a/tests/ansible/integration/connection/home_dir.yml +++ b/tests/ansible/integration/connection/home_dir.yml @@ -37,3 +37,5 @@ "homedir from facts": "{{root_facts.ansible_facts.ansible_user_dir}}" } when: is_mitogen + tags: + - home_dir diff --git a/tests/ansible/integration/connection/put_large_file.yml b/tests/ansible/integration/connection/put_large_file.yml index 392731df..90a13999 100644 --- a/tests/ansible/integration/connection/put_large_file.yml +++ b/tests/ansible/integration/connection/put_large_file.yml @@ -10,3 +10,6 @@ file_size: 512 tasks: - include: _put_file.yml + tags: + - put_file + - put_large_file diff --git a/tests/ansible/integration/connection/put_small_file.yml b/tests/ansible/integration/connection/put_small_file.yml index d9423f75..49be87a9 100644 --- a/tests/ansible/integration/connection/put_small_file.yml +++ b/tests/ansible/integration/connection/put_small_file.yml @@ -10,3 +10,6 @@ file_size: 123 tasks: - include: _put_file.yml + tags: + - put_file + - put_small_file diff --git a/tests/ansible/integration/connection/reset.yml b/tests/ansible/integration/connection/reset.yml index 431f795b..ccad928e 100644 --- a/tests/ansible/integration/connection/reset.yml +++ b/tests/ansible/integration/connection/reset.yml @@ -44,3 +44,5 @@ # sudo PID has changed. - out_become.ppid != out_become2.ppid fail_msg: out={{out}} out2={{out2}} out_become={{out_become}} out_become2={{out_become2}} + tags: + - reset diff --git a/tests/ansible/integration/connection/reset_become.yml b/tests/ansible/integration/connection/reset_become.yml index 2b4161f2..fe29dfed 100644 --- a/tests/ansible/integration/connection/reset_become.yml +++ b/tests/ansible/integration/connection/reset_become.yml @@ -49,3 +49,5 @@ that: - login_acct.pid != new_login_acct.pid fail_msg: login_acct={{login_acct}} new_login_acct={{new_login_acct}} + tags: + - reset_become diff --git a/tests/ansible/integration/connection_delegation/delegate_to_template.yml b/tests/ansible/integration/connection_delegation/delegate_to_template.yml index bfde1265..8e048fa4 100644 --- a/tests/ansible/integration/connection_delegation/delegate_to_template.yml +++ b/tests/ansible/integration/connection_delegation/delegate_to_template.yml @@ -90,3 +90,5 @@ 'method': 'ssh', } ] + tags: + - delegate_to_template diff --git a/tests/ansible/integration/connection_delegation/local_action.yml b/tests/ansible/integration/connection_delegation/local_action.yml index 05fc3db9..1c9a25ac 100644 --- a/tests/ansible/integration/connection_delegation/local_action.yml +++ b/tests/ansible/integration/connection_delegation/local_action.yml @@ -33,3 +33,5 @@ 'method': 'sudo', } ] + tags: + - local_action diff --git a/tests/ansible/integration/connection_delegation/osa_container_standalone.yml b/tests/ansible/integration/connection_delegation/osa_container_standalone.yml index cf5eceaa..249ab31a 100644 --- a/tests/ansible/integration/connection_delegation/osa_container_standalone.yml +++ b/tests/ansible/integration/connection_delegation/osa_container_standalone.yml @@ -27,3 +27,6 @@ 'method': 'setns', }, ] + tags: + - osa + - osa_container_standalone diff --git a/tests/ansible/integration/connection_delegation/osa_delegate_to_self.yml b/tests/ansible/integration/connection_delegation/osa_delegate_to_self.yml index 4a1fa681..4598e989 100644 --- a/tests/ansible/integration/connection_delegation/osa_delegate_to_self.yml +++ b/tests/ansible/integration/connection_delegation/osa_delegate_to_self.yml @@ -30,3 +30,6 @@ 'method': 'setns', }, ] + tags: + - osa + - osa_delegate_to_self diff --git a/tests/ansible/integration/connection_delegation/stack_construction.yml b/tests/ansible/integration/connection_delegation/stack_construction.yml index ed298599..ebf0f54f 100644 --- a/tests/ansible/integration/connection_delegation/stack_construction.yml +++ b/tests/ansible/integration/connection_delegation/stack_construction.yml @@ -25,6 +25,8 @@ # used later for local_action test. - local_action: custom_python_detect_environment register: local_env + tags: + - stack_construction - hosts: cd-normal @@ -50,6 +52,8 @@ "method": "doas", } ] + tags: + - stack_construction - hosts: cd-normal @@ -94,6 +98,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-alias @@ -137,6 +143,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-normal-normal @@ -191,6 +199,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-normal-alias @@ -264,6 +274,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-newuser-normal-normal @@ -318,6 +330,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-newuser-normal-normal @@ -362,6 +376,8 @@ 'method': 'ssh', }, ] + tags: + - stack_construction - hosts: cd-newuser-normal-normal @@ -381,6 +397,8 @@ 'method': 'local', }, ] + tags: + - stack_construction - hosts: cd-newuser-doas-normal @@ -416,3 +434,5 @@ 'method': 'doas', }, ] + tags: + - stack_construction diff --git a/tests/ansible/integration/connection_loader/local_blemished.yml b/tests/ansible/integration/connection_loader/local_blemished.yml index 1592f973..85224dbf 100644 --- a/tests/ansible/integration/connection_loader/local_blemished.yml +++ b/tests/ansible/integration/connection_loader/local_blemished.yml @@ -13,3 +13,6 @@ - assert: that: (not not out.mitogen_loaded) == (not not is_mitogen) fail_msg: out={{out}} + tags: + - local + - local_blemished diff --git a/tests/ansible/integration/connection_loader/paramiko_unblemished.yml b/tests/ansible/integration/connection_loader/paramiko_unblemished.yml index db1c8bd7..1bc5e2f6 100644 --- a/tests/ansible/integration/connection_loader/paramiko_unblemished.yml +++ b/tests/ansible/integration/connection_loader/paramiko_unblemished.yml @@ -17,3 +17,6 @@ that: not out.mitogen_loaded fail_msg: out={{out}} when: False + tags: + - paramiko + - paramiko_unblemished diff --git a/tests/ansible/integration/connection_loader/ssh_blemished.yml b/tests/ansible/integration/connection_loader/ssh_blemished.yml index b97fe1ed..58d35cee 100644 --- a/tests/ansible/integration/connection_loader/ssh_blemished.yml +++ b/tests/ansible/integration/connection_loader/ssh_blemished.yml @@ -13,3 +13,6 @@ - assert: that: (not not out.mitogen_loaded) == (not not is_mitogen) fail_msg: out={{out}} + tags: + - ssh + - ssh_blemished diff --git a/tests/ansible/integration/context_service/disconnect_cleanup.yml b/tests/ansible/integration/context_service/disconnect_cleanup.yml index d7345932..4f846535 100644 --- a/tests/ansible/integration/context_service/disconnect_cleanup.yml +++ b/tests/ansible/integration/context_service/disconnect_cleanup.yml @@ -48,3 +48,5 @@ # - assert: # that: out.dump|length == play_hosts|length # just the ssh account + tags: + - disconnect_cleanup diff --git a/tests/ansible/integration/context_service/lru_one_target.yml b/tests/ansible/integration/context_service/lru_one_target.yml index 4ab5e134..2d6dc6cf 100644 --- a/tests/ansible/integration/context_service/lru_one_target.yml +++ b/tests/ansible/integration/context_service/lru_one_target.yml @@ -40,3 +40,5 @@ # that: # - first_run.results[-1].pid != second_run.results[-1].pid # when: is_mitogen + tags: + - lru_one_target diff --git a/tests/ansible/integration/context_service/reconnection.yml b/tests/ansible/integration/context_service/reconnection.yml index c5cec967..2d7dbacf 100644 --- a/tests/ansible/integration/context_service/reconnection.yml +++ b/tests/ansible/integration/context_service/reconnection.yml @@ -32,3 +32,5 @@ that: - old_become_env.pid != new_become_env.pid fail_msg: old_become_env={{old_become_env}} new_become_env={{new_become_env}} + tags: + - reconnection diff --git a/tests/ansible/integration/context_service/remote_name.yml b/tests/ansible/integration/context_service/remote_name.yml index e2d9acac..cce209e4 100644 --- a/tests/ansible/integration/context_service/remote_name.yml +++ b/tests/ansible/integration/context_service/remote_name.yml @@ -30,4 +30,5 @@ that: - out.stdout is match('.*python([0-9.]+)?\(mitogen:ansible\)') fail_msg: out={{out}} - + tags: + - remote_name diff --git a/tests/ansible/integration/glibc_caches/resolv_conf.yml b/tests/ansible/integration/glibc_caches/resolv_conf.yml index 0f1ddf35..e2894e58 100644 --- a/tests/ansible/integration/glibc_caches/resolv_conf.yml +++ b/tests/ansible/integration/glibc_caches/resolv_conf.yml @@ -48,3 +48,5 @@ when: | ansible_virtualization_type == "docker" and ansible_python_version > "2.5" + tags: + - resolv_conf diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index d5e515b4..838b2d86 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -164,3 +164,5 @@ always: - meta: clear_facts when: ansible_version.full is version_compare('2.8.0', '>=') + tags: + - ansible_2_8_tests diff --git a/tests/ansible/integration/interpreter_discovery/complex_args.yml b/tests/ansible/integration/interpreter_discovery/complex_args.yml index 6c53e9e5..ca35a402 100644 --- a/tests/ansible/integration/interpreter_discovery/complex_args.yml +++ b/tests/ansible/integration/interpreter_discovery/complex_args.yml @@ -54,3 +54,5 @@ environment: https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}" no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}" + tags: + - complex_args diff --git a/tests/ansible/integration/local/cwd_preserved.yml b/tests/ansible/integration/local/cwd_preserved.yml index 5549f156..24a34ba8 100644 --- a/tests/ansible/integration/local/cwd_preserved.yml +++ b/tests/ansible/integration/local/cwd_preserved.yml @@ -20,4 +20,5 @@ - assert: that: stat.stat.exists fail_msg: stat={{stat}} - + tags: + - cwd_prseserved diff --git a/tests/ansible/integration/local/env_preserved.yml b/tests/ansible/integration/local/env_preserved.yml index 1375391e..64794756 100644 --- a/tests/ansible/integration/local/env_preserved.yml +++ b/tests/ansible/integration/local/env_preserved.yml @@ -6,3 +6,5 @@ connection: local tasks: - shell: "env | grep EVIL_VARS_PLUGIN" + tags: + - env_preserved diff --git a/tests/ansible/integration/module_utils/adjacent_to_playbook.yml b/tests/ansible/integration/module_utils/adjacent_to_playbook.yml index f47e147f..edd65db7 100644 --- a/tests/ansible/integration/module_utils/adjacent_to_playbook.yml +++ b/tests/ansible/integration/module_utils/adjacent_to_playbook.yml @@ -14,4 +14,5 @@ - out.external1_path == "ansible/integration/module_utils/module_utils/external1.py" - out.external2_path == "ansible/lib/module_utils/external2.py" fail_msg: out={{out}} - + tags: + - adjacent_to_playbook diff --git a/tests/ansible/integration/module_utils/adjacent_to_role.yml b/tests/ansible/integration/module_utils/adjacent_to_role.yml index 3fd3b1e6..4430c2d9 100644 --- a/tests/ansible/integration/module_utils/adjacent_to_role.yml +++ b/tests/ansible/integration/module_utils/adjacent_to_role.yml @@ -6,3 +6,5 @@ any_errors_fatal: true roles: - modrole + tags: + - adjacent_to_playbook diff --git a/tests/ansible/integration/module_utils/from_config_path.yml b/tests/ansible/integration/module_utils/from_config_path.yml index df3acd9b..0fb0f3ea 100644 --- a/tests/ansible/integration/module_utils/from_config_path.yml +++ b/tests/ansible/integration/module_utils/from_config_path.yml @@ -13,4 +13,5 @@ - out.external1_path == "ansible/lib/module_utils/external1.py" - out.external2_path == "ansible/lib/module_utils/external2.py" fail_msg: out={{out}} - + tags: + - from_config_path diff --git a/tests/ansible/integration/module_utils/from_config_path_pkg.yml b/tests/ansible/integration/module_utils/from_config_path_pkg.yml index 81881aa1..3453cf29 100644 --- a/tests/ansible/integration/module_utils/from_config_path_pkg.yml +++ b/tests/ansible/integration/module_utils/from_config_path_pkg.yml @@ -12,4 +12,5 @@ that: - out.extmod_path == "ansible/lib/module_utils/externalpkg/extmod.py" fail_msg: out={{out}} - + tags: + - from_config_path diff --git a/tests/ansible/integration/module_utils/overrides_builtin.yml b/tests/ansible/integration/module_utils/overrides_builtin.yml index 635876f1..86d88312 100644 --- a/tests/ansible/integration/module_utils/overrides_builtin.yml +++ b/tests/ansible/integration/module_utils/overrides_builtin.yml @@ -4,3 +4,5 @@ any_errors_fatal: true roles: - overrides_modrole + tags: + - overrides_builtin diff --git a/tests/ansible/integration/playbook_semantics/become_flags.yml b/tests/ansible/integration/playbook_semantics/become_flags.yml index 96a283da..ac762643 100644 --- a/tests/ansible/integration/playbook_semantics/become_flags.yml +++ b/tests/ansible/integration/playbook_semantics/become_flags.yml @@ -15,6 +15,8 @@ - assert: that: "out.stdout == ''" fail_msg: out={{out}} + tags: + - become_flags - hosts: test-targets any_errors_fatal: true @@ -30,3 +32,5 @@ - assert: that: "out2.stdout == '2'" fail_msg: out={{out}} + tags: + - become_flags diff --git a/tests/ansible/integration/playbook_semantics/delegate_to.yml b/tests/ansible/integration/playbook_semantics/delegate_to.yml index 23b7168c..7536258f 100644 --- a/tests/ansible/integration/playbook_semantics/delegate_to.yml +++ b/tests/ansible/integration/playbook_semantics/delegate_to.yml @@ -94,3 +94,5 @@ become: true tags: - requires_local_sudo + tags: + - delegate_to diff --git a/tests/ansible/integration/playbook_semantics/environment.yml b/tests/ansible/integration/playbook_semantics/environment.yml index 7d6b5184..01e8ce04 100644 --- a/tests/ansible/integration/playbook_semantics/environment.yml +++ b/tests/ansible/integration/playbook_semantics/environment.yml @@ -12,3 +12,5 @@ - assert: that: "result.stdout == '123'" fail_msg: result={{result}} + tags: + - environment diff --git a/tests/ansible/integration/playbook_semantics/with_items.yml b/tests/ansible/integration/playbook_semantics/with_items.yml index 9e64c1ba..12a92bba 100644 --- a/tests/ansible/integration/playbook_semantics/with_items.yml +++ b/tests/ansible/integration/playbook_semantics/with_items.yml @@ -29,3 +29,5 @@ # - first_run.results[item|int].stdout == ("mitogen__user%d" % (item|int + 1)) # - first_run.results[item|int].stdout == second_run.results[item|int].stdout # with_sequence: start=0 end=2 + tags: + - custom_python_new_style_module diff --git a/tests/ansible/integration/process/unix_socket_cleanup.yml b/tests/ansible/integration/process/unix_socket_cleanup.yml index 11a0efe1..6aeac609 100644 --- a/tests/ansible/integration/process/unix_socket_cleanup.yml +++ b/tests/ansible/integration/process/unix_socket_cleanup.yml @@ -26,3 +26,5 @@ - assert_equal: left: socks right: socks2 + tags: + - custom_python_new_style_module diff --git a/tests/ansible/integration/runner/atexit.yml b/tests/ansible/integration/runner/atexit.yml index 25babf0d..9cab0a5d 100644 --- a/tests/ansible/integration/runner/atexit.yml +++ b/tests/ansible/integration/runner/atexit.yml @@ -30,3 +30,5 @@ that: - not out.stat.exists fail_msg: out={{out}} + tags: + - atexit diff --git a/tests/ansible/integration/runner/builtin_command_module.yml b/tests/ansible/integration/runner/builtin_command_module.yml index b0ca7e1c..b567bee6 100644 --- a/tests/ansible/integration/runner/builtin_command_module.yml +++ b/tests/ansible/integration/runner/builtin_command_module.yml @@ -17,3 +17,5 @@ out.results[0].rc == 0 and (out.results[0].stdout == ansible_nodename) fail_msg: out={{out}} + tags: + - builtin_command_module diff --git a/tests/ansible/integration/runner/crashy_new_style_module.yml b/tests/ansible/integration/runner/crashy_new_style_module.yml index 01d4a98d..77f45861 100644 --- a/tests/ansible/integration/runner/crashy_new_style_module.yml +++ b/tests/ansible/integration/runner/crashy_new_style_module.yml @@ -23,3 +23,5 @@ or (out.module_stdout is search(tb_pattern) and out.module_stderr is match("Shared connection to localhost closed.")) fail_msg: out={{out}} + tags: + - crashy_new_style_module diff --git a/tests/ansible/integration/runner/custom_bash_hashbang_argument.yml b/tests/ansible/integration/runner/custom_bash_hashbang_argument.yml index 1eb79f20..d2d2281c 100644 --- a/tests/ansible/integration/runner/custom_bash_hashbang_argument.yml +++ b/tests/ansible/integration/runner/custom_bash_hashbang_argument.yml @@ -18,3 +18,5 @@ out.results[0].msg == 'Here is my input' and out.results[0].run_via_env == "yes" fail_msg: out={{out}} + tags: + - custom_bash_hashbang_argument diff --git a/tests/ansible/integration/runner/custom_bash_old_style_module.yml b/tests/ansible/integration/runner/custom_bash_old_style_module.yml index 4a14f86e..122b8fde 100644 --- a/tests/ansible/integration/runner/custom_bash_old_style_module.yml +++ b/tests/ansible/integration/runner/custom_bash_old_style_module.yml @@ -14,3 +14,5 @@ (not out.results[0].changed) and out.results[0].msg == 'Here is my input' fail_msg: out={{out}} + tags: + - custom_bash_old_style_module diff --git a/tests/ansible/integration/runner/custom_bash_want_json_module.yml b/tests/ansible/integration/runner/custom_bash_want_json_module.yml index 5ae74a4d..b4242e9a 100644 --- a/tests/ansible/integration/runner/custom_bash_want_json_module.yml +++ b/tests/ansible/integration/runner/custom_bash_want_json_module.yml @@ -13,3 +13,5 @@ (not out.results[0].changed) and out.results[0].msg == 'Here is my input' fail_msg: out={{out}} + tags: + - custom_bash_want_json_module diff --git a/tests/ansible/integration/runner/custom_binary_producing_json.yml b/tests/ansible/integration/runner/custom_binary_producing_json.yml index 016efac9..6dfeefc3 100644 --- a/tests/ansible/integration/runner/custom_binary_producing_json.yml +++ b/tests/ansible/integration/runner/custom_binary_producing_json.yml @@ -25,3 +25,5 @@ out.results[0].changed and out.results[0].msg == 'Hello, world.' fail_msg: out={{out}} + tags: + - custom_binary_producing_json diff --git a/tests/ansible/integration/runner/custom_binary_producing_junk.yml b/tests/ansible/integration/runner/custom_binary_producing_junk.yml index d302d43c..97fc92fe 100644 --- a/tests/ansible/integration/runner/custom_binary_producing_junk.yml +++ b/tests/ansible/integration/runner/custom_binary_producing_junk.yml @@ -19,6 +19,8 @@ register: out_linux - set_fact: out={{out_linux}} when: ansible_system == "Linux" + tags: + - custom_binary_producing_junk - hosts: test-targets @@ -31,3 +33,5 @@ - out.results[0].msg.startswith('MODULE FAILURE') - out.results[0].rc == 0 fail_msg: out={{out}} + tags: + - custom_binary_producing_junk diff --git a/tests/ansible/integration/runner/custom_binary_single_null.yml b/tests/ansible/integration/runner/custom_binary_single_null.yml index 8e2331a2..353cc58d 100644 --- a/tests/ansible/integration/runner/custom_binary_single_null.yml +++ b/tests/ansible/integration/runner/custom_binary_single_null.yml @@ -6,6 +6,8 @@ with_sequence: start=1 end={{end|default(1)}} ignore_errors: true register: out + tags: + - custom_binary_single_null - hosts: test-targets any_errors_fatal: true @@ -28,7 +30,8 @@ )) or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version == '16.04') fail_msg: out={{out}} - + tags: + - custom_binary_single_null # Can't test this: Mitogen returns 126, 2.5.x returns 126, 2.4.x discarded the # return value and always returned 0. diff --git a/tests/ansible/integration/runner/custom_perl_json_args_module.yml b/tests/ansible/integration/runner/custom_perl_json_args_module.yml index 9d51e71f..6201318a 100644 --- a/tests/ansible/integration/runner/custom_perl_json_args_module.yml +++ b/tests/ansible/integration/runner/custom_perl_json_args_module.yml @@ -19,3 +19,5 @@ - (not out.changed) - (not out.results[0].changed) fail_msg: out={{out}} + tags: + - custom_perl_json_args_module diff --git a/tests/ansible/integration/runner/custom_perl_want_json_module.yml b/tests/ansible/integration/runner/custom_perl_want_json_module.yml index 57d92fd0..9c39b1b6 100644 --- a/tests/ansible/integration/runner/custom_perl_want_json_module.yml +++ b/tests/ansible/integration/runner/custom_perl_want_json_module.yml @@ -19,3 +19,5 @@ - (not out.changed) - (not out.results[0].changed) fail_msg: out={{out}} + tags: + - custom_perl_want_json_module diff --git a/tests/ansible/integration/runner/custom_python_json_args_module.yml b/tests/ansible/integration/runner/custom_python_json_args_module.yml index 5c77097e..33a03ba0 100644 --- a/tests/ansible/integration/runner/custom_python_json_args_module.yml +++ b/tests/ansible/integration/runner/custom_python_json_args_module.yml @@ -14,3 +14,5 @@ out.results[0].input[0].foo and out.results[0].msg == 'Here is my input' fail_msg: out={{out}} + tags: + - custom_python_json_args_module diff --git a/tests/ansible/integration/runner/custom_python_new_style_missing_interpreter.yml b/tests/ansible/integration/runner/custom_python_new_style_missing_interpreter.yml index 4a375ff0..1562e307 100644 --- a/tests/ansible/integration/runner/custom_python_new_style_missing_interpreter.yml +++ b/tests/ansible/integration/runner/custom_python_new_style_missing_interpreter.yml @@ -16,3 +16,5 @@ #- "out.results[0].input[0].ANSIBLE_MODULE_ARGS.foo" - "out.results[0].msg == 'Here is my input'" fail_msg: out={{out}} + tags: + - custom_python_new_style_module diff --git a/tests/ansible/integration/runner/custom_python_new_style_module.yml b/tests/ansible/integration/runner/custom_python_new_style_module.yml index 3992f4b1..b22fdc14 100644 --- a/tests/ansible/integration/runner/custom_python_new_style_module.yml +++ b/tests/ansible/integration/runner/custom_python_new_style_module.yml @@ -28,3 +28,5 @@ that: - out.argv_types_correct fail_msg: out={{out}} + tags: + - custom_python_new_style_module diff --git a/tests/ansible/integration/runner/custom_python_prehistoric_module.yml b/tests/ansible/integration/runner/custom_python_prehistoric_module.yml index 19a8a9de..4ddec8c5 100644 --- a/tests/ansible/integration/runner/custom_python_prehistoric_module.yml +++ b/tests/ansible/integration/runner/custom_python_prehistoric_module.yml @@ -10,3 +10,5 @@ - assert: that: out.ok fail_msg: out={{out}} + tags: + - custom_python_prehistoric_module diff --git a/tests/ansible/integration/runner/custom_python_want_json_module.yml b/tests/ansible/integration/runner/custom_python_want_json_module.yml index dd5a5c1c..d704ee11 100644 --- a/tests/ansible/integration/runner/custom_python_want_json_module.yml +++ b/tests/ansible/integration/runner/custom_python_want_json_module.yml @@ -14,3 +14,5 @@ out.results[0].input[0].foo and out.results[0].msg == 'Here is my input' fail_msg: out={{out}} + tags: + - custom_python_want_json_module diff --git a/tests/ansible/integration/runner/custom_script_interpreter.yml b/tests/ansible/integration/runner/custom_script_interpreter.yml index f496cff0..03ea6718 100644 --- a/tests/ansible/integration/runner/custom_script_interpreter.yml +++ b/tests/ansible/integration/runner/custom_script_interpreter.yml @@ -16,4 +16,5 @@ (not out.results[0].changed) and out.results[0].msg == 'Here is my input' fail_msg: out={{out}} - + tags: + - custom_script_interpreter diff --git a/tests/ansible/integration/runner/environment_isolation.yml b/tests/ansible/integration/runner/environment_isolation.yml index eee31d6e..90110d01 100644 --- a/tests/ansible/integration/runner/environment_isolation.yml +++ b/tests/ansible/integration/runner/environment_isolation.yml @@ -51,4 +51,5 @@ - assert: that: not out.env.evil_key is defined fail_msg: out={{out}} - + tags: + - environment_isolation diff --git a/tests/ansible/integration/runner/etc_environment.yml b/tests/ansible/integration/runner/etc_environment.yml index df15bbdb..3a44c753 100644 --- a/tests/ansible/integration/runner/etc_environment.yml +++ b/tests/ansible/integration/runner/etc_environment.yml @@ -13,3 +13,5 @@ - include_tasks: _etc_environment_global.yml # Don't destroy laptops. when: ansible_virtualization_type == "docker" + tags: + - etc_environment diff --git a/tests/ansible/integration/runner/forking_active.yml b/tests/ansible/integration/runner/forking_active.yml index ebae849b..6a0e322d 100644 --- a/tests/ansible/integration/runner/forking_active.yml +++ b/tests/ansible/integration/runner/forking_active.yml @@ -30,3 +30,5 @@ fail_msg: fork_proc1={{fork_proc1}} sync_proc1={{sync_proc1}} fork_proc2={{fork_proc2}} when: is_mitogen + tags: + - forking_active diff --git a/tests/ansible/integration/runner/forking_correct_parent.yml b/tests/ansible/integration/runner/forking_correct_parent.yml index 59cf48e7..7fe54e7b 100644 --- a/tests/ansible/integration/runner/forking_correct_parent.yml +++ b/tests/ansible/integration/runner/forking_correct_parent.yml @@ -44,3 +44,6 @@ that: fork_proc.ppid == regular_proc.pid fail_msg: fork_proc={{fork_proc}} regular_proc={{regular_proc}} when: is_mitogen and not forkmode.uses_fork + + tags: + - forking_correct_parent diff --git a/tests/ansible/integration/runner/forking_inactive.yml b/tests/ansible/integration/runner/forking_inactive.yml index 05ec30ef..37282f82 100644 --- a/tests/ansible/integration/runner/forking_inactive.yml +++ b/tests/ansible/integration/runner/forking_inactive.yml @@ -21,4 +21,5 @@ fail_msg: sync_proc1={{sync_proc1}} sync_proc2={{sync_proc2}} when: is_mitogen - + tags: + - forking_inactive diff --git a/tests/ansible/integration/runner/missing_module.yml b/tests/ansible/integration/runner/missing_module.yml index f515b574..676012d9 100644 --- a/tests/ansible/integration/runner/missing_module.yml +++ b/tests/ansible/integration/runner/missing_module.yml @@ -18,3 +18,6 @@ that: | 'The module missing_module was not found in configured module paths' in out.stdout fail_msg: out={{out}} + tags: + - local + - missing_module diff --git a/tests/ansible/integration/ssh/config.yml b/tests/ansible/integration/ssh/config.yml index 9cd024e7..4e6748b1 100644 --- a/tests/ansible/integration/ssh/config.yml +++ b/tests/ansible/integration/ssh/config.yml @@ -18,3 +18,5 @@ lookup('env', 'HOME') + '/fakekey' ) fail_msg: out={{out}} + tags: + - config diff --git a/tests/ansible/integration/ssh/timeouts.yml b/tests/ansible/integration/ssh/timeouts.yml index 90be6c94..d697905a 100644 --- a/tests/ansible/integration/ssh/timeouts.yml +++ b/tests/ansible/integration/ssh/timeouts.yml @@ -26,3 +26,5 @@ '"msg": "Connection timed out."' in out.stdout fail_msg: out={{out}} when: is_mitogen + tags: + - timeouts diff --git a/tests/ansible/integration/strategy/_mixed_mitogen_vanilla.yml b/tests/ansible/integration/strategy/_mixed_mitogen_vanilla.yml index 3dfec756..b2ae7641 100644 --- a/tests/ansible/integration/strategy/_mixed_mitogen_vanilla.yml +++ b/tests/ansible/integration/strategy/_mixed_mitogen_vanilla.yml @@ -17,7 +17,8 @@ - assert: that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' fail_msg: strategy={{strategy}} - + tags: + - mitogen_linear - name: integration/strategy/_mixed_mitogen_vanilla.yml (linear) hosts: test-targets[0] @@ -34,7 +35,8 @@ - assert: that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' fail_msg: strategy={{strategy}} - + tags: + - linear - name: integration/strategy/_mixed_mitogen_vanilla.yml (mitogen_linear) hosts: test-targets[0] @@ -51,3 +53,5 @@ - assert: that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' fail_msg: strategy={{strategy}} + tags: + - mitogen_linear diff --git a/tests/ansible/integration/strategy/_mixed_vanilla_mitogen.yml b/tests/ansible/integration/strategy/_mixed_vanilla_mitogen.yml index 6381f114..e073d11a 100644 --- a/tests/ansible/integration/strategy/_mixed_vanilla_mitogen.yml +++ b/tests/ansible/integration/strategy/_mixed_vanilla_mitogen.yml @@ -16,6 +16,8 @@ - assert: that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' fail_msg: strategy={{strategy}} + tags: + - linear - name: integration/strategy/_mixed_vanilla_mitogen.yml (mitogen_linear) hosts: test-targets[0] @@ -32,7 +34,8 @@ - assert: that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' fail_msg: strategy={{strategy}} - + tags: + - mitogen_linear - name: integration/strategy/_mixed_vanilla_mitogen.yml (linear) hosts: test-targets[0] @@ -49,3 +52,5 @@ - assert: that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' fail_msg: strategy={{strategy}} + tags: + - linear diff --git a/tests/ansible/integration/strategy/mixed_vanilla_mitogen.yml b/tests/ansible/integration/strategy/mixed_vanilla_mitogen.yml index 206f80bd..0f462fea 100644 --- a/tests/ansible/integration/strategy/mixed_vanilla_mitogen.yml +++ b/tests/ansible/integration/strategy/mixed_vanilla_mitogen.yml @@ -22,3 +22,5 @@ args: chdir: ../.. register: out + tags: + - mixed_vanilla_mitogen diff --git a/tests/ansible/integration/stub_connections/kubectl.yml b/tests/ansible/integration/stub_connections/kubectl.yml index 92ed1a89..e4b881f8 100644 --- a/tests/ansible/integration/stub_connections/kubectl.yml +++ b/tests/ansible/integration/stub_connections/kubectl.yml @@ -21,3 +21,5 @@ that: - out.env.THIS_IS_STUB_KUBECTL == '1' fail_msg: out={{out}} + tags: + - kubectl diff --git a/tests/ansible/integration/stub_connections/lxc.yml b/tests/ansible/integration/stub_connections/lxc.yml index c09f2df2..ec79cdac 100644 --- a/tests/ansible/integration/stub_connections/lxc.yml +++ b/tests/ansible/integration/stub_connections/lxc.yml @@ -18,3 +18,5 @@ that: - out.env.THIS_IS_STUB_LXC_ATTACH == '1' fail_msg: out={{out}} + tags: + - lxc diff --git a/tests/ansible/integration/stub_connections/lxd.yml b/tests/ansible/integration/stub_connections/lxd.yml index de7d8766..cb03232f 100644 --- a/tests/ansible/integration/stub_connections/lxd.yml +++ b/tests/ansible/integration/stub_connections/lxd.yml @@ -18,3 +18,5 @@ that: - out.env.THIS_IS_STUB_LXC == '1' fail_msg: out={{out}} + tags: + - lxd diff --git a/tests/ansible/integration/stub_connections/mitogen_doas.yml b/tests/ansible/integration/stub_connections/mitogen_doas.yml index 4ced049d..5e545935 100644 --- a/tests/ansible/integration/stub_connections/mitogen_doas.yml +++ b/tests/ansible/integration/stub_connections/mitogen_doas.yml @@ -21,3 +21,5 @@ - out.env.THIS_IS_STUB_DOAS == '1' - (out.env.ORIGINAL_ARGV|from_json)[1:3] == ['-u', 'someuser'] fail_msg: out={{out}} + tags: + - mitogen_doas diff --git a/tests/ansible/integration/stub_connections/mitogen_sudo.yml b/tests/ansible/integration/stub_connections/mitogen_sudo.yml index 2e1b0103..36f69814 100644 --- a/tests/ansible/integration/stub_connections/mitogen_sudo.yml +++ b/tests/ansible/integration/stub_connections/mitogen_sudo.yml @@ -23,3 +23,5 @@ - assert_equal: left: (out.env.ORIGINAL_ARGV|from_json)[1:9] right: ['-u', 'root', '-H', '-r', 'somerole', '-t', 'sometype', '--'] + tags: + - mitogen_sudo diff --git a/tests/ansible/integration/stub_connections/setns_lxc.yml b/tests/ansible/integration/stub_connections/setns_lxc.yml index fcea3de2..44717504 100644 --- a/tests/ansible/integration/stub_connections/setns_lxc.yml +++ b/tests/ansible/integration/stub_connections/setns_lxc.yml @@ -32,3 +32,5 @@ - assert: that: result.rc == 0 fail_msg: result={{result}} + tags: + - stns_lxc diff --git a/tests/ansible/integration/stub_connections/setns_lxd.yml b/tests/ansible/integration/stub_connections/setns_lxd.yml index 61018382..841f7805 100644 --- a/tests/ansible/integration/stub_connections/setns_lxd.yml +++ b/tests/ansible/integration/stub_connections/setns_lxd.yml @@ -32,3 +32,5 @@ - assert: that: result.rc == 0 fail_msg: result={{result}} + tags: + - sens_lxd diff --git a/tests/ansible/integration/transport/all.yml b/tests/ansible/integration/transport/all.yml index 534534db..623ee00c 100644 --- a/tests/ansible/integration/transport/all.yml +++ b/tests/ansible/integration/transport/all.yml @@ -1,2 +1,4 @@ - include: kubectl.yml + tags: + - kubectl diff --git a/tests/ansible/regression/all.yml b/tests/ansible/regression/all.yml index 0d5e43cd..06ffdf61 100644 --- a/tests/ansible/regression/all.yml +++ b/tests/ansible/regression/all.yml @@ -1,15 +1,30 @@ - include: issue_109__target_has_old_ansible_installed.yml + tags: regression - include: issue_113__duplicate_module_imports.yml + tags: regression - include: issue_118__script_not_marked_exec.yml + tags: regression - include: issue_122__environment_difference.yml + tags: regression - include: issue_140__thread_pileup.yml + tags: regression - include: issue_152__local_action_wrong_interpreter.yml + tags: regression - include: issue_152__virtualenv_python_fails.yml + tags: regression - include: issue_154__module_state_leaks.yml + tags: regression - include: issue_177__copy_module_failing.yml + tags: regression - include: issue_332_ansiblemoduleerror_first_occurrence.yml + tags: regression - include: issue_558_unarchive_failed.yml + tags: regression - include: issue_590__sys_modules_crap.yml + tags: regression - include: issue_591__setuptools_cwd_crash.yml + tags: regression - include: issue_615__streaming_transfer.yml + tags: regression - include: issue_655__wait_for_connection_error.yml + tags: regression diff --git a/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml b/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml index 5c00734f..fdc61c05 100644 --- a/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml +++ b/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml @@ -30,3 +30,5 @@ # Run some new-style modules that 'from ansible.module_utils...' - stat: path: / + tags: + - issue_109 diff --git a/tests/ansible/regression/issue_113__duplicate_module_imports.yml b/tests/ansible/regression/issue_113__duplicate_module_imports.yml index 7c556588..b479e025 100644 --- a/tests/ansible/regression/issue_113__duplicate_module_imports.yml +++ b/tests/ansible/regression/issue_113__duplicate_module_imports.yml @@ -22,4 +22,6 @@ - out.status == -1 - out.url == 'http://127.0.0.1:14321/post' fail_msg: out={{out}} + tags: + - issue_113 diff --git a/tests/ansible/regression/issue_118__script_not_marked_exec.yml b/tests/ansible/regression/issue_118__script_not_marked_exec.yml index 724644f9..e02c49d3 100644 --- a/tests/ansible/regression/issue_118__script_not_marked_exec.yml +++ b/tests/ansible/regression/issue_118__script_not_marked_exec.yml @@ -6,3 +6,5 @@ tasks: - script: scripts/issue_118_saytrue + tags: + - issue_118 diff --git a/tests/ansible/regression/issue_122__environment_difference.yml b/tests/ansible/regression/issue_122__environment_difference.yml index b020cc5d..273a49ae 100644 --- a/tests/ansible/regression/issue_122__environment_difference.yml +++ b/tests/ansible/regression/issue_122__environment_difference.yml @@ -12,3 +12,5 @@ - script: scripts/print_env.py register: env - debug: msg={{env}} + tags: + - issue_122 diff --git a/tests/ansible/regression/issue_140__thread_pileup.yml b/tests/ansible/regression/issue_140__thread_pileup.yml index 78d5c7b1..e6ea83ce 100644 --- a/tests/ansible/regression/issue_140__thread_pileup.yml +++ b/tests/ansible/regression/issue_140__thread_pileup.yml @@ -34,3 +34,4 @@ tags: - resource_intensive + - issue_140 diff --git a/tests/ansible/regression/issue_152__local_action_wrong_interpreter.yml b/tests/ansible/regression/issue_152__local_action_wrong_interpreter.yml index 104e27cc..4da6f544 100644 --- a/tests/ansible/regression/issue_152__local_action_wrong_interpreter.yml +++ b/tests/ansible/regression/issue_152__local_action_wrong_interpreter.yml @@ -30,3 +30,5 @@ - file: path: /tmp/issue_152_interpreter.sh state: absent + tags: + - issue_152 diff --git a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml index c04f0b80..d3bda041 100644 --- a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml +++ b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml @@ -31,3 +31,5 @@ path: /tmp/issue_152_virtualenv state: absent when: lout.python_version > '2.6' + tags: + - issue_152 diff --git a/tests/ansible/regression/issue_154__module_state_leaks.yml b/tests/ansible/regression/issue_154__module_state_leaks.yml index b25b9030..59b970d9 100644 --- a/tests/ansible/regression/issue_154__module_state_leaks.yml +++ b/tests/ansible/regression/issue_154__module_state_leaks.yml @@ -17,3 +17,5 @@ - out.results[item|int].leak2 == ["David"] fail_msg: out={{out}} with_sequence: start=0 end=3 + tags: + - issue_154 diff --git a/tests/ansible/regression/issue_177__copy_module_failing.yml b/tests/ansible/regression/issue_177__copy_module_failing.yml index 593a0ae7..7da39962 100644 --- a/tests/ansible/regression/issue_177__copy_module_failing.yml +++ b/tests/ansible/regression/issue_177__copy_module_failing.yml @@ -17,3 +17,5 @@ with_items: - passwd - hosts + tags: + - issue_177 diff --git a/tests/ansible/regression/issue_332_ansiblemoduleerror_first_occurrence.yml b/tests/ansible/regression/issue_332_ansiblemoduleerror_first_occurrence.yml index 4138b544..2433e566 100644 --- a/tests/ansible/regression/issue_332_ansiblemoduleerror_first_occurrence.yml +++ b/tests/ansible/regression/issue_332_ansiblemoduleerror_first_occurrence.yml @@ -12,3 +12,5 @@ that: - out.msg == 'file (/usr/bin/does-not-exist) is absent, cannot continue' fail_msg: out={{out}} + tags: + - issue_332 diff --git a/tests/ansible/regression/issue_558_unarchive_failed.yml b/tests/ansible/regression/issue_558_unarchive_failed.yml index c6b1c9f6..23e9caad 100644 --- a/tests/ansible/regression/issue_558_unarchive_failed.yml +++ b/tests/ansible/regression/issue_558_unarchive_failed.yml @@ -11,3 +11,5 @@ dest: /tmp/foo # garbage doesn't work with BSD tar when: ansible_system != 'Darwin' + tags: + - issue_558 diff --git a/tests/ansible/regression/issue_590__sys_modules_crap.yml b/tests/ansible/regression/issue_590__sys_modules_crap.yml index 486b6d31..52b3ea97 100644 --- a/tests/ansible/regression/issue_590__sys_modules_crap.yml +++ b/tests/ansible/regression/issue_590__sys_modules_crap.yml @@ -11,3 +11,5 @@ that: - "'id' in out.info" fail_msg: out={{out}} + tags: + - issue_590 diff --git a/tests/ansible/regression/issue_591__setuptools_cwd_crash.yml b/tests/ansible/regression/issue_591__setuptools_cwd_crash.yml index fc73825c..02676cb5 100644 --- a/tests/ansible/regression/issue_591__setuptools_cwd_crash.yml +++ b/tests/ansible/regression/issue_591__setuptools_cwd_crash.yml @@ -22,3 +22,5 @@ script: | import os self._connection.get_chain().call(os.getcwd) + tags: + - issue_591 diff --git a/tests/ansible/regression/issue_615__streaming_transfer.yml b/tests/ansible/regression/issue_615__streaming_transfer.yml index aa7c62c4..b77aa254 100644 --- a/tests/ansible/regression/issue_615__streaming_transfer.yml +++ b/tests/ansible/regression/issue_615__streaming_transfer.yml @@ -19,3 +19,5 @@ path: /tmp/fetch-out state: absent delegate_to: localhost + tags: + - issue_615 diff --git a/tests/ansible/regression/issue_655__wait_for_connection_error.yml b/tests/ansible/regression/issue_655__wait_for_connection_error.yml index aa9472ec..307dead5 100644 --- a/tests/ansible/regression/issue_655__wait_for_connection_error.yml +++ b/tests/ansible/regression/issue_655__wait_for_connection_error.yml @@ -83,3 +83,5 @@ - name: remove test container shell: /usr/local/bin/docker stop testMitogen + tags: + - issue_655 From da3772cbffd99fd6ca09fff366709726dc513743 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 19:02:25 +0000 Subject: [PATCH 02/44] Increment version to 0.3.1.dev0 --- docs/changelog.rst | 11 ++++++++--- mitogen/__init__.py | 2 +- setup.py | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index e7045161..75917494 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,8 +17,13 @@ Release Notes To avail of fixes in an unreleased version, please download a ZIP file `directly from GitHub `_. -v0.3.0 (unreleased) --------------------- + +v0.3.1.dev0 (unreleased) +------------------------ + + +v0.3.0 (2021-11-24) +------------------- This release separates itself from the v0.2.X releases. Ansible's API changed too much to support backwards compatibility so from now on, v0.2.X releases will be for Ansible < 2.10 and v0.3.X will be for Ansible 2.10+. `See here for details `_. @@ -30,7 +35,7 @@ This release separates itself from the v0.2.X releases. Ansible's API changed to * :gh:issue:`847` Removed historic Continuous Integration reverse shell -v0.2.10 (unreleased) +v0.2.10 (2021-11-24) -------------------- * :gh:issue:`597` mitogen does not support Ansible 2.8 Python interpreter detection diff --git a/mitogen/__init__.py b/mitogen/__init__.py index 9e709d7d..8df8bfe2 100644 --- a/mitogen/__init__.py +++ b/mitogen/__init__.py @@ -35,7 +35,7 @@ be expected. On the slave, it is built dynamically during startup. #: Library version as a tuple. -__version__ = (0, 3, 0, 'rc', 1) +__version__ = (0, 3, 1, 'dev0') #: This is :data:`False` in slave contexts. Previously it was used to prevent diff --git a/setup.py b/setup.py index bd105147..8d3c75df 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import ast import os from setuptools import find_packages, setup @@ -37,7 +38,8 @@ def grep_version(): for line in fp: if line.startswith('__version__'): _, _, s = line.partition('=') - return '%i.%i.%i%s%i' % eval(s) + parts = ast.literal_eval(s.strip()) + return '.'.join(str(part) for part in parts) def long_description(): From 3ba1625a99f489fdd2a16c0f50f425b468f37405 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 19:22:37 +0000 Subject: [PATCH 03/44] ci: Reduce verbosity of Ansible integration tests --- .ci/ansible_tests.py | 2 +- .ci/azure-pipelines.yml | 5 +++++ .ci/localhost_ansible_tests.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.ci/ansible_tests.py b/.ci/ansible_tests.py index b2aa3199..665e2c60 100755 --- a/.ci/ansible_tests.py +++ b/.ci/ansible_tests.py @@ -70,7 +70,7 @@ with ci_lib.Fold('job_setup'): with ci_lib.Fold('ansible'): playbook = os.environ.get('PLAYBOOK', 'all.yml') try: - run('./run_ansible_playbook.py %s -i "%s" -vvv %s', + run('./run_ansible_playbook.py %s -i "%s" %s', playbook, HOSTS_DIR, ' '.join(sys.argv[1:])) except: pause_if_interactive() diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index c22dcf6c..bde7fa87 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -3,6 +3,11 @@ # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/python +# User defined variables are also injected as environment variables +# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables#environment-variables +#variables: + #ANSIBLE_VERBOSITY: 3 + jobs: - job: Mac diff --git a/.ci/localhost_ansible_tests.py b/.ci/localhost_ansible_tests.py index 6d7bef0d..13c77d96 100755 --- a/.ci/localhost_ansible_tests.py +++ b/.ci/localhost_ansible_tests.py @@ -46,11 +46,11 @@ with ci_lib.Fold('machine_prep'): if os.path.expanduser('~mitogen__user1') == '~mitogen__user1': os.chdir(IMAGE_PREP_DIR) - run("ansible-playbook -c local -i localhost, _user_accounts.yml -vvv") + run("ansible-playbook -c local -i localhost, _user_accounts.yml") with ci_lib.Fold('ansible'): os.chdir(TESTS_DIR) playbook = os.environ.get('PLAYBOOK', 'all.yml') - run('./run_ansible_playbook.py %s -l target %s -vvv', + run('./run_ansible_playbook.py %s -l target %s', playbook, ' '.join(sys.argv[1:])) From 39d02e9d5932cc0cdbb718ea19e89eec75d1947d Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 19:28:00 +0000 Subject: [PATCH 04/44] ci: Don't install pycparser and idna seperately AFAICT no longer necessary. These install fine as part of requirements.txt. --- .ci/ansible_install.py | 4 ---- .ci/debops_common_install.py | 3 --- .ci/localhost_ansible_install.py | 5 ----- .ci/mitogen_install.py | 1 - tests/requirements.txt | 1 + 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.ci/ansible_install.py b/.ci/ansible_install.py index 7b5d5657..63dbe563 100755 --- a/.ci/ansible_install.py +++ b/.ci/ansible_install.py @@ -4,10 +4,6 @@ import ci_lib batches = [ [ - # Must be installed separately, as PyNACL indirect requirement causes - # newer version to be installed if done in a single pip run. - # Separately install ansible based on version passed in from azure-pipelines.yml or .travis.yml - 'pip install "pycparser<2.19" "idna<2.7"', 'pip install ' '-r tests/requirements.txt ' '-r tests/ansible/requirements.txt', diff --git a/.ci/debops_common_install.py b/.ci/debops_common_install.py index 62519994..50d556cc 100755 --- a/.ci/debops_common_install.py +++ b/.ci/debops_common_install.py @@ -7,9 +7,6 @@ ci_lib.DISTROS = ['debian'] ci_lib.run_batches([ [ - # Must be installed separately, as PyNACL indirect requirement causes - # newer version to be installed if done in a single pip run. - 'pip install "pycparser<2.19"', 'pip install -qqq "debops[ansible]==2.1.2" "ansible-base<2.10.14" "ansible=={}"'.format(ci_lib.ANSIBLE_VERSION), ], [ diff --git a/.ci/localhost_ansible_install.py b/.ci/localhost_ansible_install.py index dba07053..e70bcf18 100755 --- a/.ci/localhost_ansible_install.py +++ b/.ci/localhost_ansible_install.py @@ -4,11 +4,6 @@ import ci_lib batches = [ [ - # Must be installed separately, as PyNACL indirect requirement causes - # newer version to be installed if done in a single pip run. - # Separately install ansible based on version passed in from azure-pipelines.yml or .travis.yml - # Don't set -U as that will upgrade Paramiko to a non-2.6 compatible version. - 'pip install "pycparser<2.19" "idna<2.7" virtualenv', 'pip install ' '-r tests/requirements.txt ' '-r tests/ansible/requirements.txt', diff --git a/.ci/mitogen_install.py b/.ci/mitogen_install.py index d51c2f17..ab9bb2f2 100755 --- a/.ci/mitogen_install.py +++ b/.ci/mitogen_install.py @@ -4,7 +4,6 @@ import ci_lib batches = [ [ - 'pip install "pycparser<2.19" "idna<2.7"', 'pip install -r tests/requirements.txt', ] ] diff --git a/tests/requirements.txt b/tests/requirements.txt index 21ef8166..a82ff815 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -16,3 +16,4 @@ urllib3[secure]==1.23; python_version < '2.7' urllib3[secure]==1.26; python_version > '2.6' and python_version < '2.7.9' # Last idna compatible with Python 2.6 was idna 2.7. idna==2.7; python_version < '2.7' +virtualenv==20.10.0 From da536e8ae1190573cd78d73de6b3b8610c2d23b4 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 21:50:01 +0000 Subject: [PATCH 05/44] Fix stdlib typos that would cause NameError or AttributeError exceptions --- mitogen/profiler.py | 2 +- tests/testlib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mitogen/profiler.py b/mitogen/profiler.py index bbf6086a..512a593e 100644 --- a/mitogen/profiler.py +++ b/mitogen/profiler.py @@ -90,7 +90,7 @@ def merge_stats(outpath, inpaths): break time.sleep(0.2) - stats.dump_stats(outpath) + pstats.dump_stats(outpath) def generate_stats(outpath, tmpdir): diff --git a/tests/testlib.py b/tests/testlib.py index 019b35d7..d40ce573 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -144,7 +144,7 @@ def wait_for_port( if not pattern: # Success: We connected & there's no banner check to perform. - sock.shutdown(socket.SHUTD_RDWR) + sock.shutdown(socket.SHUT_RDWR) sock.close() return From 9201761348e57625417881100a54f4bda4521367 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 21:51:53 +0000 Subject: [PATCH 06/44] ci: Format ansible-playbook output as yaml --- tests/ansible/ansible.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ansible/ansible.cfg b/tests/ansible/ansible.cfg index 59752492..2fe01ee3 100644 --- a/tests/ansible/ansible.cfg +++ b/tests/ansible/ansible.cfg @@ -5,7 +5,9 @@ strategy_plugins = ../../ansible_mitogen/plugins/strategy inventory_plugins = lib/inventory action_plugins = lib/action callback_plugins = lib/callback -stdout_callback = nice_stdout +stdout_callback = yaml +stdout_whitelist = + yaml vars_plugins = lib/vars library = lib/modules filter_plugins = lib/filters From 1bdf6294e4e15d06fb3e2541bb3c3e815365aa85 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 21:52:32 +0000 Subject: [PATCH 07/44] ci: Print playbook role execution times --- tests/ansible/ansible.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ansible/ansible.cfg b/tests/ansible/ansible.cfg index 2fe01ee3..dfc2858e 100644 --- a/tests/ansible/ansible.cfg +++ b/tests/ansible/ansible.cfg @@ -7,6 +7,8 @@ action_plugins = lib/action callback_plugins = lib/callback stdout_callback = yaml stdout_whitelist = + profile_roles, + timer, yaml vars_plugins = lib/vars library = lib/modules @@ -33,6 +35,9 @@ timeout = 10 # On Travis, paramiko check fails due to host key checking enabled. host_key_checking = False +[callback_profile_tasks] +task_output_limit = 10 + [ssh_connection] ssh_args = -o UserKnownHostsFile=/dev/null -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s pipelining = True From da0262cc180b89659936ccd91ff2bf43bfb5589f Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 21:54:48 +0000 Subject: [PATCH 08/44] ci: Upgrade faulthandler to non-yanked release --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index a82ff815..c125a28f 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,11 +1,11 @@ psutil==5.4.8 coverage==4.5.1 Django==1.6.11 # Last version supporting 2.6. +faulthandler==3.2; python_version < '3.3' mock==2.0.0 pytz==2018.5 cffi==1.14.3 # Random pin to try and fix pyparser==2.18 not having effect pycparser==2.18 # Last version supporting 2.6. -faulthandler==3.1; python_version < '3.3' # used by testlib pytest-catchlog==1.2.2 pytest==3.1.2 timeoutcontext==1.2.0 From e76eefb8be7cce03d3002c2c69889924ede4a80d Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 9 Nov 2021 22:00:33 +0000 Subject: [PATCH 09/44] Fix miscellaneous spelling/formatting --- .ci/ci_lib.py | 2 +- docs/howitworks.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 513ac98c..428d3ab9 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -167,7 +167,7 @@ def get_output(s, *args, **kwargs): def exists_in_path(progname): """ - Return True if proganme exists in $PATH. + Return True if progname exists in $PATH. >>> exists_in_path('echo') True diff --git a/docs/howitworks.rst b/docs/howitworks.rst index 05c097e5..27b109fe 100644 --- a/docs/howitworks.rst +++ b/docs/howitworks.rst @@ -813,7 +813,7 @@ executes under the runtime importer lock, ensuring :py:keyword:`import` statements executing in local threads are serialized. .. note:: - + In Python 2, :py:exc:`ImportError` is raised when :py:keyword:`import` is attempted while the runtime import lock is held by another thread, therefore imports must be serialized by only attempting them from the main From c5c65ab0d2716d5131b3fbcd23b8d69d6519c94a Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 10 Nov 2021 01:05:37 +0000 Subject: [PATCH 10/44] ci: Switch Continuous Integration to Tox Also - Simplifies adding support for additional Ansible versions - Unifies Python package versioning in CI and local test environments - Matches Python versions tested, with those declared in setup.py - Expands targets covered by automated Ansible tests to - centos6, centos8 - debian9, debian11 - ubuntu1604, ubuntu2004 --- .ci/README.md | 2 - .ci/ansible_install.py | 12 ---- .ci/azure-pipelines-steps.yml | 19 +++---- .ci/azure-pipelines.yml | 47 +++++----------- .ci/ci_lib.py | 17 ++---- .ci/debops_common_install.py | 3 +- .ci/localhost_ansible_install.py | 6 -- .ci/mitogen_install.py | 4 -- .ci/mitogen_py24_install.py | 1 - .ci/prep_azure.py | 95 -------------------------------- docs/changelog.rst | 3 + tox.ini | 41 +++++++++----- 12 files changed, 60 insertions(+), 190 deletions(-) delete mode 100755 .ci/prep_azure.py diff --git a/.ci/README.md b/.ci/README.md index 4d033602..67a3805b 100644 --- a/.ci/README.md +++ b/.ci/README.md @@ -28,8 +28,6 @@ for doing `setup.py install` while pulling a Docker container, for example. ### Environment Variables -* `VER`: Ansible version the `_install` script should install. Default changes - over time. * `TARGET_COUNT`: number of targets for `debops_` run. Defaults to 2. * `DISTRO`: the `mitogen_` tests need a target Docker container distro. This name comes from the Docker Hub `mitogen` user, i.e. `mitogen/$DISTRO-test` diff --git a/.ci/ansible_install.py b/.ci/ansible_install.py index 63dbe563..900303f6 100755 --- a/.ci/ansible_install.py +++ b/.ci/ansible_install.py @@ -3,21 +3,9 @@ import ci_lib batches = [ - [ - 'pip install ' - '-r tests/requirements.txt ' - '-r tests/ansible/requirements.txt', - # encoding is required for installing ansible 2.10 with pip2, otherwise we get a UnicodeDecode error - 'LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 pip install "ansible-base<2.10.14" "ansible=={}"'.format(ci_lib.ANSIBLE_VERSION) - ], [ 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', ] ] -batches[-1].extend([ - 'docker pull %s' % (ci_lib.image_for_distro(distro),) - for distro in ci_lib.DISTROS -]) - ci_lib.run_batches(batches) diff --git a/.ci/azure-pipelines-steps.yml b/.ci/azure-pipelines-steps.yml index 98d1146a..3249da41 100644 --- a/.ci/azure-pipelines-steps.yml +++ b/.ci/azure-pipelines-steps.yml @@ -5,20 +5,17 @@ parameters: sign: false steps: -- script: "PYTHONVERSION=$(python.version) .ci/prep_azure.py" - displayName: "Run prep_azure.py" +- task: UsePythonVersion@0 + displayName: Install python + inputs: + versionSpec: '$(python.version)' -- script: | - echo "##vso[task.prependpath]/tmp/venv/bin" +- script: python -mpip install tox + displayName: Install tooling - displayName: activate venv - -- script: .ci/$(MODE)_install.py - displayName: "Run $(MODE)_install.py" +- script: tox -e $(tox.env) + displayName: "Run tests" env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) AWS_DEFAULT_REGION: $(AWS_DEFAULT_REGION) - -- script: .ci/$(MODE)_tests.py - displayName: "Run $(MODE)_tests.py" diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index bde7fa87..dd9e9c68 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -16,62 +16,46 @@ jobs: steps: - template: azure-pipelines-steps.yml pool: + # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md vmImage: macOS-10.15 strategy: matrix: Mito27_27: python.version: '2.7' - MODE: mitogen + tox.env: py27-mode_mitogen + # TODO: test python3, python3 tests are broken Ans210_27: python.version: '2.7' - MODE: localhost_ansible - VER: 2.10.0 + tox.env: py27-mode_localhost-ansible2.10 # NOTE: this hangs when ran in Ubuntu 18.04 Vanilla_210_27: python.version: '2.7' - MODE: localhost_ansible - VER: 2.10.0 + tox.env: py27-mode_localhost-ansible2.10 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive - job: Linux pool: + # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md vmImage: "Ubuntu 18.04" steps: - template: azure-pipelines-steps.yml strategy: matrix: - # - # Confirmed working - # Mito27Debian_27: python.version: '2.7' - MODE: mitogen - DISTRO: debian9 - - #MitoPy27CentOS6_26: - #python.version: '2.7' - #MODE: mitogen - #DISTRO: centos6 + tox.env: py27-mode_mitogen-distro_debian9 Mito36CentOS6_26: python.version: '3.6' - MODE: mitogen - DISTRO: centos6 - - Mito37Debian_27: - python.version: '3.7' - MODE: mitogen - DISTRO: debian9 + tox.env: py36-mode_mitogen-distro_centos6 Mito39Debian_27: python.version: '3.9' - MODE: mitogen - DISTRO: debian9 - VER: 2.10.0 + tox.env: py39-mode_mitogen-distro_debian9 #Py26CentOS7: #python.version: '2.7' @@ -117,15 +101,12 @@ jobs: Ansible_210_27: python.version: '2.7' - MODE: ansible - VER: 2.10.0 + tox.env: py27-mode_ansible-ansible2.10 - Ansible_210_35: - python.version: '3.5' - MODE: ansible - VER: 2.10.0 + Ansible_210_36: + python.version: '3.6' + tox.env: py36-mode_ansible-ansible2.10 Ansible_210_39: python.version: '3.9' - MODE: ansible - VER: 2.10.0 + tox.env: py39-mode_ansible-ansible2.10 diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 428d3ab9..1d9b0d73 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -59,12 +59,6 @@ def have_docker(): return proc.wait() == 0 -# ----------------- - -# Force line buffering on stdout. -sys.stdout = os.fdopen(1, 'w', 1) - - def _argv(s, *args): """Interpolate a command line using *args, return an argv style list. @@ -195,13 +189,11 @@ class Fold(object): os.environ.setdefault('ANSIBLE_STRATEGY', os.environ.get('STRATEGY', 'mitogen_linear')) -# Ignoreed when MODE=mitogen -ANSIBLE_VERSION = os.environ.get('VER', '2.6.2') GIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # Used only when MODE=mitogen -DISTRO = os.environ.get('DISTRO', 'debian') +DISTRO = os.environ.get('DISTRO', 'debian9') # Used only when MODE=ansible -DISTROS = os.environ.get('DISTROS', 'debian centos6 centos7').split() +DISTROS = os.environ.get('DISTROS', 'centos6 centos8 debian9 debian11 ubuntu1604 ubuntu2004').split() TARGET_COUNT = int(os.environ.get('TARGET_COUNT', '2')) BASE_PORT = 2200 TMP = TempDir().path @@ -254,11 +246,13 @@ def make_containers(name_prefix='', port_offset=0): >>> pprint.pprint(make_containers()) [{'distro': 'debian', 'hostname': 'localhost', + 'image': 'public.ecr.aws/n5z0e8q9/debian-test', 'name': 'target-debian-1', 'port': 2201, 'python_path': '/usr/bin/python'}, {'distro': 'centos6', 'hostname': 'localhost', + 'image': 'public.ecr.aws/n5z0e8q9/centos6-test', 'name': 'target-centos6-2', 'port': 2202, 'python_path': '/usr/bin/python'}] @@ -280,6 +274,7 @@ def make_containers(name_prefix='', port_offset=0): for x in range(count): lst.append({ "distro": firstbit(distro), + "image": image_for_distro(distro), "name": name_prefix + ("target-%s-%s" % (distro, i)), "hostname": docker_hostname, "port": BASE_PORT + i + port_offset, @@ -358,7 +353,7 @@ def start_containers(containers): "--publish 0.0.0.0:%(port)s:22/tcp " "--hostname=%(name)s " "--name=%(name)s " - "mitogen/%(distro)s-test " + "%(image)s" % container ] for container in containers diff --git a/.ci/debops_common_install.py b/.ci/debops_common_install.py index 50d556cc..75124fe3 100755 --- a/.ci/debops_common_install.py +++ b/.ci/debops_common_install.py @@ -7,11 +7,10 @@ ci_lib.DISTROS = ['debian'] ci_lib.run_batches([ [ - 'pip install -qqq "debops[ansible]==2.1.2" "ansible-base<2.10.14" "ansible=={}"'.format(ci_lib.ANSIBLE_VERSION), + 'pip install -qqq "debops[ansible]==2.1.2"', ], [ 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', - 'docker pull %s' % (ci_lib.image_for_distro('debian'),), ], ]) diff --git a/.ci/localhost_ansible_install.py b/.ci/localhost_ansible_install.py index e70bcf18..d08ddafc 100755 --- a/.ci/localhost_ansible_install.py +++ b/.ci/localhost_ansible_install.py @@ -3,12 +3,6 @@ import ci_lib batches = [ - [ - 'pip install ' - '-r tests/requirements.txt ' - '-r tests/ansible/requirements.txt', - 'pip install -q "ansible-base<2.10.14" "ansible=={}"'.format(ci_lib.ANSIBLE_VERSION) - ] ] ci_lib.run_batches(batches) diff --git a/.ci/mitogen_install.py b/.ci/mitogen_install.py index ab9bb2f2..b0b1eb14 100755 --- a/.ci/mitogen_install.py +++ b/.ci/mitogen_install.py @@ -3,15 +3,11 @@ import ci_lib batches = [ - [ - 'pip install -r tests/requirements.txt', - ] ] if ci_lib.have_docker(): batches.append([ 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', - 'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),), ]) diff --git a/.ci/mitogen_py24_install.py b/.ci/mitogen_py24_install.py index 92294aab..bd6ecb24 100755 --- a/.ci/mitogen_py24_install.py +++ b/.ci/mitogen_py24_install.py @@ -5,7 +5,6 @@ import ci_lib batches = [ [ 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', - 'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),), ], [ 'curl https://dw.github.io/mitogen/binaries/ubuntu-python-2.4.6.tar.bz2 | sudo tar -C / -jxv', diff --git a/.ci/prep_azure.py b/.ci/prep_azure.py deleted file mode 100755 index fd8fb694..00000000 --- a/.ci/prep_azure.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -import os -import sys - -import ci_lib - -batches = [] - -if 0 and os.uname()[0] == 'Linux': - batches += [ - [ - "sudo chown `whoami`: ~", - "chmod u=rwx,g=rx,o= ~", - - "sudo mkdir /var/run/sshd", - "sudo /etc/init.d/ssh start", - - "mkdir -p ~/.ssh", - "chmod u=rwx,go= ~/.ssh", - - "ssh-keyscan -H localhost >> ~/.ssh/known_hosts", - "chmod u=rw,go= ~/.ssh/known_hosts", - - "cat tests/data/docker/mitogen__has_sudo_pubkey.key > ~/.ssh/id_rsa", - "chmod u=rw,go= ~/.ssh/id_rsa", - - "cat tests/data/docker/mitogen__has_sudo_pubkey.key.pub > ~/.ssh/authorized_keys", - "chmod u=rw,go=r ~/.ssh/authorized_keys", - ] - ] - -# setup venv, need all python commands in 1 list to be subprocessed at the same time -venv_steps = [] - -need_to_fix_psycopg2 = False - -is_python3 = os.environ['PYTHONVERSION'].startswith('3') - -# @dw: The VSTS-shipped Pythons available via UsePythonVErsion are pure garbage, -# broken symlinks, incorrect permissions and missing codecs. So we use the -# deadsnakes PPA to get sane Pythons, and setup a virtualenv to install our -# stuff into. The virtualenv can probably be removed again, but this was a -# hard-fought battle and for now I am tired of this crap. -if ci_lib.have_apt(): - venv_steps.extend([ - 'echo force-unsafe-io | sudo tee /etc/dpkg/dpkg.cfg.d/nosync', - 'sudo add-apt-repository ppa:deadsnakes/ppa', - 'sudo apt-get update', - 'sudo apt-get -y install ' - 'python{pv} ' - 'python{pv}-dev ' - 'libsasl2-dev ' - 'libldap2-dev ' - .format(pv=os.environ['PYTHONVERSION']), - 'sudo ln -fs /usr/bin/python{pv} /usr/local/bin/python{pv}' - .format(pv=os.environ['PYTHONVERSION']) - ]) - if is_python3: - venv_steps.append('sudo apt-get -y install python{pv}-venv'.format(pv=os.environ['PYTHONVERSION'])) -# TODO: somehow `Mito36CentOS6_26` has both brew and apt installed https://dev.azure.com/dw-mitogen/Mitogen/_build/results?buildId=1031&view=logs&j=7bdbcdc6-3d3e-568d-ccf8-9ddca1a9623a&t=73d379b6-4eea-540f-c97e-046a2f620483 -elif is_python3 and ci_lib.have_brew(): - # Mac's System Integrity Protection prevents symlinking /usr/bin - # and Azure isn't allowing disabling it apparently: https://developercommunityapi.westus.cloudapp.azure.com/idea/558702/allow-disabling-sip-on-microsoft-hosted-macos-agen.html - # so we'll use /usr/local/bin/python for everything - # /usr/local/bin/python2.7 already exists! - need_to_fix_psycopg2 = True - venv_steps.append( - 'brew install python@{pv} postgresql' - .format(pv=os.environ['PYTHONVERSION']) - ) - -# need wheel before building virtualenv because of bdist_wheel and setuptools deps -venv_steps.append('/usr/local/bin/python{pv} -m pip install -U pip wheel setuptools'.format(pv=os.environ['PYTHONVERSION'])) - -if os.environ['PYTHONVERSION'].startswith('2'): - venv_steps.extend([ - '/usr/local/bin/python{pv} -m pip install -U virtualenv'.format(pv=os.environ['PYTHONVERSION']), - '/usr/local/bin/python{pv} -m virtualenv /tmp/venv -p /usr/local/bin/python{pv}'.format(pv=os.environ['PYTHONVERSION']) - ]) -else: - venv_steps.append('/usr/local/bin/python{pv} -m venv /tmp/venv'.format(pv=os.environ['PYTHONVERSION'])) -# fixes https://stackoverflow.com/questions/59595649/can-not-install-psycopg2-on-macos-catalina https://github.com/Azure/azure-cli/issues/12854#issuecomment-619213863 -if need_to_fix_psycopg2: - venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary') - -venv_steps.extend([ - # pbr is a transitive setup_requires of hdrhistogram. If it's not already - # installed then setuptools attempts to use easy_install, which fails. - '/tmp/venv/bin/pip install pbr==5.6.0', -]) - -batches.append(venv_steps) - -ci_lib.run_batches(batches) diff --git a/docs/changelog.rst b/docs/changelog.rst index 75917494..5d617432 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,9 @@ To avail of fixes in an unreleased version, please download a ZIP file v0.3.1.dev0 (unreleased) ------------------------ +* :gh:issue:`869` Continuous Integration tests are now run with Tox +* :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 + v0.3.0 (2021-11-24) ------------------- diff --git a/tox.ini b/tox.ini index eda4e567..d6a7eccc 100644 --- a/tox.ini +++ b/tox.ini @@ -23,15 +23,15 @@ # pip --no-python-version-warning # pip --disable-pip-version-check +# TODO distros=-py3 + [tox] envlist = init, - py{27,35,39}-mode_ansible-distros_centos, - py{27,35,39}-mode_ansible-distros_debian, - py{27,35,39}-mode_ansible-distros_ubuntu, - py{27,35,39}-mode_mitogen-distro_centos{6,7,8}, - py{27,35,39}-mode_mitogen-distro_debian{9,10,11}, - py{27,35,39}-mode_mitogen-distro_ubuntu{1604,1804,2004}, + py{27,36,39}-mode_ansible-ansible2.10, + py{27,36,39}-mode_mitogen-distro_centos{6,7,8}, + py{27,36,39}-mode_mitogen-distro_debian{9,10,11}, + py{27,36,39}-mode_mitogen-distro_ubuntu{1604,1804,2004}, report, requires = tox-factor @@ -45,29 +45,37 @@ basepython = py37: python3.7 py38: python3.8 py39: python3.9 +deps = + -r{toxinidir}/tests/requirements.txt + mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt + ansible2.3: ansible=2.3.3.0 + ansible2.4: ansible=2.4.6.0 + ansible2.8: ansible=2.8.3 + ansible2.9: ansible=2.9.6 + ansible2.10: ansible-base<2.10.14 + ansible2.10: ansible==2.10.0 install_command = python -m pip --no-python-version-warning install {opts} {packages} commands_pre = mode_ansible: {toxinidir}/.ci/ansible_install.py mode_debops_common: {toxinidir}/.ci/debops_common_install.py + mode_localhost: {toxinidir}/.ci/localhost_ansible_install.py mode_mitogen: {toxinidir}/.ci/mitogen_install.py commands = mode_ansible: {toxinidir}/.ci/ansible_tests.py mode_debops_common: {toxinidir}/.ci/debops_common_tests.py + mode_localhost: {toxinidir}/.ci/localhost_ansible_tests.py mode_mitogen: {toxinidir}/.ci/mitogen_tests.py passenv = ANSIBLE_* + AWS_ACCESS_KEY_ID + AWS_DEFAULT_REGION + AWS_SECRET_ACCESS_KEY HOME setenv = - ANSIBLE_SKIP_TAGS = requires_local_sudo NOCOVERAGE_ERASE = 1 NOCOVERAGE_REPORT = 1 - VER=2.10.5 - ansible2.3: VER=2.3.3.0 - ansible2.4: VER=2.4.6.0 - ansible2.8: VER=2.8.3 - ansible2.9: VER=2.9.6 - ansible2.10: VER=2.10.0 + # Only applicable to MODE=mitogen distro_centos5: DISTRO=centos5 distro_centos6: DISTRO=centos6 distro_centos7: DISTRO=centos7 @@ -78,6 +86,7 @@ setenv = distro_ubuntu1604: DISTRO=ubuntu1604 distro_ubuntu1804: DISTRO=ubuntu1804 distro_ubuntu2004: DISTRO=ubuntu2004 + # Note the plural, only applicable to MODE=ansible distros_centos: DISTROS=centos6 centos7 centos8 distros_centos5: DISTROS=centos5 distros_centos6: DISTROS=centos6 @@ -95,6 +104,12 @@ setenv = mode_debops_common: MODE=debops_common mode_mitogen: MODE=mitogen strategy_linear: STRATEGY=linear +whitelist_externals = + docker + docker-credential-secretservice + echo + gpg2 + pass [testenv:init] basepython = python3 From 10caa4a1043612f9af7eb6045c1020d899eabfe4 Mon Sep 17 00:00:00 2001 From: Denis Zalevskiy Date: Fri, 22 Oct 2021 11:35:21 +0300 Subject: [PATCH 11/44] Fix typo in buildah context creation docs Signed-off-by: Denis Zalevskiy --- docs/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 7ab3274e..9bc32861 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -95,7 +95,7 @@ Connection Methods :param str container: The name of the Buildah container to connect to. - :param str doas_path: + :param str buildah_path: Filename or complete path to the ``buildah`` binary. ``PATH`` will be searched if given as a filename. Defaults to ``buildah``. :param str username: From 84c567e2650dfee761ecb39486b6c506f0cbcafe Mon Sep 17 00:00:00 2001 From: Denis Zalevskiy Date: Fri, 22 Oct 2021 11:31:55 +0300 Subject: [PATCH 12/44] Add podman connection support Shameless copy of buildah connection with modifications of invocation to fit podman CLI. Signed-off-by: Denis Zalevskiy --- docs/api.rst | 14 +++++++ docs/changelog.rst | 1 + mitogen/core.py | 1 + mitogen/parent.py | 3 ++ mitogen/podman.py | 74 +++++++++++++++++++++++++++++++++ tests/data/stubs/stub-podman.py | 8 ++++ tests/podman_test.py | 52 +++++++++++++++++++++++ 7 files changed, 153 insertions(+) create mode 100644 mitogen/podman.py create mode 100755 tests/data/stubs/stub-podman.py create mode 100644 tests/podman_test.py diff --git a/docs/api.rst b/docs/api.rst index 9bc32861..3dab62c1 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -367,6 +367,20 @@ Connection Methods Filename or complete path to the ``lxc`` binary. ``PATH`` will be searched if given as a filename. Defaults to ``lxc``. +.. currentmodule:: mitogen.parent +.. method:: Router.podman (container=None, podman_path=None, username=None, \**kwargs) + + Construct a context on the local machine over a ``podman`` invocation. + Accepts all parameters accepted by :meth:`local`, in addition to: + + :param str container: + The name of the Podman container to connect to. + :param str podman_path: + Filename or complete path to the ``podman`` binary. ``PATH`` will be + searched if given as a filename. Defaults to ``podman``. + :param str username: + Username to use, defaults to unset. + .. method:: Router.setns (container, kind, username=None, docker_path=None, lxc_info_path=None, machinectl_path=None, \**kwargs) Construct a context in the style of :meth:`local`, but change the diff --git a/docs/changelog.rst b/docs/changelog.rst index 5d617432..1dbe99a8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,7 @@ v0.3.1.dev0 (unreleased) * :gh:issue:`869` Continuous Integration tests are now run with Tox * :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 +* :gh:issue:`860` Add initial support for podman connection (w/o Ansible support yet) v0.3.0 (2021-11-24) diff --git a/mitogen/core.py b/mitogen/core.py index 802ac45e..e796129d 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -1254,6 +1254,7 @@ class Importer(object): 'minify', 'os_fork', 'parent', + 'podman', 'select', 'service', 'setns', diff --git a/mitogen/parent.py b/mitogen/parent.py index 3b4dca8a..7ca90ab4 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -2505,6 +2505,9 @@ class Router(mitogen.core.Router): def ssh(self, **kwargs): return self.connect(u'ssh', **kwargs) + def podman(self, **kwargs): + return self.connect(u'podman', **kwargs) + class Reaper(object): """ diff --git a/mitogen/podman.py b/mitogen/podman.py new file mode 100644 index 00000000..01e02e94 --- /dev/null +++ b/mitogen/podman.py @@ -0,0 +1,74 @@ +# Copyright 2019, David Wilson +# Copyright 2021, Mitogen contributors +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +# !mitogen: minify_safe + +import logging + +import mitogen.core +import mitogen.parent + + +LOG = logging.getLogger(__name__) + + +class Options(mitogen.parent.Options): + container = None + username = None + podman_path = 'podman' + + def __init__(self, container=None, podman_path=None, username=None, + **kwargs): + super(Options, self).__init__(**kwargs) + assert container is not None + self.container = container + if podman_path: + self.podman_path = podman_path + if username: + self.username = username + + +class Connection(mitogen.parent.Connection): + options_class = Options + child_is_immediate_subprocess = False + + # TODO: better way of capturing errors such as "No such container." + create_child_args = { + 'merge_stdio': True + } + + def _get_name(self): + return u'podman.' + self.options.container + + def get_boot_command(self): + args = [self.options.podman_path, 'exec'] + if self.options.username: + args += ['--user=' + self.options.username] + args += ["--interactive", "--", self.options.container] + return args + super(Connection, self).get_boot_command() diff --git a/tests/data/stubs/stub-podman.py b/tests/data/stubs/stub-podman.py new file mode 100755 index 00000000..28f55189 --- /dev/null +++ b/tests/data/stubs/stub-podman.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +import sys +import os + +os.environ['ORIGINAL_ARGV'] = repr(sys.argv) +os.environ['THIS_IS_STUB_PODMAN'] = '1' +os.execv(sys.executable, sys.argv[sys.argv.index('--') + 2:]) diff --git a/tests/podman_test.py b/tests/podman_test.py new file mode 100644 index 00000000..8ee2d1cd --- /dev/null +++ b/tests/podman_test.py @@ -0,0 +1,52 @@ +import os +import unittest2 + +import mitogen + +import testlib + + +class ConstructorTest(testlib.RouterMixin, testlib.TestCase): + def test_okay(self): + stub_path = testlib.data_path('stubs/stub-podman.py') + + context = self.router.podman( + container='container_name', + podman_path=stub_path, + ) + stream = self.router.stream_by_id(context.context_id) + + argv = eval(context.call(os.getenv, 'ORIGINAL_ARGV')) + expected_call = [ + stub_path, + 'exec', + '--interactive', + '--', + 'container_name', + stream.conn.options.python_path + ] + self.assertEquals(argv[:len(expected_call)], expected_call) + + context = self.router.podman( + container='container_name', + podman_path=stub_path, + username='some_user', + ) + stream = self.router.stream_by_id(context.context_id) + + argv = eval(context.call(os.getenv, 'ORIGINAL_ARGV')) + expected_call = [ + stub_path, + 'exec', + '--user=some_user', + '--interactive', + '--', + 'container_name', + stream.conn.options.python_path + ] + self.assertEquals(argv[:len(expected_call)], expected_call) + + + +if __name__ == '__main__': + unittest2.main() From c61c063b4f9b2b63dcaa86443631a268c9f72870 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 10 Nov 2021 22:34:32 +0000 Subject: [PATCH 13/44] Support for Ansible 3 & 4 fixes #834 Co-authored-by: Claude Becker (@upekkha) Co-authored-by: Dolph Mathews (@dolph) --- .ci/azure-pipelines-steps.yml | 2 +- .ci/azure-pipelines.yml | 37 ++++++++--------- .ci/ci_lib.py | 41 ++++++++++--------- .ci/debops_common_tests.py | 8 +--- .ci/localhost_ansible_tests.py | 14 ++++--- ansible_mitogen/loaders.py | 4 +- ansible_mitogen/transport_config.py | 32 ++++----------- docs/ansible_detailed.rst | 7 ++-- docs/changelog.rst | 1 + setup.py | 1 + .../async/result_shell_echo_hi.yml | 5 ++- .../integration/become/sudo_flags_failure.yml | 12 +++--- .../integration/become/sudo_nonexistent.yml | 4 +- tox.ini | 26 ++++++++---- 14 files changed, 94 insertions(+), 100 deletions(-) diff --git a/.ci/azure-pipelines-steps.yml b/.ci/azure-pipelines-steps.yml index 3249da41..fbf3d8fa 100644 --- a/.ci/azure-pipelines-steps.yml +++ b/.ci/azure-pipelines-steps.yml @@ -13,7 +13,7 @@ steps: - script: python -mpip install tox displayName: Install tooling -- script: tox -e $(tox.env) +- script: tox -e "$(tox.env)" displayName: "Run tests" env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index dd9e9c68..fbfaa2f1 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -25,14 +25,14 @@ jobs: tox.env: py27-mode_mitogen # TODO: test python3, python3 tests are broken - Ans210_27: + Local_Py27: python.version: '2.7' - tox.env: py27-mode_localhost-ansible2.10 + tox.env: py27-mode_localhost-ansible{2.10,3,4} # NOTE: this hangs when ran in Ubuntu 18.04 - Vanilla_210_27: + Vanilla_Py27: python.version: '2.7' - tox.env: py27-mode_localhost-ansible2.10 + tox.env: py27-mode_localhost-ansible{2.10,3,4} STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive @@ -45,22 +45,17 @@ jobs: - template: azure-pipelines-steps.yml strategy: matrix: - Mito27Debian_27: + Mito_Py27: python.version: '2.7' - tox.env: py27-mode_mitogen-distro_debian9 + tox.env: py27-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} - Mito36CentOS6_26: + Mito_Py36: python.version: '3.6' - tox.env: py36-mode_mitogen-distro_centos6 + tox.env: py36-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} - Mito39Debian_27: + Mito_Py39: python.version: '3.9' - tox.env: py39-mode_mitogen-distro_debian9 - - #Py26CentOS7: - #python.version: '2.7' - #MODE: mitogen - #DISTRO: centos6 + tox.env: py39-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} #DebOps_2460_27_27: #python.version: '2.7' @@ -99,14 +94,14 @@ jobs: #DISTROS: debian #STRATEGY: linear - Ansible_210_27: + Ansible_Py27: python.version: '2.7' - tox.env: py27-mode_ansible-ansible2.10 + tox.env: py27-mode_ansible-ansible{2.10,3,4} - Ansible_210_36: + Ansible_Py36: python.version: '3.6' - tox.env: py36-mode_ansible-ansible2.10 + tox.env: py36-mode_ansible-ansible{2.10,3,4} - Ansible_210_39: + Ansible_Py39: python.version: '3.9' - tox.env: py39-mode_ansible-ansible2.10 + tox.env: py39-mode_ansible-ansible{2.10,3,4} diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 1d9b0d73..65b7265a 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -22,6 +22,14 @@ os.chdir( ) ) +_print = print +def print(*args, **kwargs): + file = kwargs.get('file', sys.stdout) + flush = kwargs.pop('flush', False) + _print(*args, **kwargs) + if flush: + file.flush() + # # check_output() monkeypatch cutpasted from testlib.py @@ -71,24 +79,22 @@ def _argv(s, *args): def run(s, *args, **kwargs): - """ Run a command, with arguments, and print timing information + """ Run a command, with arguments >>> rc = run('echo "%s %s"', 'foo', 'bar') - Running: ['/usr/bin/time', '--', 'echo', 'foo bar'] + Running: ['echo', 'foo bar'] foo bar - 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1964maxresident)k - 0inputs+0outputs (0major+71minor)pagefaults 0swaps - Finished running: ['/usr/bin/time', '--', 'echo', 'foo bar'] + Finished running: ['echo', 'foo bar'] >>> rc 0 """ - argv = ['/usr/bin/time', '--'] + _argv(s, *args) - print('Running: %s' % (argv,)) + argv = _argv(s, *args) + print('Running: %s' % (argv,), flush=True) try: ret = subprocess.check_call(argv, **kwargs) - print('Finished running: %s' % (argv,)) + print('Finished running: %s' % (argv,), flush=True) except Exception: - print('Exception occurred while running: %s' % (argv,)) + print('Exception occurred while running: %s' % (argv,), file=sys.stderr, flush=True) raise return ret @@ -155,7 +161,7 @@ def get_output(s, *args, **kwargs): 'foo bar\n' """ argv = _argv(s, *args) - print('Running: %s' % (argv,)) + print('Running: %s' % (argv,), flush=True) return subprocess.check_output(argv, **kwargs) @@ -368,12 +374,10 @@ def start_containers(containers): def verify_procs(hostname, old, new): oldpids = set(pid for pid, _ in old) if any(pid not in oldpids for pid, _ in new): - print('%r had stray processes running:' % (hostname,)) + print('%r had stray processes running:' % (hostname,), file=sys.stderr, flush=True) for pid, line in new: if pid not in oldpids: - print('New process:', line) - - print() + print('New process:', line, flush=True) return False return True @@ -397,13 +401,10 @@ def check_stray_processes(old, containers=None): def dump_file(path): - print() - print('--- %s ---' % (path,)) - print() + print('--- %s ---' % (path,), flush=True) with open(path, 'r') as fp: - print(fp.read().rstrip()) - print('---') - print() + print(fp.read().rstrip(), flush=True) + print('---', flush=True) # SSH passes these through to the container when run interactively, causing diff --git a/.ci/debops_common_tests.py b/.ci/debops_common_tests.py index 97631704..7db8a797 100755 --- a/.ci/debops_common_tests.py +++ b/.ci/debops_common_tests.py @@ -1,8 +1,6 @@ #!/usr/bin/env python -from __future__ import print_function import os -import shutil import sys import ci_lib @@ -60,11 +58,7 @@ with ci_lib.Fold('job_setup'): for container in containers ) - print() - print(' echo --- ansible/inventory/hosts: ---') - ci_lib.run('cat ansible/inventory/hosts') - print('---') - print() + ci_lib.dump_file('ansible/inventory/hosts') # Now we have real host key checking, we need to turn it off os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False' diff --git a/.ci/localhost_ansible_tests.py b/.ci/localhost_ansible_tests.py index 13c77d96..a54d45d9 100755 --- a/.ci/localhost_ansible_tests.py +++ b/.ci/localhost_ansible_tests.py @@ -33,15 +33,19 @@ with ci_lib.Fold('job_setup'): with ci_lib.Fold('machine_prep'): # generate a new ssh key for localhost ssh - os.system("ssh-keygen -P '' -m pem -f ~/.ssh/id_rsa") - os.system("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys") + if not os.path.exists(os.path.expanduser("~/.ssh/id_rsa")): + os.system("ssh-keygen -P '' -m pem -f ~/.ssh/id_rsa") + os.system("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys") + # also generate it for the sudo user - os.system("sudo ssh-keygen -P '' -m pem -f /var/root/.ssh/id_rsa") - os.system("sudo cat /var/root/.ssh/id_rsa.pub | sudo tee -a /var/root/.ssh/authorized_keys") + if os.system("sudo [ -f /var/root/.ssh/id_rsa ]") != 0: + os.system("sudo ssh-keygen -P '' -m pem -f /var/root/.ssh/id_rsa") + os.system("sudo cat /var/root/.ssh/id_rsa.pub | sudo tee -a /var/root/.ssh/authorized_keys") + os.chmod(os.path.expanduser('~/.ssh'), int('0700', 8)) os.chmod(os.path.expanduser('~/.ssh/authorized_keys'), int('0600', 8)) # run chmod through sudo since it's owned by root - os.system('sudo chmod 600 /var/root/.ssh') + os.system('sudo chmod 700 /var/root/.ssh') os.system('sudo chmod 600 /var/root/.ssh/authorized_keys') if os.path.expanduser('~mitogen__user1') == '~mitogen__user1': diff --git a/ansible_mitogen/loaders.py b/ansible_mitogen/loaders.py index c00915d5..b4b98962 100644 --- a/ansible_mitogen/loaders.py +++ b/ansible_mitogen/loaders.py @@ -45,7 +45,7 @@ __all__ = [ import ansible ANSIBLE_VERSION_MIN = (2, 10) -ANSIBLE_VERSION_MAX = (2, 10) +ANSIBLE_VERSION_MAX = (2, 11) NEW_VERSION_MSG = ( "Your Ansible version (%s) is too recent. The most recent version\n" @@ -79,7 +79,7 @@ def assert_supported_release(): if v[:2] > ANSIBLE_VERSION_MAX: raise ansible.errors.AnsibleError( - NEW_VERSION_MSG % (ansible.__version__, ANSIBLE_VERSION_MAX) + NEW_VERSION_MSG % (v, ANSIBLE_VERSION_MAX) ) diff --git a/ansible_mitogen/transport_config.py b/ansible_mitogen/transport_config.py index 2a7a1e58..4babbde3 100644 --- a/ansible_mitogen/transport_config.py +++ b/ansible_mitogen/transport_config.py @@ -451,7 +451,7 @@ class PlayContextSpec(Spec): return self._play_context.private_key_file def ssh_executable(self): - return self._play_context.ssh_executable + return C.config.get_config_value("ssh_executable", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) def timeout(self): return self._play_context.timeout @@ -467,9 +467,9 @@ class PlayContextSpec(Spec): return [ mitogen.core.to_text(term) for s in ( - getattr(self._play_context, 'ssh_args', ''), - getattr(self._play_context, 'ssh_common_args', ''), - getattr(self._play_context, 'ssh_extra_args', '') + C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), + C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), + C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) ) for term in ansible.utils.shlex.shlex_split(s or '') ] @@ -679,10 +679,7 @@ class MitogenViaSpec(Spec): ) def ssh_executable(self): - return ( - self._host_vars.get('ansible_ssh_executable') or - C.ANSIBLE_SSH_EXECUTABLE - ) + return C.config.get_config_value("ssh_executable", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) def timeout(self): # TODO: must come from PlayContext too. @@ -699,22 +696,9 @@ class MitogenViaSpec(Spec): return [ mitogen.core.to_text(term) for s in ( - ( - self._host_vars.get('ansible_ssh_args') or - getattr(C, 'ANSIBLE_SSH_ARGS', None) or - os.environ.get('ANSIBLE_SSH_ARGS') - # TODO: ini entry. older versions. - ), - ( - self._host_vars.get('ansible_ssh_common_args') or - os.environ.get('ANSIBLE_SSH_COMMON_ARGS') - # TODO: ini entry. - ), - ( - self._host_vars.get('ansible_ssh_extra_args') or - os.environ.get('ANSIBLE_SSH_EXTRA_ARGS') - # TODO: ini entry. - ), + C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), + C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), + C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) ) for term in ansible.utils.shlex.shlex_split(s) if s diff --git a/docs/ansible_detailed.rst b/docs/ansible_detailed.rst index c9bbcf51..f17e876e 100644 --- a/docs/ansible_detailed.rst +++ b/docs/ansible_detailed.rst @@ -145,9 +145,10 @@ Testimonials Noteworthy Differences ---------------------- -* Ansible 2.3-2.9 are supported along with Python 2.6, 2.7, 3.6 and 3.7. Verify - your installation is running one of these versions by checking ``ansible - --version`` output. +* Mitogen 0.2.x supports Ansible 2.3-2.9; with Python 2.6, 2.7, or 3.6. + Mitogen 0.3.1+ supports Ansible 2.10, 3, and 4; with Python 2.7, or 3.6-3.9. + Verify your installation is running one of these versions by checking + ``ansible --version`` output. * The ``raw`` action executes as a regular Mitogen connection, which requires Python on the target, precluding its use for installing Python. This will be diff --git a/docs/changelog.rst b/docs/changelog.rst index 1dbe99a8..7a1ae039 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,7 @@ To avail of fixes in an unreleased version, please download a ZIP file v0.3.1.dev0 (unreleased) ------------------------ +* :gh:issue:`834` Support for Ansible 3 and 4 (ansible-core 2.11) * :gh:issue:`869` Continuous Integration tests are now run with Tox * :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 * :gh:issue:`860` Add initial support for podman connection (w/o Ansible support yet) diff --git a/setup.py b/setup.py index 8d3c75df..8275a07e 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ setup( zip_safe = False, classifiers = [ 'Environment :: Console', + 'Frameworks :: Ansible', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: MacOS :: MacOS X', diff --git a/tests/ansible/integration/async/result_shell_echo_hi.yml b/tests/ansible/integration/async/result_shell_echo_hi.yml index d7905e2e..c0cb283c 100644 --- a/tests/ansible/integration/async/result_shell_echo_hi.yml +++ b/tests/ansible/integration/async/result_shell_echo_hi.yml @@ -30,7 +30,10 @@ - async_out.invocation.module_args.creates == None - async_out.invocation.module_args.executable == None - async_out.invocation.module_args.removes == None - - async_out.invocation.module_args.warn == True + # In Ansible 4 (ansible-core 2.11) the warn parameter is deprecated and defaults to false. + # It's scheduled for removal in ansible-core 2.13. + - (ansible_version.full is version("2.11", "<", strict=True) and async_out.invocation.module_args.warn == True) + or (ansible_version.full is version("2.11", ">=", strict=True) and async_out.invocation.module_args.warn == False) - async_out.rc == 0 - async_out.start.startswith("20") - async_out.stderr == "there" diff --git a/tests/ansible/integration/become/sudo_flags_failure.yml b/tests/ansible/integration/become/sudo_flags_failure.yml index 971890dd..fdbb712c 100644 --- a/tests/ansible/integration/become/sudo_flags_failure.yml +++ b/tests/ansible/integration/become/sudo_flags_failure.yml @@ -15,12 +15,12 @@ assert: that: - out.failed - - | - ('sudo: no such option: --derps' in out.msg) or - ("sudo: invalid option -- '-'" in out.module_stderr) or - ("sudo: unrecognized option `--derps'" in out.module_stderr) or - ("sudo: unrecognized option `--derps'" in out.module_stdout) or - ("sudo: unrecognized option '--derps'" in out.module_stderr) + - >- + 'sudo: no such option: --derps' in out.msg + or out.module_stdout is match("sudo: invalid option -- '-'") + or out.module_stderr is match("sudo: invalid option -- '-'") + or out.module_stdout is match("sudo: unrecognized option [`']--derps'") + or out.module_stderr is match("sudo: unrecognized option [`']--derps'") fail_msg: out={{out}} tags: - sudo diff --git a/tests/ansible/integration/become/sudo_nonexistent.yml b/tests/ansible/integration/become/sudo_nonexistent.yml index d0e43214..bc3de7b8 100644 --- a/tests/ansible/integration/become/sudo_nonexistent.yml +++ b/tests/ansible/integration/become/sudo_nonexistent.yml @@ -22,8 +22,8 @@ # sudo-1.8.6p3-29.el6_10.3 on RHEL & CentOS 6.10 (final release) # removed user/group error messages, as defence against CVE-2019-14287. - >- - ('sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg)) - or ('chown: slartibartfast: illegal user name' in out.module_stderr | default(out.msg)) + 'sudo: unknown user: slartibartfast' in out.module_stdout | default(out.msg) + or 'sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg) or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10') fail_msg: out={{out}} when: diff --git a/tox.ini b/tox.ini index d6a7eccc..6e51d7ed 100644 --- a/tox.ini +++ b/tox.ini @@ -9,16 +9,23 @@ # Last version to support each python version # -# tox vir'env pip ansible ansible coverage -# control target +# Python tox virt'env pip A cntllr A target coverage # ========== ======== ======== ======== ======== ======== ======== # python2.4 1.4 1.8 1.1 2.3? # python2.5 1.6.1 1.9.1 1.3.1 ??? -# python2.6 2.9.1 15.2.0 9.0.3 2.6.20 4.5.4 -# python2.7 20.3 2.10 -# python3.5 2.10 -# python3.6 2.10 -# python3.7 2.10 +# python2.6 2.9.1 15.2.0 9.0.3 2.6.20 2.13 4.5.4 +# python2.7 20.3 2.11 +# python3.5 2.11 +# python3.6 2.11 +# python3.7 2.11 + +# Ansible Dependency +# ================== ====================== +# ansible <= 2.9 +# ansible == 2.10.* ansible-base ~= 2.10.0 +# ansible == 3.* ansible-base ~= 2.10.0 +# ansible == 4.* ansible-core ~= 2.11.0 +# ansible == 5.* ansible-core ~= 2.12.0 # pip --no-python-version-warning # pip --disable-pip-version-check @@ -28,7 +35,7 @@ [tox] envlist = init, - py{27,36,39}-mode_ansible-ansible2.10, + py{27,36,39}-mode_ansible-ansible{2.10,3,4}, py{27,36,39}-mode_mitogen-distro_centos{6,7,8}, py{27,36,39}-mode_mitogen-distro_debian{9,10,11}, py{27,36,39}-mode_mitogen-distro_ubuntu{1604,1804,2004}, @@ -54,6 +61,9 @@ deps = ansible2.9: ansible=2.9.6 ansible2.10: ansible-base<2.10.14 ansible2.10: ansible==2.10.0 + ansible3: ansible-base<2.10.14 + ansible3: ansible==3.4.0 + ansible4: ansible==4.8.0 install_command = python -m pip --no-python-version-warning install {opts} {packages} commands_pre = From dd6d73db37d64b6c383ddbbb9c9be49505adf78d Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Fri, 12 Nov 2021 23:51:24 +0000 Subject: [PATCH 14/44] mitogen.parent: Eliminate use of platform module in first stage This reduces the size of the initial SSH command by 204 bytes, & may fix errors running Mitogen on macOS. AFAICT platform was used but not imported. Before ``` $ python ./preamble_size.py SSH command size: 833 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97565 95.3KiB 50427 49.2KiB 51.7% 12689 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48732 47.6KiB 24569 24.0KiB 50.4% 6768 6.6KiB 13.9% ``` After ``` $ python preamble_size.py SSH command size: 629 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97543 95.3KiB 50357 49.2KiB 51.6% 12665 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48732 47.6KiB 24569 24.0KiB 50.4% 6768 6.6KiB 13.9% ``` --- docs/changelog.rst | 1 + mitogen/parent.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7a1ae039..5609430f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,7 @@ v0.3.1.dev0 (unreleased) * :gh:issue:`869` Continuous Integration tests are now run with Tox * :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 * :gh:issue:`860` Add initial support for podman connection (w/o Ansible support yet) +* :gh:issue:`873` `python -c ...` first stage no longer uses :py:mod:`platform`` to detect the macOS release v0.3.0 (2021-11-24) diff --git a/mitogen/parent.py b/mitogen/parent.py index 7ca90ab4..251aee66 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -42,7 +42,6 @@ import heapq import inspect import logging import os -import platform import re import signal import socket @@ -1410,9 +1409,12 @@ class Connection(object): # their respective values. # * CONTEXT_NAME must be prefixed with the name of the Python binary in # order to allow virtualenvs to detect their install prefix. - # * For Darwin, OS X installs a craptacular argv0-introspecting Python - # version switcher as /usr/bin/python. Override attempts to call it - # with an explicit call to python2.7 + # * macOS <= 10.14 (Darwin <= 18) install an unreliable Python version + # switcher as /usr/bin/python, which introspects argv0. To workaround + # it we redirect attempts to call /usr/bin/python with an explicit + # call to /usr/bin/python2.7. macOS 10.15+ (Darwin 19+) removed it. + # On these versions /usr/bin/python is a symlink to + # /System/Library/Frameworks/Python.framework/Versions/2.7/.../Python # # Locals: # R: read side of interpreter stdin. @@ -1435,11 +1437,7 @@ class Connection(object): os.close(r) os.close(W) os.close(w) - # this doesn't apply anymore to Mac OSX 10.15+ (Darwin 19+), new interpreter looks like this: - # /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python - if sys.platform == 'darwin' and sys.executable == '/usr/bin/python' and \ - int(platform.release()[:2]) < 19: - sys.executable += sys.version[:3] + if sys.executable+sys.platform=='/usr/bin/pythondarwin'and os.uname()[2]<'19':sys.executable+='2.7' os.environ['ARGV0']=sys.executable os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)') os.write(1,'MITO000\n'.encode()) From 7bdec56a702642a6f2dd2c8f6001fd30386f4add Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 17 Nov 2021 22:09:31 +0000 Subject: [PATCH 15/44] ci: One Tox environment per Azure job Should result in - better isolation of faults - easier retries of failed jobs - quicker test completion, to to more efficient queueing. This does not expand test coverage, merely rearranges the tests already run. --- .ci/azure-pipelines.yml | 140 +++++++++++++++++++++++++++++++++++----- 1 file changed, 123 insertions(+), 17 deletions(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index fbfaa2f1..8045514e 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -20,19 +20,35 @@ jobs: vmImage: macOS-10.15 strategy: matrix: - Mito27_27: + Mito_27: python.version: '2.7' tox.env: py27-mode_mitogen # TODO: test python3, python3 tests are broken - Local_Py27: + Loc_27_210: python.version: '2.7' - tox.env: py27-mode_localhost-ansible{2.10,3,4} + tox.env: py27-mode_localhost-ansible2.10 + Loc_27_3: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible3 + Loc_27_4: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible4 # NOTE: this hangs when ran in Ubuntu 18.04 - Vanilla_Py27: + Van_27_210: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible2.10 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_3: python.version: '2.7' - tox.env: py27-mode_localhost-ansible{2.10,3,4} + tox.env: py27-mode_localhost-ansible3 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_4: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible4 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive @@ -45,17 +61,89 @@ jobs: - template: azure-pipelines-steps.yml strategy: matrix: - Mito_Py27: + Mito_27_centos6: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_centos6 + Mito_27_centos7: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_centos7 + Mito_27_centos8: python.version: '2.7' - tox.env: py27-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} + tox.env: py27-mode_mitogen-distro_centos8 + Mito_27_debian9: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_debian9 + Mito_27_debian10: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_debian10 + Mito_27_debian11: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_debian11 + Mito_27_ubuntu1604: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_ubuntu1604 + Mito_27_ubuntu1804: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_ubuntu1804 + Mito_27_ubuntu2004: + python.version: '2.7' + tox.env: py27-mode_mitogen-distro_ubuntu2004 - Mito_Py36: + Mito_36_centos6: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_centos6 + Mito_36_centos7: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_centos7 + Mito_36_centos8: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_centos8 + Mito_36_debian9: python.version: '3.6' - tox.env: py36-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} + tox.env: py36-mode_mitogen-distro_debian9 + Mito_36_debian10: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_debian10 + Mito_36_debian11: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_debian11 + Mito_36_ubuntu1604: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_ubuntu1604 + Mito_36_ubuntu1804: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_ubuntu1804 + Mito_36_ubuntu2004: + python.version: '3.6' + tox.env: py36-mode_mitogen-distro_ubuntu2004 - Mito_Py39: + Mito_39_centos6: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_centos6 + Mito_39_centos7: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_centos7 + Mito_39_centos8: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_centos8 + Mito_39_debian9: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_debian9 + Mito_39_debian10: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_debian10 + Mito_39_debian11: python.version: '3.9' - tox.env: py39-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004} + tox.env: py39-mode_mitogen-distro_debian11 + Mito_39_ubuntu1604: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_ubuntu1604 + Mito_39_ubuntu1804: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_ubuntu1804 + Mito_39_ubuntu2004: + python.version: '3.9' + tox.env: py39-mode_mitogen-distro_ubuntu2004 #DebOps_2460_27_27: #python.version: '2.7' @@ -94,14 +182,32 @@ jobs: #DISTROS: debian #STRATEGY: linear - Ansible_Py27: + Ans_27_210: + python.version: '2.7' + tox.env: py27-mode_ansible-ansible2.10 + Ans_27_3: + python.version: '2.7' + tox.env: py27-mode_ansible-ansible3 + Ans_27_4: python.version: '2.7' - tox.env: py27-mode_ansible-ansible{2.10,3,4} + tox.env: py27-mode_ansible-ansible4 - Ansible_Py36: + Ans_36_210: python.version: '3.6' - tox.env: py36-mode_ansible-ansible{2.10,3,4} + tox.env: py36-mode_ansible-ansible2.10 + Ans_36_3: + python.version: '3.6' + tox.env: py36-mode_ansible-ansible3 + Ans_36_4: + python.version: '3.6' + tox.env: py36-mode_ansible-ansible4 - Ansible_Py39: + Ans_39_210: + python.version: '3.9' + tox.env: py39-mode_ansible-ansible2.10 + Ans_39_3: + python.version: '3.9' + tox.env: py39-mode_ansible-ansible3 + Ans_39_4: python.version: '3.9' - tox.env: py39-mode_ansible-ansible{2.10,3,4} + tox.env: py39-mode_ansible-ansible4 From e6bc53ca3a070e1c2b6c70eb0cc2e2fae7a6b4fa Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 18 Nov 2021 18:40:19 +0000 Subject: [PATCH 16/44] mitogen.parent: Remove tabs from minimized first stage Saves 4 bytes Before ``` $ python preamble_size.py SSH command size: 629 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97497 95.2KiB 50356 49.2KiB 51.6% 12665 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48732 47.6KiB 24569 24.0KiB 50.4% 6768 6.6KiB 13.9% ``` After ``` $ python preamble_size.py SSH command size: 625 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97496 95.2KiB 50355 49.2KiB 51.6% 12663 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48732 47.6KiB 24569 24.0KiB 50.4% 6768 6.6KiB 13.9% ``` --- docs/changelog.rst | 1 + mitogen/parent.py | 2 +- preamble_size.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 preamble_size.py diff --git a/docs/changelog.rst b/docs/changelog.rst index 5609430f..0ac50758 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -26,6 +26,7 @@ v0.3.1.dev0 (unreleased) * :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 * :gh:issue:`860` Add initial support for podman connection (w/o Ansible support yet) * :gh:issue:`873` `python -c ...` first stage no longer uses :py:mod:`platform`` to detect the macOS release +* :gh:issue:`876` `python -c ...` first stage no longer contains tab characters, to reduce size v0.3.0 (2021-11-24) diff --git a/mitogen/parent.py b/mitogen/parent.py index 251aee66..44ff9aba 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -1467,7 +1467,7 @@ class Connection(object): def get_boot_command(self): source = inspect.getsource(self._first_stage) source = textwrap.dedent('\n'.join(source.strip().split('\n')[2:])) - source = source.replace(' ', '\t') + source = source.replace(' ', ' ') source = source.replace('CONTEXT_NAME', self.options.remote_name) preamble_compressed = self.get_preamble() source = source.replace('PREAMBLE_COMPRESSED_LEN', diff --git a/preamble_size.py b/preamble_size.py old mode 100644 new mode 100755 index f0d1e804..efb46eae --- a/preamble_size.py +++ b/preamble_size.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """ Print the size of a typical SSH command line and the bootstrap code sent to new contexts. From e194a6367f2c873fa0daffb1d96c6433947da19d Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 18 Nov 2021 22:22:32 +0000 Subject: [PATCH 17/44] ci: Fix version comparisons involving double digits See https://gist.github.com/moreati/e7507c5b606b12ec0ddafcb7c8debbf1 --- ansible_mitogen/target.py | 2 +- docs/changelog.rst | 1 + .../async/result_shell_echo_hi.yml | 3 +- .../integration/async/runner_one_job.yml | 10 ++-- .../async/runner_two_simultaneous_jobs.yml | 3 +- .../ansible/integration/connection/reset.yml | 6 ++- .../integration/connection/reset_become.yml | 6 ++- .../delegate_to_template.yml | 3 +- .../context_service/disconnect_cleanup.yml | 3 +- .../integration/glibc_caches/resolv_conf.yml | 37 +++++++-------- .../ansible_2_8_tests.yml | 47 +++++++++++++------ .../runner/custom_perl_json_args_module.yml | 5 +- .../runner/custom_perl_want_json_module.yml | 5 +- .../integration/stub_connections/kubectl.yml | 3 +- .../custom_python_detect_environment.py | 10 +++- ..._109__target_has_old_ansible_installed.yml | 3 +- .../issue_152__virtualenv_python_fails.yml | 12 +++-- .../issue_590__sys_modules_crap.yml | 3 +- 18 files changed, 104 insertions(+), 58 deletions(-) diff --git a/ansible_mitogen/target.py b/ansible_mitogen/target.py index 652b5adc..7b10e163 100644 --- a/ansible_mitogen/target.py +++ b/ansible_mitogen/target.py @@ -144,7 +144,7 @@ def subprocess__Popen__close_fds(self, but): if ( sys.platform.startswith(u'linux') and - sys.version < u'3.0' and + sys.version_info < (3,) and hasattr(subprocess.Popen, u'_close_fds') and not mitogen.is_master ): diff --git a/docs/changelog.rst b/docs/changelog.rst index 0ac50758..da9d732c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -27,6 +27,7 @@ v0.3.1.dev0 (unreleased) * :gh:issue:`860` Add initial support for podman connection (w/o Ansible support yet) * :gh:issue:`873` `python -c ...` first stage no longer uses :py:mod:`platform`` to detect the macOS release * :gh:issue:`876` `python -c ...` first stage no longer contains tab characters, to reduce size +* :gh:issue:`878` Continuous Integration tests now correctly perform comparisons of 2 digit versions v0.3.0 (2021-11-24) diff --git a/tests/ansible/integration/async/result_shell_echo_hi.yml b/tests/ansible/integration/async/result_shell_echo_hi.yml index c0cb283c..6eb31702 100644 --- a/tests/ansible/integration/async/result_shell_echo_hi.yml +++ b/tests/ansible/integration/async/result_shell_echo_hi.yml @@ -46,7 +46,8 @@ that: - async_out.invocation.module_args.stdin == None fail_msg: async_out={{async_out}} - when: ansible_version.full > '2.4' + when: + - ansible_version.full is version('2.4', '>=', strict=True) vars: async_out: "{{result.content|b64decode|from_json}}" tags: diff --git a/tests/ansible/integration/async/runner_one_job.yml b/tests/ansible/integration/async/runner_one_job.yml index cf33ae56..15e02efa 100644 --- a/tests/ansible/integration/async/runner_one_job.yml +++ b/tests/ansible/integration/async/runner_one_job.yml @@ -41,9 +41,9 @@ - result1.changed == True # ansible/b72e989e1837ccad8dcdc926c43ccbc4d8cdfe44 - | - (ansible_version.full is version('2.8', ">=") and + (ansible_version.full is version('2.8', ">=", strict=True) and result1.cmd == "echo alldone;\nsleep 1;\n") or - (ansible_version.full is version('2.8', '<') and + (ansible_version.full is version('2.8', '<', strict=True) and result1.cmd == "echo alldone;\n sleep 1;") - result1.delta|length == 14 - result1.start|length == 26 @@ -58,12 +58,14 @@ - result1.stdout == "alldone" - result1.stdout_lines == ["alldone"] fail_msg: result1={{result1}} - when: ansible_version.full is version('2.8', '>') # ansible#51393 + when: + - ansible_version.full is version('2.8', '>', strict=True) # ansible#51393 - assert: that: - result1.failed == False fail_msg: result1={{result1}} - when: ansible_version.full is version('2.4', '>') + when: + - ansible_version.full is version('2.4', '>', strict=True) tags: - runner_one_job diff --git a/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml b/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml index af102f19..6eda88aa 100644 --- a/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml +++ b/tests/ansible/integration/async/runner_two_simultaneous_jobs.yml @@ -62,6 +62,7 @@ that: - result2.stdout == 'im_alive' fail_msg: result2={{result2}} - when: ansible_version.full > '2.8' # ansible#51393 + when: + - ansible_version.full is version('2.8', '>=', strict=True) # ansible#51393 tags: - runner_two_simultaneous_jobs diff --git a/tests/ansible/integration/connection/reset.yml b/tests/ansible/integration/connection/reset.yml index ccad928e..1ee38817 100644 --- a/tests/ansible/integration/connection/reset.yml +++ b/tests/ansible/integration/connection/reset.yml @@ -10,10 +10,12 @@ when: not is_mitogen - debug: msg="reset.yml skipped on Ansible<2.5.6" - when: ansible_version.full < '2.5.6' + when: + - ansible_version.full is version('2.5.6', '<', strict=True) - meta: end_play - when: ansible_version.full < '2.5.6' + when: + - ansible_version.full is version('2.5.6', '<', strict=True) - custom_python_detect_environment: register: out diff --git a/tests/ansible/integration/connection/reset_become.yml b/tests/ansible/integration/connection/reset_become.yml index fe29dfed..a36cbf1a 100644 --- a/tests/ansible/integration/connection/reset_become.yml +++ b/tests/ansible/integration/connection/reset_become.yml @@ -6,10 +6,12 @@ gather_facts: false tasks: - debug: msg="reset_become.yml skipped on Ansible<2.5.6" - when: ansible_version.full < '2.5.6' + when: + - ansible_version.full is version('2.5.6', '<', strict=True) - meta: end_play - when: ansible_version.full < '2.5.6' + when: + - ansible_version.full is version('2.5.6', '<', strict=True) - name: save pid of the become acct custom_python_detect_environment: diff --git a/tests/ansible/integration/connection_delegation/delegate_to_template.yml b/tests/ansible/integration/connection_delegation/delegate_to_template.yml index 8e048fa4..be083ff9 100644 --- a/tests/ansible/integration/connection_delegation/delegate_to_template.yml +++ b/tests/ansible/integration/connection_delegation/delegate_to_template.yml @@ -20,7 +20,8 @@ when: not is_mitogen - meta: end_play - when: ansible_version.full < '2.4' + when: + - ansible_version.full is version('2.4', '<', strict=True) - mitogen_get_stack: delegate_to: "{{ physical_host }}" diff --git a/tests/ansible/integration/context_service/disconnect_cleanup.yml b/tests/ansible/integration/context_service/disconnect_cleanup.yml index 4f846535..48304120 100644 --- a/tests/ansible/integration/context_service/disconnect_cleanup.yml +++ b/tests/ansible/integration/context_service/disconnect_cleanup.yml @@ -9,7 +9,8 @@ when: not is_mitogen - meta: end_play - when: ansible_version.full < '2.5.6' + when: + - ansible_version.full is version('2.5.6', '<', strict=True) # Start with a clean slate. - mitogen_shutdown_all: diff --git a/tests/ansible/integration/glibc_caches/resolv_conf.yml b/tests/ansible/integration/glibc_caches/resolv_conf.yml index e2894e58..e83ce38e 100644 --- a/tests/ansible/integration/glibc_caches/resolv_conf.yml +++ b/tests/ansible/integration/glibc_caches/resolv_conf.yml @@ -8,36 +8,35 @@ vars: ansible_become_pass: has_sudo_pubkey_password tasks: - - mitogen_test_gethostbyname: name: www.google.com register: out - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] - shell: cp /etc/resolv.conf /tmp/resolv.conf - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] - shell: echo > /etc/resolv.conf - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] - mitogen_test_gethostbyname: name: www.google.com register: out ignore_errors: true - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] - shell: cat /tmp/resolv.conf > /etc/resolv.conf - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] - assert: that: @@ -45,8 +44,8 @@ - '"Name or service not known" in out.msg or "Temporary failure in name resolution" in out.msg' fail_msg: out={{out}} - when: | - ansible_virtualization_type == "docker" and - ansible_python_version > "2.5" + when: + - ansible_facts.virtualization_type == "docker" + - ansible_facts.python.version_info[:2] >= [2, 5] tags: - resolv_conf diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index 838b2d86..2dea4f8b 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -132,27 +132,45 @@ that: - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' fail_msg: auto_out={{auto_out}} - when: distro == 'fedora' and distro_version is version('23', '>=') + when: + - distro == 'fedora' + - distro_version is version('23.0', '>=', strict=True) - - name: rhel assertions + - name: rhel < 8 assertions assert: that: - # rhel 6/7 - - (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and distro_version is version('8','<')) or distro_version is version('8','>=') - # rhel 8+ - - (auto_out.ansible_facts.discovered_interpreter_python == '/usr/libexec/platform-python' and distro_version is version('8','>=')) or distro_version is version('8','<') + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' fail_msg: auto_out={{auto_out}} - when: distro in ('redhat', 'centos') + when: + - distro in ('redhat', 'centos') + - distro_version is version('8.0', '<', strict=true) - - name: ubuntu assertions + - name: rhel 8+ assertions assert: that: - # ubuntu < 16 - - (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and distro_version is version('16.04','<')) or distro_version is version('16.04','>=') - # ubuntu >= 16 - - (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' and distro_version is version('16.04','>=')) or distro_version is version('16.04','<') + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/libexec/platform-python' fail_msg: auto_out={{auto_out}} - when: distro == 'ubuntu' + when: + - distro in ('redhat', 'centos') + - distro_version is version('8.0', '>=', strict=true) + + - name: ubuntu < 16.04 assertions + assert: + that: + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' + fail_msg: auto_out={{auto_out}} + when: + - distro == 'ubuntu' + - distro_version is version('16.04', '<', strict=true) + + - name: ubuntu 16.04+ assertions + assert: + that: + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' + fail_msg: auto_out={{auto_out}} + when: + - distro == 'ubuntu' + - distro_version is version('16.04', '>=', strict=True) - name: mac assertions assert: @@ -163,6 +181,7 @@ always: - meta: clear_facts - when: ansible_version.full is version_compare('2.8.0', '>=') + when: + - ansible_version.full is version_compare('2.8.0', '>=', strict=True) tags: - ansible_2_8_tests diff --git a/tests/ansible/integration/runner/custom_perl_json_args_module.yml b/tests/ansible/integration/runner/custom_perl_json_args_module.yml index 6201318a..68230420 100644 --- a/tests/ansible/integration/runner/custom_perl_json_args_module.yml +++ b/tests/ansible/integration/runner/custom_perl_json_args_module.yml @@ -13,11 +13,12 @@ - out.results[0].message == 'I am a perl script! Here is my input.' fail_msg: out={{out}} - - when: ansible_version.full > '2.4' - assert: + - assert: that: - (not out.changed) - (not out.results[0].changed) fail_msg: out={{out}} + when: + - ansible_version.full is version('2.4', '>=', strict=True) tags: - custom_perl_json_args_module diff --git a/tests/ansible/integration/runner/custom_perl_want_json_module.yml b/tests/ansible/integration/runner/custom_perl_want_json_module.yml index 9c39b1b6..44c39e64 100644 --- a/tests/ansible/integration/runner/custom_perl_want_json_module.yml +++ b/tests/ansible/integration/runner/custom_perl_want_json_module.yml @@ -13,11 +13,12 @@ - out.results[0].message == 'I am a want JSON perl script! Here is my input.' fail_msg: out={{out}} - - when: ansible_version.full > '2.4' - assert: + - assert: that: - (not out.changed) - (not out.results[0].changed) fail_msg: out={{out}} + when: + - ansible_version.full is version('2.4', '>=', strict=True) tags: - custom_perl_want_json_module diff --git a/tests/ansible/integration/stub_connections/kubectl.yml b/tests/ansible/integration/stub_connections/kubectl.yml index e4b881f8..5303f7c7 100644 --- a/tests/ansible/integration/stub_connections/kubectl.yml +++ b/tests/ansible/integration/stub_connections/kubectl.yml @@ -8,7 +8,8 @@ when: not is_mitogen - meta: end_play - when: ansible_version.full < '2.5' + when: + - ansible_version.full is version('2.5', '<', strict=True) - custom_python_detect_environment: vars: diff --git a/tests/ansible/lib/modules/custom_python_detect_environment.py b/tests/ansible/lib/modules/custom_python_detect_environment.py index 9f628a03..3735007d 100644 --- a/tests/ansible/lib/modules/custom_python_detect_environment.py +++ b/tests/ansible/lib/modules/custom_python_detect_environment.py @@ -26,7 +26,15 @@ except NameError: def main(): module = AnsibleModule(argument_spec={}) module.exit_json( - python_version=sys.version[:3], + python={ + 'version': { + 'full': '%i.%i.%i' % sys.version_info[:3], + 'info': list(sys.version_info), + 'major': sys.version_info[0], + 'minor': sys.version_info[1], + 'patch': sys.version_info[2], + }, + }, argv=sys.argv, __file__=__file__, argv_types_correct=all(type(s) is str for s in sys.argv), diff --git a/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml b/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml index fdc61c05..1188b6ce 100644 --- a/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml +++ b/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml @@ -7,7 +7,8 @@ gather_facts: true tasks: - meta: end_play - when: ansible_version.full < '2.6' + when: + - ansible_version.full is version('2.6', '<', strict=True) # Copy the naughty 'ansible' into place. - copy: diff --git a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml index d3bda041..11f94edd 100644 --- a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml +++ b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml @@ -9,27 +9,31 @@ # Can't use pip module because it can't create virtualenvs, must call it # directly. - shell: virtualenv /tmp/issue_152_virtualenv - when: lout.python_version > '2.6' environment: https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}" no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}" PATH: "{{ lookup('env', 'PATH') }}" + when: + - lout.python.version.full is version('2.7', '>=', strict=True) - custom_python_detect_environment: vars: ansible_python_interpreter: /tmp/issue_152_virtualenv/bin/python register: out - when: lout.python_version > '2.6' + when: + - lout.python.version.full is version('2.7', '>=', strict=True) - assert: that: - out.sys_executable == "/tmp/issue_152_virtualenv/bin/python" fail_msg: out={{out}} - when: lout.python_version > '2.6' + when: + - lout.python.version.full is version('2.7', '>=', strict=True) - file: path: /tmp/issue_152_virtualenv state: absent - when: lout.python_version > '2.6' + when: + - lout.python.version.full is version('2.7', '>=', strict=True) tags: - issue_152 diff --git a/tests/ansible/regression/issue_590__sys_modules_crap.yml b/tests/ansible/regression/issue_590__sys_modules_crap.yml index 52b3ea97..81d9b4b2 100644 --- a/tests/ansible/regression/issue_590__sys_modules_crap.yml +++ b/tests/ansible/regression/issue_590__sys_modules_crap.yml @@ -2,7 +2,8 @@ - hosts: test-targets tasks: - meta: end_play - when: ansible_version.full < '2.8' + when: + - ansible_version.full is version('2.8', '<', strict=True) - custom_python_uses_distro: register: out From 465ac8abffacc4dde2af569e5f2ca00557f8702a Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 11 Feb 2021 23:31:34 +0000 Subject: [PATCH 18/44] ansible: Fix AttributeError in kubectl connection --- .../plugins/connection/mitogen_kubectl.py | 18 +++++++++--------- docs/changelog.rst | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ansible_mitogen/plugins/connection/mitogen_kubectl.py b/ansible_mitogen/plugins/connection/mitogen_kubectl.py index 44d3b50a..7f99376d 100644 --- a/ansible_mitogen/plugins/connection/mitogen_kubectl.py +++ b/ansible_mitogen/plugins/connection/mitogen_kubectl.py @@ -45,17 +45,11 @@ import ansible_mitogen.connection import ansible_mitogen.loaders -_class = ansible_mitogen.loaders.connection_loader__get( +_get_result = ansible_mitogen.loaders.connection_loader__get( 'kubectl', class_only=True, ) -if _class: - kubectl = sys.modules[_class.__module__] - del _class -else: - kubectl = None - class Connection(ansible_mitogen.connection.Connection): transport = 'kubectl' @@ -66,13 +60,19 @@ class Connection(ansible_mitogen.connection.Connection): ) def __init__(self, *args, **kwargs): - if kubectl is None: + if not _get_result: raise AnsibleConnectionFailure(self.not_supported_msg) super(Connection, self).__init__(*args, **kwargs) def get_extra_args(self): + try: + # Ansible < 2.10, _get_result is the connection class + connection_options = _get_result.connection_options + except AttributeError: + # Ansible >= 2.10, _get_result is a get_with_context_result + connection_options = _get_result.object.connection_options parameters = [] - for key, option in iteritems(kubectl.CONNECTION_OPTIONS): + for key, option in iteritems(connection_options): if self.get_task_var('ansible_' + key) is not None: parameters += [ option, self.get_task_var('ansible_' + key) ] diff --git a/docs/changelog.rst b/docs/changelog.rst index da9d732c..787dd1c4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -28,6 +28,7 @@ v0.3.1.dev0 (unreleased) * :gh:issue:`873` `python -c ...` first stage no longer uses :py:mod:`platform`` to detect the macOS release * :gh:issue:`876` `python -c ...` first stage no longer contains tab characters, to reduce size * :gh:issue:`878` Continuous Integration tests now correctly perform comparisons of 2 digit versions +* :gh:issue:`878` Kubectl connector fixed with Ansible 2.10 and above v0.3.0 (2021-11-24) From d9b8d50d4e22be8f135bef346ffee3bd89a5eba4 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Sat, 20 Nov 2021 22:54:45 +0000 Subject: [PATCH 19/44] Fix ansible.__version__ comparisons with multi-digit components Ansible 2.8 is older than Ansible 2.10, but `'2.8' < '2.10' == False` --- ansible_mitogen/loaders.py | 9 +++------ ansible_mitogen/mixins.py | 10 ++++++---- ansible_mitogen/utils.py | 13 +++++++++++++ .../lib/modules/custom_python_uses_distro.py | 12 ++++++++++-- 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 ansible_mitogen/utils.py diff --git a/ansible_mitogen/loaders.py b/ansible_mitogen/loaders.py index b4b98962..85b6c0e5 100644 --- a/ansible_mitogen/loaders.py +++ b/ansible_mitogen/loaders.py @@ -31,7 +31,8 @@ Stable names for PluginLoader instances across Ansible versions. """ from __future__ import absolute_import -import distutils.version + +import ansible_mitogen.utils __all__ = [ 'action_loader', @@ -42,7 +43,6 @@ __all__ = [ 'strategy_loader', ] -import ansible ANSIBLE_VERSION_MIN = (2, 10) ANSIBLE_VERSION_MAX = (2, 11) @@ -68,10 +68,7 @@ def assert_supported_release(): Throw AnsibleError with a descriptive message in case of being loaded into an unsupported Ansible release. """ - v = ansible.__version__ - if not isinstance(v, tuple): - v = tuple(distutils.version.LooseVersion(v).version) - + v = ansible_mitogen.utils.ansible_version if v[:2] < ANSIBLE_VERSION_MIN: raise ansible.errors.AnsibleError( OLD_VERSION_MSG % (v, ANSIBLE_VERSION_MIN) diff --git a/ansible_mitogen/mixins.py b/ansible_mitogen/mixins.py index 7e7a3ff0..c4d793e8 100644 --- a/ansible_mitogen/mixins.py +++ b/ansible_mitogen/mixins.py @@ -53,6 +53,8 @@ import mitogen.utils import ansible_mitogen.connection import ansible_mitogen.planner import ansible_mitogen.target +import ansible_mitogen.utils + from ansible.module_utils._text import to_text try: @@ -226,7 +228,7 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): with a pipelined call to :func:`ansible_mitogen.target.prune_tree`. """ LOG.debug('_remove_tmp_path(%r)', tmp_path) - if tmp_path is None and ansible.__version__ > '2.6': + if tmp_path is None and ansible_mitogen.utils.ansible_version[:2] >= (2, 6): tmp_path = self._connection._shell.tmpdir # 06f73ad578d if tmp_path is not None: self._connection.get_chain().call_no_reply( @@ -335,7 +337,7 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): def _set_temp_file_args(self, module_args, wrap_async): # Ansible>2.5 module_utils reuses the action's temporary directory if # one exists. Older versions error if this key is present. - if ansible.__version__ > '2.5': + if ansible_mitogen.utils.ansible_version[:2] >= (2, 5): if wrap_async: # Sharing is not possible with async tasks, as in that case, # the directory must outlive the action plug-in. @@ -346,7 +348,7 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): # If _ansible_tmpdir is unset, Ansible>2.6 module_utils will use # _ansible_remote_tmp as the location to create the module's temporary # directory. Older versions error if this key is present. - if ansible.__version__ > '2.6': + if ansible_mitogen.utils.ansible_version[:2] >= (2, 6): module_args['_ansible_remote_tmp'] = ( self._connection.get_good_temp_dir() ) @@ -393,7 +395,7 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): ) ) - if tmp and ansible.__version__ < '2.5' and delete_remote_tmp: + if tmp and delete_remote_tmp and ansible_mitogen.utils.ansible_version[:2] < (2, 5): # Built-in actions expected tmpdir to be cleaned up automatically # on _execute_module(). self._remove_tmp_path(tmp) diff --git a/ansible_mitogen/utils.py b/ansible_mitogen/utils.py new file mode 100644 index 00000000..399c181a --- /dev/null +++ b/ansible_mitogen/utils.py @@ -0,0 +1,13 @@ +from __future__ import absolute_import + +import distutils.version + +import ansible + +__all__ = [ + 'ansible_version', +] + +ansible_version = tuple(distutils.version.LooseVersion(ansible.__version__).version) +del distutils +del ansible diff --git a/tests/ansible/lib/modules/custom_python_uses_distro.py b/tests/ansible/lib/modules/custom_python_uses_distro.py index 1fc31b4e..6b3a356b 100644 --- a/tests/ansible/lib/modules/custom_python_uses_distro.py +++ b/tests/ansible/lib/modules/custom_python_uses_distro.py @@ -5,14 +5,22 @@ import ansible from ansible.module_utils.basic import AnsibleModule -if ansible.__version__ > '2.8': +def try_int(s): + try: + return int(s, 10) + except ValueError: + return s + +ansible_version = tuple(try_int(s) for s in ansible.__version__.split('.')) + +if ansible_version[:2] >= (2, 8): from ansible.module_utils import distro else: distro = None def main(): module = AnsibleModule(argument_spec={}) - if ansible.__version__ > '2.8': + if ansible_version[:2] >= (2, 8): module.exit_json(info=distro.info()) else: module.exit_json(info={'id': None}) From 552819e7658d8a8764a3d4d8976e9ac3ba6c49c6 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 23 Nov 2021 23:46:47 +0000 Subject: [PATCH 20/44] mitogen.parent: Detect and avoid Python2.7 wrapper on macOS 11 & 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this errors such as the following occur ``` ✗ MITOGEN_LOG_LEVEL=DEBUG python3 foo.py Python: execv: (null): No such file or directory Traceback (most recent call last): File "foo.py", line 16, in target = router.local(python_path='/usr/bin/python2.7', debug=True) File "/Users/alex/src/mitogen2/mitogen/parent.py", line 2486, in local return self.connect(u'local', **kwargs) File "/Users/alex/src/mitogen2/mitogen/parent.py", line 2446, in connect return self._connect(klass, **mitogen.core.Kwargs(kwargs)) File "/Users/alex/src/mitogen2/mitogen/parent.py", line 2426, in _connect conn.connect(context=context) File "/Users/alex/src/mitogen2/mitogen/parent.py", line 1708, in connect raise self.exception mitogen.parent.EofError: EOF on stream; last 100 lines received: MITO000 MITO001 ``` Before ``` $ ./preamble_size.py SSH command size: 625 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97496 95.2KiB 50355 49.2KiB 51.6% 12663 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48732 47.6KiB 24569 24.0KiB 50.4% 6768 6.6KiB 13.9% ``` After ``` $ ./preamble_size.py SSH command size: 705 Bootstrap (mitogen.core) size: 17007 (16.61KiB) Original Minimized Compressed mitogen.parent 97885 95.6KiB 50516 49.3KiB 51.6% 12728 12.4KiB 13.0% mitogen.fork 8436 8.2KiB 4130 4.0KiB 49.0% 1648 1.6KiB 19.5% mitogen.ssh 10892 10.6KiB 6952 6.8KiB 63.8% 2113 2.1KiB 19.4% mitogen.sudo 12089 11.8KiB 5924 5.8KiB 49.0% 2249 2.2KiB 18.6% mitogen.select 12325 12.0KiB 2929 2.9KiB 23.8% 964 0.9KiB 7.8% mitogen.service 41644 40.7KiB 22431 21.9KiB 53.9% 5886 5.7KiB 14.1% mitogen.fakessh 15599 15.2KiB 8011 7.8KiB 51.4% 2624 2.6KiB 16.8% mitogen.master 48733 47.6KiB 24570 24.0KiB 50.4% 6771 6.6KiB 13.9% ``` --- docs/changelog.rst | 1 + mitogen/parent.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 787dd1c4..9165dbda 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,7 @@ To avail of fixes in an unreleased version, please download a ZIP file v0.3.1.dev0 (unreleased) ------------------------ +* :gh:issue:`774` Fix bootstrap failures on macOS 11.x and 12.x, involving Python 2.7 wrapper * :gh:issue:`834` Support for Ansible 3 and 4 (ansible-core 2.11) * :gh:issue:`869` Continuous Integration tests are now run with Tox * :gh:issue:`869` Continuous Integration tests now cover CentOS 6 & 8, Debian 9 & 11, Ubuntu 16.04 & 20.04 diff --git a/mitogen/parent.py b/mitogen/parent.py index 44ff9aba..c3efe28a 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -1412,9 +1412,12 @@ class Connection(object): # * macOS <= 10.14 (Darwin <= 18) install an unreliable Python version # switcher as /usr/bin/python, which introspects argv0. To workaround # it we redirect attempts to call /usr/bin/python with an explicit - # call to /usr/bin/python2.7. macOS 10.15+ (Darwin 19+) removed it. - # On these versions /usr/bin/python is a symlink to - # /System/Library/Frameworks/Python.framework/Versions/2.7/.../Python + # call to /usr/bin/python2.7. macOS 10.15 (Darwin 19) removed it. + # * macOS 11.x (Darwin 20, Big Sur) and macOS 12.x (Darwin 21, Montery) + # do something slightly different. The Python executable is patched to + # perform an extra execvp(). I don't fully understand the details, but + # setting PYTHON_LAUNCHED_FROM_WRAPPER=1 avoids it. + # * macOS 13.x (Darwin 22?) may remove python 2.x entirely. # # Locals: # R: read side of interpreter stdin. @@ -1437,7 +1440,8 @@ class Connection(object): os.close(r) os.close(W) os.close(w) - if sys.executable+sys.platform=='/usr/bin/pythondarwin'and os.uname()[2]<'19':sys.executable+='2.7' + if os.uname()[0]=='Darwin'and os.uname()[2][:2]<'19'and sys.executable=='/usr/bin/python':sys.executable='/usr/bin/python2.7' + if os.uname()[0]=='Darwin'and os.uname()[2][:2]in'2021'and sys.version[:3]=='2.7':os.environ['PYTHON_LAUNCHED_FROM_WRAPPER']='1' os.environ['ARGV0']=sys.executable os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)') os.write(1,'MITO000\n'.encode()) From 8276b81b7d9fc649ded73484f9340c86c7c8a719 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Fri, 26 Nov 2021 21:51:16 +0000 Subject: [PATCH 21/44] ci: Account for pre-existing children in process leak checks --- tests/testlib.py | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/tests/testlib.py b/tests/testlib.py index d40ce573..ef35e13e 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -1,4 +1,5 @@ +import errno import logging import os import random @@ -11,6 +12,7 @@ import threading import time import traceback +import psutil import unittest2 import mitogen.core @@ -67,7 +69,6 @@ def get_fd_count(): """ Return the number of FDs open by this process. """ - import psutil return psutil.Process().num_fds() @@ -334,6 +335,10 @@ class TestCase(unittest2.TestCase): # Broker() instantiations in setUp() etc. mitogen.fork.on_fork() cls._fd_count_before = get_fd_count() + # Ignore children started by external packages - in particular + # multiprocessing.resource_tracker.main()`, started when some Ansible + # versions instantiate a `multithreading.Lock()`. + cls._children_before = frozenset(psutil.Process().children()) super(TestCase, cls).setUpClass() ALLOWED_THREADS = set([ @@ -361,7 +366,10 @@ class TestCase(unittest2.TestCase): def _teardown_check_fds(self): mitogen.core.Latch._on_fork() if get_fd_count() != self._fd_count_before: - import os; os.system('lsof +E -w -p %s | grep -vw mem' % (os.getpid(),)) + if sys.platform == 'linux': + os.system('lsof +E -w -p %i | grep -vw mem' % (os.getpid(),)) + else: + os.system('lsof -w -p %i | grep -vw mem' % (os.getpid(),)) assert 0, "%s leaked FDs. Count before: %s, after: %s" % ( self, self._fd_count_before, get_fd_count(), ) @@ -374,19 +382,33 @@ class TestCase(unittest2.TestCase): if self.no_zombie_check: return + # pid=0: Wait for any child process in the same process group as us. + # WNOHANG: Don't block if no processes ready to report status. try: pid, status = os.waitpid(0, os.WNOHANG) - except OSError: - return # ECHILD + except OSError as e: + # ECHILD: there are no child processes in our group. + if e.errno == errno.ECHILD: + return + raise if pid: assert 0, "%s failed to reap subprocess %d (status %d)." % ( self, pid, status ) - print('') - print('Children of unit test process:') - os.system('ps uww --ppid ' + str(os.getpid())) + children_after = frozenset(psutil.Process().children()) + children_leaked = children_after.difference(self._children_before) + if not children_leaked: + return + + print('Leaked children of unit test process:') + os.system('ps -o "user,pid,%%cpu,%%mem,vsz,rss,tty,stat,start,time,command" -ww -p %s' + % (','.join(str(p.pid) for p in children_leaked),)) + if self._children_before: + print('Pre-existing children of unit test process:') + os.system('ps -o "user,pid,%%cpu,%%mem,vsz,rss,tty,stat,start,time,command" -ww -p %s' + % (','.join(str(p.pid) for p in self._children_before),)) assert 0, "%s leaked still-running subprocesses." % (self,) def tearDown(self): From cadd393cd74d27cb2e86d41b7c69cd7c39501e51 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 1 Dec 2021 21:01:07 +0000 Subject: [PATCH 22/44] ci: Expand macOS coverage to 10.14, latest release on Azure Pipelines 10.14 will be retired on Azure mid December 2021. I want to get so test runs while we can. --- .ci/azure-pipelines-steps.yml | 3 +- .ci/azure-pipelines.yml | 67 ++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/.ci/azure-pipelines-steps.yml b/.ci/azure-pipelines-steps.yml index fbf3d8fa..50f1a16b 100644 --- a/.ci/azure-pipelines-steps.yml +++ b/.ci/azure-pipelines-steps.yml @@ -9,11 +9,12 @@ steps: displayName: Install python inputs: versionSpec: '$(python.version)' + condition: ne(variables['python.version'], '') - script: python -mpip install tox displayName: Install tooling -- script: tox -e "$(tox.env)" +- script: python -mtox -e "$(tox.env)" displayName: "Run tests" env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 8045514e..81ce05f2 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -9,8 +9,27 @@ #ANSIBLE_VERBOSITY: 3 jobs: +- job: Mac1014 + # vanilla Ansible is really slow + timeoutInMinutes: 120 + steps: + - template: azure-pipelines-steps.yml + pool: + # https://github.com/actions/virtual-environments/blob/main/images/macos/ + vmImage: macOS-10.14 + strategy: + matrix: + Mito_27: + python.version: '2.7' + tox.env: py27-mode_mitogen + Mito_36: + python.version: '3.6' + tox.env: py36-mode_mitogen + Mito_39: + python.version: '3.9' + tox.env: py39-mode_mitogen -- job: Mac +- job: Mac1015 # vanilla Ansible is really slow timeoutInMinutes: 120 steps: @@ -23,6 +42,12 @@ jobs: Mito_27: python.version: '2.7' tox.env: py27-mode_mitogen + Mito_36: + python.version: '3.6' + tox.env: py36-mode_mitogen + Mito_39: + python.version: '3.9' + tox.env: py39-mode_mitogen # TODO: test python3, python3 tests are broken Loc_27_210: @@ -52,6 +77,46 @@ jobs: STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive +- job: MacLatest + # vanilla Ansible is really slow + timeoutInMinutes: 120 + steps: + - template: azure-pipelines-steps.yml + pool: + # https://github.com/actions/virtual-environments/blob/main/images/macos/ + vmImage: macOS-latest + strategy: + matrix: + Mito_27: + tox.env: py27-mode_mitogen + Mito_37: + python.version: '3.7' + tox.env: py37-mode_mitogen + Mito_39: + python.version: '3.9' + tox.env: py39-mode_mitogen + + # TODO: test python3, python3 tests are broken + Loc_27_210: + tox.env: py27-mode_localhost-ansible2.10 + Loc_27_3: + tox.env: py27-mode_localhost-ansible3 + Loc_27_4: + tox.env: py27-mode_localhost-ansible4 + + # NOTE: this hangs when ran in Ubuntu 18.04 + Van_27_210: + tox.env: py27-mode_localhost-ansible2.10 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_3: + tox.env: py27-mode_localhost-ansible3 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_4: + tox.env: py27-mode_localhost-ansible4 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive - job: Linux pool: From 9a19f0ed16044ee467ab511be3b132d42ed1cae2 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 23 Nov 2021 23:49:00 +0000 Subject: [PATCH 23/44] mitogen.master: Fix stdlib discovery when sys.prefix contains symlinks This can be he case when Python has been installed with Homebrew. --- mitogen/master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitogen/master.py b/mitogen/master.py index e54795cb..806120d6 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -108,7 +108,7 @@ def _stdlib_paths(): ] prefixes = (getattr(sys, a, None) for a in attr_candidates) version = 'python%s.%s' % sys.version_info[0:2] - s = set(os.path.abspath(os.path.join(p, 'lib', version)) + s = set(os.path.realpath(os.path.join(p, 'lib', version)) for p in prefixes if p is not None) # When running 'unit2 tests/module_finder_test.py' in a Py2 venv on Ubuntu From 6fb5502a35328bcfaa38a0ce17a18db4e8987e38 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Tue, 7 Dec 2021 11:53:50 +0100 Subject: [PATCH 24/44] issue #874 support for ansible core 2.12 aka. ansible community 5.0 --- ansible_mitogen/loaders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_mitogen/loaders.py b/ansible_mitogen/loaders.py index 85b6c0e5..b8bbb7e8 100644 --- a/ansible_mitogen/loaders.py +++ b/ansible_mitogen/loaders.py @@ -45,7 +45,7 @@ __all__ = [ ANSIBLE_VERSION_MIN = (2, 10) -ANSIBLE_VERSION_MAX = (2, 11) +ANSIBLE_VERSION_MAX = (2, 12) NEW_VERSION_MSG = ( "Your Ansible version (%s) is too recent. The most recent version\n" From 56c341790c14859020d447650da1fc98f6f73891 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 08:12:04 +0100 Subject: [PATCH 25/44] prepare support for ansible community 5 aka. core 2.12 --- docs/ansible_detailed.rst | 2 +- docs/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ansible_detailed.rst b/docs/ansible_detailed.rst index f17e876e..65bcfffd 100644 --- a/docs/ansible_detailed.rst +++ b/docs/ansible_detailed.rst @@ -146,7 +146,7 @@ Noteworthy Differences ---------------------- * Mitogen 0.2.x supports Ansible 2.3-2.9; with Python 2.6, 2.7, or 3.6. - Mitogen 0.3.1+ supports Ansible 2.10, 3, and 4; with Python 2.7, or 3.6-3.9. + Mitogen 0.3.1+ supports Ansible 2.10, 3, 4 and 5; with Python 2.7, or 3.6-3.9. Verify your installation is running one of these versions by checking ``ansible --version`` output. diff --git a/docs/changelog.rst b/docs/changelog.rst index 9165dbda..47586307 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,7 @@ To avail of fixes in an unreleased version, please download a ZIP file v0.3.1.dev0 (unreleased) ------------------------ +* :gh:issue:`874` Support for Ansible 5 (ansible-core 2.12) * :gh:issue:`774` Fix bootstrap failures on macOS 11.x and 12.x, involving Python 2.7 wrapper * :gh:issue:`834` Support for Ansible 3 and 4 (ansible-core 2.11) * :gh:issue:`869` Continuous Integration tests are now run with Tox From 40fc1f8a2585d65f98e05fce2d9ddb557db189a0 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 13:52:13 +0100 Subject: [PATCH 26/44] issue #874 try to implement the testst for ansible 2.12 --- .ci/azure-pipelines.yml | 23 +++++++++++++++++++++++ tox.ini | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 81ce05f2..3d29c796 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -59,6 +59,9 @@ jobs: Loc_27_4: python.version: '2.7' tox.env: py27-mode_localhost-ansible4 + Loc_27_5: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible5 # NOTE: this hangs when ran in Ubuntu 18.04 Van_27_210: @@ -76,6 +79,11 @@ jobs: tox.env: py27-mode_localhost-ansible4 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_5: + python.version: '2.7' + tox.env: py27-mode_localhost-ansible5 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive - job: MacLatest # vanilla Ansible is really slow @@ -103,6 +111,8 @@ jobs: tox.env: py27-mode_localhost-ansible3 Loc_27_4: tox.env: py27-mode_localhost-ansible4 + Loc_27_5: + tox.env: py27-mode_localhost-ansible5 # NOTE: this hangs when ran in Ubuntu 18.04 Van_27_210: @@ -117,6 +127,10 @@ jobs: tox.env: py27-mode_localhost-ansible4 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive + Van_27_5: + tox.env: py27-mode_localhost-ansible5 + STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive - job: Linux pool: @@ -256,6 +270,9 @@ jobs: Ans_27_4: python.version: '2.7' tox.env: py27-mode_ansible-ansible4 + Ans_27_5: + python.version: '2.7' + tox.env: py27-mode_ansible-ansible5 Ans_36_210: python.version: '3.6' @@ -266,6 +283,9 @@ jobs: Ans_36_4: python.version: '3.6' tox.env: py36-mode_ansible-ansible4 + Ans_36_5: + python.version: '3.6' + tox.env: py36-mode_ansible-ansible5 Ans_39_210: python.version: '3.9' @@ -276,3 +296,6 @@ jobs: Ans_39_4: python.version: '3.9' tox.env: py39-mode_ansible-ansible4 + Ans_39_5: + python.version: '3.9' + tox.env: py39-mode_ansible-ansible5 diff --git a/tox.ini b/tox.ini index 6e51d7ed..1e31b9bf 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ [tox] envlist = init, - py{27,36,39}-mode_ansible-ansible{2.10,3,4}, + py{27,36,39}-mode_ansible-ansible{2.10,3,4,5}, py{27,36,39}-mode_mitogen-distro_centos{6,7,8}, py{27,36,39}-mode_mitogen-distro_debian{9,10,11}, py{27,36,39}-mode_mitogen-distro_ubuntu{1604,1804,2004}, @@ -64,6 +64,7 @@ deps = ansible3: ansible-base<2.10.14 ansible3: ansible==3.4.0 ansible4: ansible==4.8.0 + ansible4: ansible==5.0.1 install_command = python -m pip --no-python-version-warning install {opts} {packages} commands_pre = From 13af356bc9138385d34a7dcf4db75afcfdbbae2b Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 14:13:25 +0100 Subject: [PATCH 27/44] issue #874 tox.ini : fixed ansible5 definition --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1e31b9bf..1820fa01 100644 --- a/tox.ini +++ b/tox.ini @@ -64,7 +64,7 @@ deps = ansible3: ansible-base<2.10.14 ansible3: ansible==3.4.0 ansible4: ansible==4.8.0 - ansible4: ansible==5.0.1 + ansible5: ansible==5.0.1 install_command = python -m pip --no-python-version-warning install {opts} {packages} commands_pre = From b0610cb63c4b22ab64fdc7f2592a977cfd6f1b47 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 14:43:07 +0100 Subject: [PATCH 28/44] issue #874 ansible 2.12 requires min python 3.8 on the controller --- .ci/azure-pipelines.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 3d29c796..3484cd4d 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -59,9 +59,6 @@ jobs: Loc_27_4: python.version: '2.7' tox.env: py27-mode_localhost-ansible4 - Loc_27_5: - python.version: '2.7' - tox.env: py27-mode_localhost-ansible5 # NOTE: this hangs when ran in Ubuntu 18.04 Van_27_210: @@ -79,11 +76,6 @@ jobs: tox.env: py27-mode_localhost-ansible4 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive - Van_27_5: - python.version: '2.7' - tox.env: py27-mode_localhost-ansible5 - STRATEGY: linear - ANSIBLE_SKIP_TAGS: resource_intensive - job: MacLatest # vanilla Ansible is really slow @@ -111,8 +103,6 @@ jobs: tox.env: py27-mode_localhost-ansible3 Loc_27_4: tox.env: py27-mode_localhost-ansible4 - Loc_27_5: - tox.env: py27-mode_localhost-ansible5 # NOTE: this hangs when ran in Ubuntu 18.04 Van_27_210: @@ -127,10 +117,6 @@ jobs: tox.env: py27-mode_localhost-ansible4 STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive - Van_27_5: - tox.env: py27-mode_localhost-ansible5 - STRATEGY: linear - ANSIBLE_SKIP_TAGS: resource_intensive - job: Linux pool: @@ -270,9 +256,6 @@ jobs: Ans_27_4: python.version: '2.7' tox.env: py27-mode_ansible-ansible4 - Ans_27_5: - python.version: '2.7' - tox.env: py27-mode_ansible-ansible5 Ans_36_210: python.version: '3.6' @@ -283,9 +266,6 @@ jobs: Ans_36_4: python.version: '3.6' tox.env: py36-mode_ansible-ansible4 - Ans_36_5: - python.version: '3.6' - tox.env: py36-mode_ansible-ansible5 Ans_39_210: python.version: '3.9' From 19c28b2b1a56dfdbf3ab838a8e3b8881a5951520 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 23:45:50 +0100 Subject: [PATCH 29/44] fixed tests for ansible 2.12 --- tests/ansible/all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ansible/all.yml b/tests/ansible/all.yml index e8bf26f2..7a3e7000 100644 --- a/tests/ansible/all.yml +++ b/tests/ansible/all.yml @@ -1,6 +1,6 @@ -- include: setup/all.yml +- import_playbook: setup/all.yml tags: setup -- include: regression/all.yml +- import_playbook: regression/all.yml tags: regression -- include: integration/all.yml +- import_playbook: integration/all.yml tags: integration From 7bc2102d2b7c952cb4f09008a2dcfcf80b08a00a Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 23:46:15 +0100 Subject: [PATCH 30/44] fixed tests for ansible 2.12 --- tests/ansible/integration/all.yml | 36 +++++++++++++++---------------- tests/ansible/regression/all.yml | 30 +++++++++++++------------- tests/ansible/setup/all.yml | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/ansible/integration/all.yml b/tests/ansible/integration/all.yml index 6bd5059a..ac196584 100644 --- a/tests/ansible/integration/all.yml +++ b/tests/ansible/integration/all.yml @@ -3,39 +3,39 @@ # This playbook imports all tests that are known to work at present. # -- include: action/all.yml +- import_playbook: action/all.yml tags: action -- include: async/all.yml +- import_playbook: async/all.yml tags: async -- include: become/all.yml +- import_playbook: become/all.yml tags: become -- include: connection/all.yml +- import_playbook: connection/all.yml tags: connection -- include: connection_delegation/all.yml +- import_playbook: connection_delegation/all.yml tags: connection_delegation -- include: connection_loader/all.yml +- import_playbook: connection_loader/all.yml tags: connection_loader -- include: context_service/all.yml +- import_playbook: context_service/all.yml tags: context_service -- include: glibc_caches/all.yml +- import_playbook: glibc_caches/all.yml tags: glibc_caches -- include: interpreter_discovery/all.yml +- import_playbook: interpreter_discovery/all.yml tags: interpreter_discovery -- include: local/all.yml +- import_playbook: local/all.yml tags: local -- include: module_utils/all.yml +- import_playbook: module_utils/all.yml tags: module_utils -- include: playbook_semantics/all.yml +- import_playbook: playbook_semantics/all.yml tags: playbook_semantics -- include: process/all.yml +- import_playbook: process/all.yml tags: process -- include: runner/all.yml +- import_playbook: runner/all.yml tags: runner -- include: ssh/all.yml +- import_playbook: ssh/all.yml tags: ssh -- include: strategy/all.yml +- import_playbook: strategy/all.yml tags: strategy -- include: stub_connections/all.yml +- import_playbook: stub_connections/all.yml tags: stub_connections -- include: transport_config/all.yml +- import_playbook: transport_config/all.yml tags: transport_config diff --git a/tests/ansible/regression/all.yml b/tests/ansible/regression/all.yml index 06ffdf61..875d520e 100644 --- a/tests/ansible/regression/all.yml +++ b/tests/ansible/regression/all.yml @@ -1,30 +1,30 @@ -- include: issue_109__target_has_old_ansible_installed.yml +- import_playbook: issue_109__target_has_old_ansible_installed.yml tags: regression -- include: issue_113__duplicate_module_imports.yml +- import_playbook: issue_113__duplicate_module_imports.yml tags: regression -- include: issue_118__script_not_marked_exec.yml +- import_playbook: issue_118__script_not_marked_exec.yml tags: regression -- include: issue_122__environment_difference.yml +- import_playbook: issue_122__environment_difference.yml tags: regression -- include: issue_140__thread_pileup.yml +- import_playbook: issue_140__thread_pileup.yml tags: regression -- include: issue_152__local_action_wrong_interpreter.yml +- import_playbook: issue_152__local_action_wrong_interpreter.yml tags: regression -- include: issue_152__virtualenv_python_fails.yml +- import_playbook: issue_152__virtualenv_python_fails.yml tags: regression -- include: issue_154__module_state_leaks.yml +- import_playbook: issue_154__module_state_leaks.yml tags: regression -- include: issue_177__copy_module_failing.yml +- import_playbook: issue_177__copy_module_failing.yml tags: regression -- include: issue_332_ansiblemoduleerror_first_occurrence.yml +- import_playbook: issue_332_ansiblemoduleerror_first_occurrence.yml tags: regression -- include: issue_558_unarchive_failed.yml +- import_playbook: issue_558_unarchive_failed.yml tags: regression -- include: issue_590__sys_modules_crap.yml +- import_playbook: issue_590__sys_modules_crap.yml tags: regression -- include: issue_591__setuptools_cwd_crash.yml +- import_playbook: issue_591__setuptools_cwd_crash.yml tags: regression -- include: issue_615__streaming_transfer.yml +- import_playbook: issue_615__streaming_transfer.yml tags: regression -- include: issue_655__wait_for_connection_error.yml +- import_playbook: issue_655__wait_for_connection_error.yml tags: regression diff --git a/tests/ansible/setup/all.yml b/tests/ansible/setup/all.yml index c51fa295..2ca6b97c 100644 --- a/tests/ansible/setup/all.yml +++ b/tests/ansible/setup/all.yml @@ -1 +1 @@ -- include: report.yml +- import_playbook: report.yml From 2d3970552ed340a3b839d9cdc2e2da98d844a2a5 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 23:46:36 +0100 Subject: [PATCH 31/44] fixed tests for ansible 2.12 --- tests/ansible/integration/action/all.yml | 20 ++++---- tests/ansible/integration/async/all.yml | 18 ++++---- tests/ansible/integration/become/all.yml | 12 ++--- tests/ansible/integration/connection/all.yml | 18 ++++---- .../integration/connection_delegation/all.yml | 10 ++-- .../integration/connection_loader/all.yml | 6 +-- .../integration/context_service/all.yml | 8 ++-- .../ansible/integration/glibc_caches/all.yml | 2 +- .../integration/interpreter_discovery/all.yml | 4 +- tests/ansible/integration/local/all.yml | 4 +- .../ansible/integration/module_utils/all.yml | 10 ++-- .../integration/playbook_semantics/all.yml | 8 ++-- tests/ansible/integration/process/all.yml | 2 +- tests/ansible/integration/runner/all.yml | 46 +++++++++---------- tests/ansible/integration/ssh/all.yml | 6 +-- tests/ansible/integration/strategy/all.yml | 2 +- .../integration/stub_connections/all.yml | 14 +++--- .../integration/transport_config/all.yml | 22 ++++----- 18 files changed, 106 insertions(+), 106 deletions(-) diff --git a/tests/ansible/integration/action/all.yml b/tests/ansible/integration/action/all.yml index c43d5cc7..d823e05e 100644 --- a/tests/ansible/integration/action/all.yml +++ b/tests/ansible/integration/action/all.yml @@ -1,10 +1,10 @@ -- include: copy.yml -- include: fixup_perms2__copy.yml -- include: low_level_execute_command.yml -- include: make_tmp_path.yml -- include: make_tmp_path__double.yml -- include: remote_expand_user.yml -- include: remote_file_exists.yml -- include: remove_tmp_path.yml -- include: synchronize.yml -- include: transfer_data.yml +- import_playbook: copy.yml +- import_playbook: fixup_perms2__copy.yml +- import_playbook: low_level_execute_command.yml +- import_playbook: make_tmp_path.yml +- import_playbook: make_tmp_path__double.yml +- import_playbook: remote_expand_user.yml +- import_playbook: remote_file_exists.yml +- import_playbook: remove_tmp_path.yml +- import_playbook: synchronize.yml +- import_playbook: transfer_data.yml diff --git a/tests/ansible/integration/async/all.yml b/tests/ansible/integration/async/all.yml index f14537ed..61d2d35c 100644 --- a/tests/ansible/integration/async/all.yml +++ b/tests/ansible/integration/async/all.yml @@ -1,9 +1,9 @@ -- include: multiple_items_loop.yml -- include: result_binary_producing_json.yml -- include: result_binary_producing_junk.yml -- include: result_shell_echo_hi.yml -- include: runner_new_process.yml -- include: runner_one_job.yml -- include: runner_timeout_then_polling.yml -- include: runner_two_simultaneous_jobs.yml -- include: runner_with_polling_and_timeout.yml +- import_playbook: multiple_items_loop.yml +- import_playbook: result_binary_producing_json.yml +- import_playbook: result_binary_producing_junk.yml +- import_playbook: result_shell_echo_hi.yml +- import_playbook: runner_new_process.yml +- import_playbook: runner_one_job.yml +- import_playbook: runner_timeout_then_polling.yml +- import_playbook: runner_two_simultaneous_jobs.yml +- import_playbook: runner_with_polling_and_timeout.yml diff --git a/tests/ansible/integration/become/all.yml b/tests/ansible/integration/become/all.yml index 5fa030d1..c9c331dd 100644 --- a/tests/ansible/integration/become/all.yml +++ b/tests/ansible/integration/become/all.yml @@ -1,7 +1,7 @@ -- include: su_password.yml -- include: sudo_flags_failure.yml -- include: sudo_nonexistent.yml -- include: sudo_nopassword.yml -- include: sudo_password.yml -- include: sudo_requiretty.yml +- import_playbook: su_password.yml +- import_playbook: sudo_flags_failure.yml +- import_playbook: sudo_nonexistent.yml +- import_playbook: sudo_nopassword.yml +- import_playbook: sudo_password.yml +- import_playbook: sudo_requiretty.yml diff --git a/tests/ansible/integration/connection/all.yml b/tests/ansible/integration/connection/all.yml index 348857f5..b707b0eb 100644 --- a/tests/ansible/integration/connection/all.yml +++ b/tests/ansible/integration/connection/all.yml @@ -1,11 +1,11 @@ --- -- include: become_same_user.yml -- include: disconnect_during_module.yml -- include: disconnect_resets_connection.yml -- include: exec_command.yml -- include: home_dir.yml -- include: put_large_file.yml -- include: put_small_file.yml -- include: reset.yml -- include: reset_become.yml +- import_playbook: become_same_user.yml +- import_playbook: disconnect_during_module.yml +- import_playbook: disconnect_resets_connection.yml +- import_playbook: exec_command.yml +- import_playbook: home_dir.yml +- import_playbook: put_large_file.yml +- import_playbook: put_small_file.yml +- import_playbook: reset.yml +- import_playbook: reset_become.yml diff --git a/tests/ansible/integration/connection_delegation/all.yml b/tests/ansible/integration/connection_delegation/all.yml index c9b09687..8d5ffe03 100644 --- a/tests/ansible/integration/connection_delegation/all.yml +++ b/tests/ansible/integration/connection_delegation/all.yml @@ -1,5 +1,5 @@ -- include: delegate_to_template.yml -- include: local_action.yml -- include: osa_container_standalone.yml -- include: osa_delegate_to_self.yml -- include: stack_construction.yml +- import_playbook: delegate_to_template.yml +- import_playbook: local_action.yml +- import_playbook: osa_container_standalone.yml +- import_playbook: osa_delegate_to_self.yml +- import_playbook: stack_construction.yml diff --git a/tests/ansible/integration/connection_loader/all.yml b/tests/ansible/integration/connection_loader/all.yml index 76ffe8f4..7a44bb2f 100644 --- a/tests/ansible/integration/connection_loader/all.yml +++ b/tests/ansible/integration/connection_loader/all.yml @@ -1,3 +1,3 @@ -- include: local_blemished.yml -- include: paramiko_unblemished.yml -- include: ssh_blemished.yml +- import_playbook: local_blemished.yml +- import_playbook: paramiko_unblemished.yml +- import_playbook: ssh_blemished.yml diff --git a/tests/ansible/integration/context_service/all.yml b/tests/ansible/integration/context_service/all.yml index 7770629a..edcf8eff 100644 --- a/tests/ansible/integration/context_service/all.yml +++ b/tests/ansible/integration/context_service/all.yml @@ -1,4 +1,4 @@ -- include: disconnect_cleanup.yml -- include: lru_one_target.yml -- include: reconnection.yml -- include: remote_name.yml +- import_playbook: disconnect_cleanup.yml +- import_playbook: lru_one_target.yml +- import_playbook: reconnection.yml +- import_playbook: remote_name.yml diff --git a/tests/ansible/integration/glibc_caches/all.yml b/tests/ansible/integration/glibc_caches/all.yml index 8cff4ea8..7d524540 100644 --- a/tests/ansible/integration/glibc_caches/all.yml +++ b/tests/ansible/integration/glibc_caches/all.yml @@ -1,2 +1,2 @@ -- include: resolv_conf.yml +- import_playbook: resolv_conf.yml diff --git a/tests/ansible/integration/interpreter_discovery/all.yml b/tests/ansible/integration/interpreter_discovery/all.yml index 403fd761..56fbc622 100644 --- a/tests/ansible/integration/interpreter_discovery/all.yml +++ b/tests/ansible/integration/interpreter_discovery/all.yml @@ -1,2 +1,2 @@ -- include: complex_args.yml -- include: ansible_2_8_tests.yml +- import_playbook: complex_args.yml +- import_playbook: ansible_2_8_tests.yml diff --git a/tests/ansible/integration/local/all.yml b/tests/ansible/integration/local/all.yml index 5f8b4dd4..383a9108 100644 --- a/tests/ansible/integration/local/all.yml +++ b/tests/ansible/integration/local/all.yml @@ -1,4 +1,4 @@ -- include: cwd_preserved.yml -- include: env_preserved.yml +- import_playbook: cwd_preserved.yml +- import_playbook: env_preserved.yml diff --git a/tests/ansible/integration/module_utils/all.yml b/tests/ansible/integration/module_utils/all.yml index b68e2ee3..c8b8f2fb 100644 --- a/tests/ansible/integration/module_utils/all.yml +++ b/tests/ansible/integration/module_utils/all.yml @@ -1,6 +1,6 @@ -#- include: from_config_path.yml -#- include: from_config_path_pkg.yml -#- include: adjacent_to_playbook.yml -- include: adjacent_to_role.yml -#- include: overrides_builtin.yml +#- import_playbook: from_config_path.yml +#- import_playbook: from_config_path_pkg.yml +#- import_playbook: adjacent_to_playbook.yml +- import_playbook: adjacent_to_role.yml +#- import_playbook: overrides_builtin.yml diff --git a/tests/ansible/integration/playbook_semantics/all.yml b/tests/ansible/integration/playbook_semantics/all.yml index ec7a9a07..6c8dd065 100644 --- a/tests/ansible/integration/playbook_semantics/all.yml +++ b/tests/ansible/integration/playbook_semantics/all.yml @@ -1,4 +1,4 @@ -- include: become_flags.yml -- include: delegate_to.yml -- include: environment.yml -- include: with_items.yml +- import_playbook: become_flags.yml +- import_playbook: delegate_to.yml +- import_playbook: environment.yml +- import_playbook: with_items.yml diff --git a/tests/ansible/integration/process/all.yml b/tests/ansible/integration/process/all.yml index a309113a..c50d6bd5 100644 --- a/tests/ansible/integration/process/all.yml +++ b/tests/ansible/integration/process/all.yml @@ -1 +1 @@ -- include: "unix_socket_cleanup.yml" +- import_playbook: "unix_socket_cleanup.yml" diff --git a/tests/ansible/integration/runner/all.yml b/tests/ansible/integration/runner/all.yml index 19586547..5de9fb27 100644 --- a/tests/ansible/integration/runner/all.yml +++ b/tests/ansible/integration/runner/all.yml @@ -1,24 +1,24 @@ -- include: atexit.yml -- include: builtin_command_module.yml -- include: crashy_new_style_module.yml -- include: custom_bash_hashbang_argument.yml -- include: custom_bash_old_style_module.yml -- include: custom_bash_want_json_module.yml -- include: custom_binary_producing_json.yml -- include: custom_binary_producing_junk.yml -- include: custom_binary_single_null.yml -- include: custom_perl_json_args_module.yml -- include: custom_perl_want_json_module.yml -- include: custom_python_json_args_module.yml -- include: custom_python_new_style_missing_interpreter.yml -- include: custom_python_new_style_module.yml -- include: custom_python_prehistoric_module.yml -- include: custom_python_want_json_module.yml -- include: custom_script_interpreter.yml -- include: environment_isolation.yml +- import_playbook: atexit.yml +- import_playbook: builtin_command_module.yml +- import_playbook: crashy_new_style_module.yml +- import_playbook: custom_bash_hashbang_argument.yml +- import_playbook: custom_bash_old_style_module.yml +- import_playbook: custom_bash_want_json_module.yml +- import_playbook: custom_binary_producing_json.yml +- import_playbook: custom_binary_producing_junk.yml +- import_playbook: custom_binary_single_null.yml +- import_playbook: custom_perl_json_args_module.yml +- import_playbook: custom_perl_want_json_module.yml +- import_playbook: custom_python_json_args_module.yml +- import_playbook: custom_python_new_style_missing_interpreter.yml +- import_playbook: custom_python_new_style_module.yml +- import_playbook: custom_python_prehistoric_module.yml +- import_playbook: custom_python_want_json_module.yml +- import_playbook: custom_script_interpreter.yml +- import_playbook: environment_isolation.yml # I hate this test. I hope it dies, it has caused nothing but misery and suffering -#- include: etc_environment.yml -- include: forking_active.yml -- include: forking_correct_parent.yml -- include: forking_inactive.yml -- include: missing_module.yml +#- import_playbook: etc_environment.yml +- import_playbook: forking_active.yml +- import_playbook: forking_correct_parent.yml +- import_playbook: forking_inactive.yml +- import_playbook: missing_module.yml diff --git a/tests/ansible/integration/ssh/all.yml b/tests/ansible/integration/ssh/all.yml index 28495f49..a8335ab7 100644 --- a/tests/ansible/integration/ssh/all.yml +++ b/tests/ansible/integration/ssh/all.yml @@ -1,3 +1,3 @@ -- include: config.yml -- include: timeouts.yml -- include: variables.yml +- import_playbook: config.yml +- import_playbook: timeouts.yml +- import_playbook: variables.yml diff --git a/tests/ansible/integration/strategy/all.yml b/tests/ansible/integration/strategy/all.yml index b519e1bc..3304817c 100644 --- a/tests/ansible/integration/strategy/all.yml +++ b/tests/ansible/integration/strategy/all.yml @@ -1 +1 @@ -- include: mixed_vanilla_mitogen.yml +- import_playbook: mixed_vanilla_mitogen.yml diff --git a/tests/ansible/integration/stub_connections/all.yml b/tests/ansible/integration/stub_connections/all.yml index e1810138..a9744ab7 100644 --- a/tests/ansible/integration/stub_connections/all.yml +++ b/tests/ansible/integration/stub_connections/all.yml @@ -1,7 +1,7 @@ -- include: kubectl.yml -- include: lxc.yml -- include: lxd.yml -- include: mitogen_doas.yml -- include: mitogen_sudo.yml -- include: setns_lxc.yml -- include: setns_lxd.yml +- import_playbook: kubectl.yml +- import_playbook: lxc.yml +- import_playbook: lxd.yml +- import_playbook: mitogen_doas.yml +- import_playbook: mitogen_sudo.yml +- import_playbook: setns_lxc.yml +- import_playbook: setns_lxd.yml diff --git a/tests/ansible/integration/transport_config/all.yml b/tests/ansible/integration/transport_config/all.yml index d4ed832f..548e7f7e 100644 --- a/tests/ansible/integration/transport_config/all.yml +++ b/tests/ansible/integration/transport_config/all.yml @@ -1,11 +1,11 @@ -- include: become_method.yml -- include: become_pass.yml -- include: become_user.yml -- include: become.yml -- include: password.yml -- include: port.yml -- include: python_path.yml -- include: remote_addr.yml -- include: remote_user.yml -- include: transport.yml -- include: transport__smart.yml +- import_playbook: become_method.yml +- import_playbook: become_pass.yml +- import_playbook: become_user.yml +- import_playbook: become.yml +- import_playbook: password.yml +- import_playbook: port.yml +- import_playbook: python_path.yml +- import_playbook: remote_addr.yml +- import_playbook: remote_user.yml +- import_playbook: transport.yml +- import_playbook: transport__smart.yml From b9782ded9c537f40c043923ea9262a98de6baf33 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Wed, 8 Dec 2021 23:47:28 +0100 Subject: [PATCH 32/44] run ansible 5 tests only w/ py39 --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1820fa01..43e2537e 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,8 @@ [tox] envlist = init, - py{27,36,39}-mode_ansible-ansible{2.10,3,4,5}, + py{27,36}-mode_ansible-ansible{2.10,3,4}, + py{39}-mode_ansible-ansible{2.10,3,4,5}, py{27,36,39}-mode_mitogen-distro_centos{6,7,8}, py{27,36,39}-mode_mitogen-distro_debian{9,10,11}, py{27,36,39}-mode_mitogen-distro_ubuntu{1604,1804,2004}, From 3d450f0f22bb208902d7e0eeba7b010309f041dd Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Fri, 10 Dec 2021 09:49:28 +0100 Subject: [PATCH 33/44] fix interpreter discovery tests for changed python interpreter behaviour from ansible 2.12 on --- .../ansible_2_8_tests.yml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index 2dea4f8b..9b974c6d 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -63,15 +63,31 @@ ping: register: legacy - - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) + # from ansible 2.12 on this changed + # - https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_5.html#python-interpreter-discovery + # - https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html + # default discovery methot is now auto and will default to python3 + # and the message changed from a deprecation warning to a real warning that can not be suppressed by + # using deprecation_warnings=False + - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) for ansible 2.8-2.11 assert: that: - legacy.deprecations | default([]) | length > 0 fail_msg: legacy={{legacy}} # only check for a dep warning if legacy returned /usr/bin/python and auto didn't when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' + auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and + ansible_version.full is version_compare('2.12.0', '<', strict=True) + - name: check for warning (only on platforms where auto result is not /usr/bin/python and legacy is) from ansible 2.12 on + assert: + that: + - legacy.warnings | default([]) | length > 0 + fail_msg: legacy={{legacy}} + # only check for a warning if legacy returned /usr/bin/python and auto didn't + when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and + auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and + ansible_version.full is version_compare('2.12.0', '>=', strict=True) - name: test that auto_silent never warns and got the same answer as auto block: From 54b9115f20172358f5a0d645fea3d70327b3302c Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 20:33:00 +0100 Subject: [PATCH 34/44] Update docs/ansible_detailed.rst fixed supported ansible / python version listing Co-authored-by: Alex Willmer --- docs/ansible_detailed.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ansible_detailed.rst b/docs/ansible_detailed.rst index 65bcfffd..aa82ee50 100644 --- a/docs/ansible_detailed.rst +++ b/docs/ansible_detailed.rst @@ -146,7 +146,9 @@ Noteworthy Differences ---------------------- * Mitogen 0.2.x supports Ansible 2.3-2.9; with Python 2.6, 2.7, or 3.6. - Mitogen 0.3.1+ supports Ansible 2.10, 3, 4 and 5; with Python 2.7, or 3.6-3.9. + Mitogen 0.3.1+ supports + - Ansible 2.10, 3, and 4; with Python 2.7, or 3.6-3.9 + - Ansible 5; with Python 3.8-3.9 Verify your installation is running one of these versions by checking ``ansible --version`` output. From e509c1fb77e12e60cdb0b6e89b11d0e6907b2ba8 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 20:33:34 +0100 Subject: [PATCH 35/44] Update tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml Co-authored-by: Alex Willmer --- .../integration/interpreter_discovery/ansible_2_8_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index 9b974c6d..f639779d 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -63,13 +63,13 @@ ping: register: legacy + - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) for ansible 2.8-2.11 # from ansible 2.12 on this changed # - https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_5.html#python-interpreter-discovery # - https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html - # default discovery methot is now auto and will default to python3 + # default discovery method is now auto and will default to python3 # and the message changed from a deprecation warning to a real warning that can not be suppressed by # using deprecation_warnings=False - - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) for ansible 2.8-2.11 assert: that: - legacy.deprecations | default([]) | length > 0 From 478f286efb6653194b752d42c1c94a3c625731eb Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 20:34:52 +0100 Subject: [PATCH 36/44] Revert "fixed tests for ansible 2.12" include is deprecated and will be removed in 2.16, so there is some time to fix this left This reverts commit 2d3970552ed340a3b839d9cdc2e2da98d844a2a5. --- tests/ansible/integration/action/all.yml | 20 ++++---- tests/ansible/integration/async/all.yml | 18 ++++---- tests/ansible/integration/become/all.yml | 12 ++--- tests/ansible/integration/connection/all.yml | 18 ++++---- .../integration/connection_delegation/all.yml | 10 ++-- .../integration/connection_loader/all.yml | 6 +-- .../integration/context_service/all.yml | 8 ++-- .../ansible/integration/glibc_caches/all.yml | 2 +- .../integration/interpreter_discovery/all.yml | 4 +- tests/ansible/integration/local/all.yml | 4 +- .../ansible/integration/module_utils/all.yml | 10 ++-- .../integration/playbook_semantics/all.yml | 8 ++-- tests/ansible/integration/process/all.yml | 2 +- tests/ansible/integration/runner/all.yml | 46 +++++++++---------- tests/ansible/integration/ssh/all.yml | 6 +-- tests/ansible/integration/strategy/all.yml | 2 +- .../integration/stub_connections/all.yml | 14 +++--- .../integration/transport_config/all.yml | 22 ++++----- 18 files changed, 106 insertions(+), 106 deletions(-) diff --git a/tests/ansible/integration/action/all.yml b/tests/ansible/integration/action/all.yml index d823e05e..c43d5cc7 100644 --- a/tests/ansible/integration/action/all.yml +++ b/tests/ansible/integration/action/all.yml @@ -1,10 +1,10 @@ -- import_playbook: copy.yml -- import_playbook: fixup_perms2__copy.yml -- import_playbook: low_level_execute_command.yml -- import_playbook: make_tmp_path.yml -- import_playbook: make_tmp_path__double.yml -- import_playbook: remote_expand_user.yml -- import_playbook: remote_file_exists.yml -- import_playbook: remove_tmp_path.yml -- import_playbook: synchronize.yml -- import_playbook: transfer_data.yml +- include: copy.yml +- include: fixup_perms2__copy.yml +- include: low_level_execute_command.yml +- include: make_tmp_path.yml +- include: make_tmp_path__double.yml +- include: remote_expand_user.yml +- include: remote_file_exists.yml +- include: remove_tmp_path.yml +- include: synchronize.yml +- include: transfer_data.yml diff --git a/tests/ansible/integration/async/all.yml b/tests/ansible/integration/async/all.yml index 61d2d35c..f14537ed 100644 --- a/tests/ansible/integration/async/all.yml +++ b/tests/ansible/integration/async/all.yml @@ -1,9 +1,9 @@ -- import_playbook: multiple_items_loop.yml -- import_playbook: result_binary_producing_json.yml -- import_playbook: result_binary_producing_junk.yml -- import_playbook: result_shell_echo_hi.yml -- import_playbook: runner_new_process.yml -- import_playbook: runner_one_job.yml -- import_playbook: runner_timeout_then_polling.yml -- import_playbook: runner_two_simultaneous_jobs.yml -- import_playbook: runner_with_polling_and_timeout.yml +- include: multiple_items_loop.yml +- include: result_binary_producing_json.yml +- include: result_binary_producing_junk.yml +- include: result_shell_echo_hi.yml +- include: runner_new_process.yml +- include: runner_one_job.yml +- include: runner_timeout_then_polling.yml +- include: runner_two_simultaneous_jobs.yml +- include: runner_with_polling_and_timeout.yml diff --git a/tests/ansible/integration/become/all.yml b/tests/ansible/integration/become/all.yml index c9c331dd..5fa030d1 100644 --- a/tests/ansible/integration/become/all.yml +++ b/tests/ansible/integration/become/all.yml @@ -1,7 +1,7 @@ -- import_playbook: su_password.yml -- import_playbook: sudo_flags_failure.yml -- import_playbook: sudo_nonexistent.yml -- import_playbook: sudo_nopassword.yml -- import_playbook: sudo_password.yml -- import_playbook: sudo_requiretty.yml +- include: su_password.yml +- include: sudo_flags_failure.yml +- include: sudo_nonexistent.yml +- include: sudo_nopassword.yml +- include: sudo_password.yml +- include: sudo_requiretty.yml diff --git a/tests/ansible/integration/connection/all.yml b/tests/ansible/integration/connection/all.yml index b707b0eb..348857f5 100644 --- a/tests/ansible/integration/connection/all.yml +++ b/tests/ansible/integration/connection/all.yml @@ -1,11 +1,11 @@ --- -- import_playbook: become_same_user.yml -- import_playbook: disconnect_during_module.yml -- import_playbook: disconnect_resets_connection.yml -- import_playbook: exec_command.yml -- import_playbook: home_dir.yml -- import_playbook: put_large_file.yml -- import_playbook: put_small_file.yml -- import_playbook: reset.yml -- import_playbook: reset_become.yml +- include: become_same_user.yml +- include: disconnect_during_module.yml +- include: disconnect_resets_connection.yml +- include: exec_command.yml +- include: home_dir.yml +- include: put_large_file.yml +- include: put_small_file.yml +- include: reset.yml +- include: reset_become.yml diff --git a/tests/ansible/integration/connection_delegation/all.yml b/tests/ansible/integration/connection_delegation/all.yml index 8d5ffe03..c9b09687 100644 --- a/tests/ansible/integration/connection_delegation/all.yml +++ b/tests/ansible/integration/connection_delegation/all.yml @@ -1,5 +1,5 @@ -- import_playbook: delegate_to_template.yml -- import_playbook: local_action.yml -- import_playbook: osa_container_standalone.yml -- import_playbook: osa_delegate_to_self.yml -- import_playbook: stack_construction.yml +- include: delegate_to_template.yml +- include: local_action.yml +- include: osa_container_standalone.yml +- include: osa_delegate_to_self.yml +- include: stack_construction.yml diff --git a/tests/ansible/integration/connection_loader/all.yml b/tests/ansible/integration/connection_loader/all.yml index 7a44bb2f..76ffe8f4 100644 --- a/tests/ansible/integration/connection_loader/all.yml +++ b/tests/ansible/integration/connection_loader/all.yml @@ -1,3 +1,3 @@ -- import_playbook: local_blemished.yml -- import_playbook: paramiko_unblemished.yml -- import_playbook: ssh_blemished.yml +- include: local_blemished.yml +- include: paramiko_unblemished.yml +- include: ssh_blemished.yml diff --git a/tests/ansible/integration/context_service/all.yml b/tests/ansible/integration/context_service/all.yml index edcf8eff..7770629a 100644 --- a/tests/ansible/integration/context_service/all.yml +++ b/tests/ansible/integration/context_service/all.yml @@ -1,4 +1,4 @@ -- import_playbook: disconnect_cleanup.yml -- import_playbook: lru_one_target.yml -- import_playbook: reconnection.yml -- import_playbook: remote_name.yml +- include: disconnect_cleanup.yml +- include: lru_one_target.yml +- include: reconnection.yml +- include: remote_name.yml diff --git a/tests/ansible/integration/glibc_caches/all.yml b/tests/ansible/integration/glibc_caches/all.yml index 7d524540..8cff4ea8 100644 --- a/tests/ansible/integration/glibc_caches/all.yml +++ b/tests/ansible/integration/glibc_caches/all.yml @@ -1,2 +1,2 @@ -- import_playbook: resolv_conf.yml +- include: resolv_conf.yml diff --git a/tests/ansible/integration/interpreter_discovery/all.yml b/tests/ansible/integration/interpreter_discovery/all.yml index 56fbc622..403fd761 100644 --- a/tests/ansible/integration/interpreter_discovery/all.yml +++ b/tests/ansible/integration/interpreter_discovery/all.yml @@ -1,2 +1,2 @@ -- import_playbook: complex_args.yml -- import_playbook: ansible_2_8_tests.yml +- include: complex_args.yml +- include: ansible_2_8_tests.yml diff --git a/tests/ansible/integration/local/all.yml b/tests/ansible/integration/local/all.yml index 383a9108..5f8b4dd4 100644 --- a/tests/ansible/integration/local/all.yml +++ b/tests/ansible/integration/local/all.yml @@ -1,4 +1,4 @@ -- import_playbook: cwd_preserved.yml -- import_playbook: env_preserved.yml +- include: cwd_preserved.yml +- include: env_preserved.yml diff --git a/tests/ansible/integration/module_utils/all.yml b/tests/ansible/integration/module_utils/all.yml index c8b8f2fb..b68e2ee3 100644 --- a/tests/ansible/integration/module_utils/all.yml +++ b/tests/ansible/integration/module_utils/all.yml @@ -1,6 +1,6 @@ -#- import_playbook: from_config_path.yml -#- import_playbook: from_config_path_pkg.yml -#- import_playbook: adjacent_to_playbook.yml -- import_playbook: adjacent_to_role.yml -#- import_playbook: overrides_builtin.yml +#- include: from_config_path.yml +#- include: from_config_path_pkg.yml +#- include: adjacent_to_playbook.yml +- include: adjacent_to_role.yml +#- include: overrides_builtin.yml diff --git a/tests/ansible/integration/playbook_semantics/all.yml b/tests/ansible/integration/playbook_semantics/all.yml index 6c8dd065..ec7a9a07 100644 --- a/tests/ansible/integration/playbook_semantics/all.yml +++ b/tests/ansible/integration/playbook_semantics/all.yml @@ -1,4 +1,4 @@ -- import_playbook: become_flags.yml -- import_playbook: delegate_to.yml -- import_playbook: environment.yml -- import_playbook: with_items.yml +- include: become_flags.yml +- include: delegate_to.yml +- include: environment.yml +- include: with_items.yml diff --git a/tests/ansible/integration/process/all.yml b/tests/ansible/integration/process/all.yml index c50d6bd5..a309113a 100644 --- a/tests/ansible/integration/process/all.yml +++ b/tests/ansible/integration/process/all.yml @@ -1 +1 @@ -- import_playbook: "unix_socket_cleanup.yml" +- include: "unix_socket_cleanup.yml" diff --git a/tests/ansible/integration/runner/all.yml b/tests/ansible/integration/runner/all.yml index 5de9fb27..19586547 100644 --- a/tests/ansible/integration/runner/all.yml +++ b/tests/ansible/integration/runner/all.yml @@ -1,24 +1,24 @@ -- import_playbook: atexit.yml -- import_playbook: builtin_command_module.yml -- import_playbook: crashy_new_style_module.yml -- import_playbook: custom_bash_hashbang_argument.yml -- import_playbook: custom_bash_old_style_module.yml -- import_playbook: custom_bash_want_json_module.yml -- import_playbook: custom_binary_producing_json.yml -- import_playbook: custom_binary_producing_junk.yml -- import_playbook: custom_binary_single_null.yml -- import_playbook: custom_perl_json_args_module.yml -- import_playbook: custom_perl_want_json_module.yml -- import_playbook: custom_python_json_args_module.yml -- import_playbook: custom_python_new_style_missing_interpreter.yml -- import_playbook: custom_python_new_style_module.yml -- import_playbook: custom_python_prehistoric_module.yml -- import_playbook: custom_python_want_json_module.yml -- import_playbook: custom_script_interpreter.yml -- import_playbook: environment_isolation.yml +- include: atexit.yml +- include: builtin_command_module.yml +- include: crashy_new_style_module.yml +- include: custom_bash_hashbang_argument.yml +- include: custom_bash_old_style_module.yml +- include: custom_bash_want_json_module.yml +- include: custom_binary_producing_json.yml +- include: custom_binary_producing_junk.yml +- include: custom_binary_single_null.yml +- include: custom_perl_json_args_module.yml +- include: custom_perl_want_json_module.yml +- include: custom_python_json_args_module.yml +- include: custom_python_new_style_missing_interpreter.yml +- include: custom_python_new_style_module.yml +- include: custom_python_prehistoric_module.yml +- include: custom_python_want_json_module.yml +- include: custom_script_interpreter.yml +- include: environment_isolation.yml # I hate this test. I hope it dies, it has caused nothing but misery and suffering -#- import_playbook: etc_environment.yml -- import_playbook: forking_active.yml -- import_playbook: forking_correct_parent.yml -- import_playbook: forking_inactive.yml -- import_playbook: missing_module.yml +#- include: etc_environment.yml +- include: forking_active.yml +- include: forking_correct_parent.yml +- include: forking_inactive.yml +- include: missing_module.yml diff --git a/tests/ansible/integration/ssh/all.yml b/tests/ansible/integration/ssh/all.yml index a8335ab7..28495f49 100644 --- a/tests/ansible/integration/ssh/all.yml +++ b/tests/ansible/integration/ssh/all.yml @@ -1,3 +1,3 @@ -- import_playbook: config.yml -- import_playbook: timeouts.yml -- import_playbook: variables.yml +- include: config.yml +- include: timeouts.yml +- include: variables.yml diff --git a/tests/ansible/integration/strategy/all.yml b/tests/ansible/integration/strategy/all.yml index 3304817c..b519e1bc 100644 --- a/tests/ansible/integration/strategy/all.yml +++ b/tests/ansible/integration/strategy/all.yml @@ -1 +1 @@ -- import_playbook: mixed_vanilla_mitogen.yml +- include: mixed_vanilla_mitogen.yml diff --git a/tests/ansible/integration/stub_connections/all.yml b/tests/ansible/integration/stub_connections/all.yml index a9744ab7..e1810138 100644 --- a/tests/ansible/integration/stub_connections/all.yml +++ b/tests/ansible/integration/stub_connections/all.yml @@ -1,7 +1,7 @@ -- import_playbook: kubectl.yml -- import_playbook: lxc.yml -- import_playbook: lxd.yml -- import_playbook: mitogen_doas.yml -- import_playbook: mitogen_sudo.yml -- import_playbook: setns_lxc.yml -- import_playbook: setns_lxd.yml +- include: kubectl.yml +- include: lxc.yml +- include: lxd.yml +- include: mitogen_doas.yml +- include: mitogen_sudo.yml +- include: setns_lxc.yml +- include: setns_lxd.yml diff --git a/tests/ansible/integration/transport_config/all.yml b/tests/ansible/integration/transport_config/all.yml index 548e7f7e..d4ed832f 100644 --- a/tests/ansible/integration/transport_config/all.yml +++ b/tests/ansible/integration/transport_config/all.yml @@ -1,11 +1,11 @@ -- import_playbook: become_method.yml -- import_playbook: become_pass.yml -- import_playbook: become_user.yml -- import_playbook: become.yml -- import_playbook: password.yml -- import_playbook: port.yml -- import_playbook: python_path.yml -- import_playbook: remote_addr.yml -- import_playbook: remote_user.yml -- import_playbook: transport.yml -- import_playbook: transport__smart.yml +- include: become_method.yml +- include: become_pass.yml +- include: become_user.yml +- include: become.yml +- include: password.yml +- include: port.yml +- include: python_path.yml +- include: remote_addr.yml +- include: remote_user.yml +- include: transport.yml +- include: transport__smart.yml From f82bd3d714605ddaa1b1e29d24a56d20cdc5c498 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 20:39:06 +0100 Subject: [PATCH 37/44] Revert "fixed tests for ansible 2.12" include is deprecated and will be removed in 2.16, so there is some time to fix this left This reverts commit 7bc2102d2b7c952cb4f09008a2dcfcf80b08a00a. --- tests/ansible/integration/all.yml | 36 +++++++++++++++---------------- tests/ansible/regression/all.yml | 30 +++++++++++++------------- tests/ansible/setup/all.yml | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/ansible/integration/all.yml b/tests/ansible/integration/all.yml index ac196584..6bd5059a 100644 --- a/tests/ansible/integration/all.yml +++ b/tests/ansible/integration/all.yml @@ -3,39 +3,39 @@ # This playbook imports all tests that are known to work at present. # -- import_playbook: action/all.yml +- include: action/all.yml tags: action -- import_playbook: async/all.yml +- include: async/all.yml tags: async -- import_playbook: become/all.yml +- include: become/all.yml tags: become -- import_playbook: connection/all.yml +- include: connection/all.yml tags: connection -- import_playbook: connection_delegation/all.yml +- include: connection_delegation/all.yml tags: connection_delegation -- import_playbook: connection_loader/all.yml +- include: connection_loader/all.yml tags: connection_loader -- import_playbook: context_service/all.yml +- include: context_service/all.yml tags: context_service -- import_playbook: glibc_caches/all.yml +- include: glibc_caches/all.yml tags: glibc_caches -- import_playbook: interpreter_discovery/all.yml +- include: interpreter_discovery/all.yml tags: interpreter_discovery -- import_playbook: local/all.yml +- include: local/all.yml tags: local -- import_playbook: module_utils/all.yml +- include: module_utils/all.yml tags: module_utils -- import_playbook: playbook_semantics/all.yml +- include: playbook_semantics/all.yml tags: playbook_semantics -- import_playbook: process/all.yml +- include: process/all.yml tags: process -- import_playbook: runner/all.yml +- include: runner/all.yml tags: runner -- import_playbook: ssh/all.yml +- include: ssh/all.yml tags: ssh -- import_playbook: strategy/all.yml +- include: strategy/all.yml tags: strategy -- import_playbook: stub_connections/all.yml +- include: stub_connections/all.yml tags: stub_connections -- import_playbook: transport_config/all.yml +- include: transport_config/all.yml tags: transport_config diff --git a/tests/ansible/regression/all.yml b/tests/ansible/regression/all.yml index 875d520e..06ffdf61 100644 --- a/tests/ansible/regression/all.yml +++ b/tests/ansible/regression/all.yml @@ -1,30 +1,30 @@ -- import_playbook: issue_109__target_has_old_ansible_installed.yml +- include: issue_109__target_has_old_ansible_installed.yml tags: regression -- import_playbook: issue_113__duplicate_module_imports.yml +- include: issue_113__duplicate_module_imports.yml tags: regression -- import_playbook: issue_118__script_not_marked_exec.yml +- include: issue_118__script_not_marked_exec.yml tags: regression -- import_playbook: issue_122__environment_difference.yml +- include: issue_122__environment_difference.yml tags: regression -- import_playbook: issue_140__thread_pileup.yml +- include: issue_140__thread_pileup.yml tags: regression -- import_playbook: issue_152__local_action_wrong_interpreter.yml +- include: issue_152__local_action_wrong_interpreter.yml tags: regression -- import_playbook: issue_152__virtualenv_python_fails.yml +- include: issue_152__virtualenv_python_fails.yml tags: regression -- import_playbook: issue_154__module_state_leaks.yml +- include: issue_154__module_state_leaks.yml tags: regression -- import_playbook: issue_177__copy_module_failing.yml +- include: issue_177__copy_module_failing.yml tags: regression -- import_playbook: issue_332_ansiblemoduleerror_first_occurrence.yml +- include: issue_332_ansiblemoduleerror_first_occurrence.yml tags: regression -- import_playbook: issue_558_unarchive_failed.yml +- include: issue_558_unarchive_failed.yml tags: regression -- import_playbook: issue_590__sys_modules_crap.yml +- include: issue_590__sys_modules_crap.yml tags: regression -- import_playbook: issue_591__setuptools_cwd_crash.yml +- include: issue_591__setuptools_cwd_crash.yml tags: regression -- import_playbook: issue_615__streaming_transfer.yml +- include: issue_615__streaming_transfer.yml tags: regression -- import_playbook: issue_655__wait_for_connection_error.yml +- include: issue_655__wait_for_connection_error.yml tags: regression diff --git a/tests/ansible/setup/all.yml b/tests/ansible/setup/all.yml index 2ca6b97c..c51fa295 100644 --- a/tests/ansible/setup/all.yml +++ b/tests/ansible/setup/all.yml @@ -1 +1 @@ -- import_playbook: report.yml +- include: report.yml From ffb58cd5571e2077abb05554849b5ab10824b67d Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 20:39:50 +0100 Subject: [PATCH 38/44] Revert "fixed tests for ansible 2.12" include is deprecated and will be removed in 2.16, so there is some time to fix this left This reverts commit 19c28b2b1a56dfdbf3ab838a8e3b8881a5951520. --- tests/ansible/all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ansible/all.yml b/tests/ansible/all.yml index 7a3e7000..e8bf26f2 100644 --- a/tests/ansible/all.yml +++ b/tests/ansible/all.yml @@ -1,6 +1,6 @@ -- import_playbook: setup/all.yml +- include: setup/all.yml tags: setup -- import_playbook: regression/all.yml +- include: regression/all.yml tags: regression -- import_playbook: integration/all.yml +- include: integration/all.yml tags: integration From 81f075340b55ac4bed9cc9059cbfeebc24bfdf44 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 21:57:11 +0100 Subject: [PATCH 39/44] use conditionals in list form --- .../interpreter_discovery/ansible_2_8_tests.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index f639779d..201ef8b4 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -75,9 +75,10 @@ - legacy.deprecations | default([]) | length > 0 fail_msg: legacy={{legacy}} # only check for a dep warning if legacy returned /usr/bin/python and auto didn't - when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and - ansible_version.full is version_compare('2.12.0', '<', strict=True) + when: + - legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' + - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' + - ansible_version.full is version_compare('2.12.0', '<', strict=True) - name: check for warning (only on platforms where auto result is not /usr/bin/python and legacy is) from ansible 2.12 on assert: @@ -85,9 +86,10 @@ - legacy.warnings | default([]) | length > 0 fail_msg: legacy={{legacy}} # only check for a warning if legacy returned /usr/bin/python and auto didn't - when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and - ansible_version.full is version_compare('2.12.0', '>=', strict=True) + when: + - legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' + - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' + - ansible_version.full is version_compare('2.12.0', '>=', strict=True) - name: test that auto_silent never warns and got the same answer as auto block: From b8dd348b1e0e6e7bc4a48cd4acbfc0d20b1fea45 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 22:11:38 +0100 Subject: [PATCH 40/44] Revert "Revert "fixed tests for ansible 2.12"" This reverts commit f82bd3d714605ddaa1b1e29d24a56d20cdc5c498. --- tests/ansible/integration/all.yml | 36 +++++++++++++++---------------- tests/ansible/regression/all.yml | 30 +++++++++++++------------- tests/ansible/setup/all.yml | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/ansible/integration/all.yml b/tests/ansible/integration/all.yml index 6bd5059a..ac196584 100644 --- a/tests/ansible/integration/all.yml +++ b/tests/ansible/integration/all.yml @@ -3,39 +3,39 @@ # This playbook imports all tests that are known to work at present. # -- include: action/all.yml +- import_playbook: action/all.yml tags: action -- include: async/all.yml +- import_playbook: async/all.yml tags: async -- include: become/all.yml +- import_playbook: become/all.yml tags: become -- include: connection/all.yml +- import_playbook: connection/all.yml tags: connection -- include: connection_delegation/all.yml +- import_playbook: connection_delegation/all.yml tags: connection_delegation -- include: connection_loader/all.yml +- import_playbook: connection_loader/all.yml tags: connection_loader -- include: context_service/all.yml +- import_playbook: context_service/all.yml tags: context_service -- include: glibc_caches/all.yml +- import_playbook: glibc_caches/all.yml tags: glibc_caches -- include: interpreter_discovery/all.yml +- import_playbook: interpreter_discovery/all.yml tags: interpreter_discovery -- include: local/all.yml +- import_playbook: local/all.yml tags: local -- include: module_utils/all.yml +- import_playbook: module_utils/all.yml tags: module_utils -- include: playbook_semantics/all.yml +- import_playbook: playbook_semantics/all.yml tags: playbook_semantics -- include: process/all.yml +- import_playbook: process/all.yml tags: process -- include: runner/all.yml +- import_playbook: runner/all.yml tags: runner -- include: ssh/all.yml +- import_playbook: ssh/all.yml tags: ssh -- include: strategy/all.yml +- import_playbook: strategy/all.yml tags: strategy -- include: stub_connections/all.yml +- import_playbook: stub_connections/all.yml tags: stub_connections -- include: transport_config/all.yml +- import_playbook: transport_config/all.yml tags: transport_config diff --git a/tests/ansible/regression/all.yml b/tests/ansible/regression/all.yml index 06ffdf61..875d520e 100644 --- a/tests/ansible/regression/all.yml +++ b/tests/ansible/regression/all.yml @@ -1,30 +1,30 @@ -- include: issue_109__target_has_old_ansible_installed.yml +- import_playbook: issue_109__target_has_old_ansible_installed.yml tags: regression -- include: issue_113__duplicate_module_imports.yml +- import_playbook: issue_113__duplicate_module_imports.yml tags: regression -- include: issue_118__script_not_marked_exec.yml +- import_playbook: issue_118__script_not_marked_exec.yml tags: regression -- include: issue_122__environment_difference.yml +- import_playbook: issue_122__environment_difference.yml tags: regression -- include: issue_140__thread_pileup.yml +- import_playbook: issue_140__thread_pileup.yml tags: regression -- include: issue_152__local_action_wrong_interpreter.yml +- import_playbook: issue_152__local_action_wrong_interpreter.yml tags: regression -- include: issue_152__virtualenv_python_fails.yml +- import_playbook: issue_152__virtualenv_python_fails.yml tags: regression -- include: issue_154__module_state_leaks.yml +- import_playbook: issue_154__module_state_leaks.yml tags: regression -- include: issue_177__copy_module_failing.yml +- import_playbook: issue_177__copy_module_failing.yml tags: regression -- include: issue_332_ansiblemoduleerror_first_occurrence.yml +- import_playbook: issue_332_ansiblemoduleerror_first_occurrence.yml tags: regression -- include: issue_558_unarchive_failed.yml +- import_playbook: issue_558_unarchive_failed.yml tags: regression -- include: issue_590__sys_modules_crap.yml +- import_playbook: issue_590__sys_modules_crap.yml tags: regression -- include: issue_591__setuptools_cwd_crash.yml +- import_playbook: issue_591__setuptools_cwd_crash.yml tags: regression -- include: issue_615__streaming_transfer.yml +- import_playbook: issue_615__streaming_transfer.yml tags: regression -- include: issue_655__wait_for_connection_error.yml +- import_playbook: issue_655__wait_for_connection_error.yml tags: regression diff --git a/tests/ansible/setup/all.yml b/tests/ansible/setup/all.yml index c51fa295..2ca6b97c 100644 --- a/tests/ansible/setup/all.yml +++ b/tests/ansible/setup/all.yml @@ -1 +1 @@ -- include: report.yml +- import_playbook: report.yml From 2b4f04c5548ee2be34a560154893f11ec0f9fef4 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 22:12:01 +0100 Subject: [PATCH 41/44] Revert "Revert "fixed tests for ansible 2.12"" This reverts commit 478f286efb6653194b752d42c1c94a3c625731eb. --- tests/ansible/integration/action/all.yml | 20 ++++---- tests/ansible/integration/async/all.yml | 18 ++++---- tests/ansible/integration/become/all.yml | 12 ++--- tests/ansible/integration/connection/all.yml | 18 ++++---- .../integration/connection_delegation/all.yml | 10 ++-- .../integration/connection_loader/all.yml | 6 +-- .../integration/context_service/all.yml | 8 ++-- .../ansible/integration/glibc_caches/all.yml | 2 +- .../integration/interpreter_discovery/all.yml | 4 +- tests/ansible/integration/local/all.yml | 4 +- .../ansible/integration/module_utils/all.yml | 10 ++-- .../integration/playbook_semantics/all.yml | 8 ++-- tests/ansible/integration/process/all.yml | 2 +- tests/ansible/integration/runner/all.yml | 46 +++++++++---------- tests/ansible/integration/ssh/all.yml | 6 +-- tests/ansible/integration/strategy/all.yml | 2 +- .../integration/stub_connections/all.yml | 14 +++--- .../integration/transport_config/all.yml | 22 ++++----- 18 files changed, 106 insertions(+), 106 deletions(-) diff --git a/tests/ansible/integration/action/all.yml b/tests/ansible/integration/action/all.yml index c43d5cc7..d823e05e 100644 --- a/tests/ansible/integration/action/all.yml +++ b/tests/ansible/integration/action/all.yml @@ -1,10 +1,10 @@ -- include: copy.yml -- include: fixup_perms2__copy.yml -- include: low_level_execute_command.yml -- include: make_tmp_path.yml -- include: make_tmp_path__double.yml -- include: remote_expand_user.yml -- include: remote_file_exists.yml -- include: remove_tmp_path.yml -- include: synchronize.yml -- include: transfer_data.yml +- import_playbook: copy.yml +- import_playbook: fixup_perms2__copy.yml +- import_playbook: low_level_execute_command.yml +- import_playbook: make_tmp_path.yml +- import_playbook: make_tmp_path__double.yml +- import_playbook: remote_expand_user.yml +- import_playbook: remote_file_exists.yml +- import_playbook: remove_tmp_path.yml +- import_playbook: synchronize.yml +- import_playbook: transfer_data.yml diff --git a/tests/ansible/integration/async/all.yml b/tests/ansible/integration/async/all.yml index f14537ed..61d2d35c 100644 --- a/tests/ansible/integration/async/all.yml +++ b/tests/ansible/integration/async/all.yml @@ -1,9 +1,9 @@ -- include: multiple_items_loop.yml -- include: result_binary_producing_json.yml -- include: result_binary_producing_junk.yml -- include: result_shell_echo_hi.yml -- include: runner_new_process.yml -- include: runner_one_job.yml -- include: runner_timeout_then_polling.yml -- include: runner_two_simultaneous_jobs.yml -- include: runner_with_polling_and_timeout.yml +- import_playbook: multiple_items_loop.yml +- import_playbook: result_binary_producing_json.yml +- import_playbook: result_binary_producing_junk.yml +- import_playbook: result_shell_echo_hi.yml +- import_playbook: runner_new_process.yml +- import_playbook: runner_one_job.yml +- import_playbook: runner_timeout_then_polling.yml +- import_playbook: runner_two_simultaneous_jobs.yml +- import_playbook: runner_with_polling_and_timeout.yml diff --git a/tests/ansible/integration/become/all.yml b/tests/ansible/integration/become/all.yml index 5fa030d1..c9c331dd 100644 --- a/tests/ansible/integration/become/all.yml +++ b/tests/ansible/integration/become/all.yml @@ -1,7 +1,7 @@ -- include: su_password.yml -- include: sudo_flags_failure.yml -- include: sudo_nonexistent.yml -- include: sudo_nopassword.yml -- include: sudo_password.yml -- include: sudo_requiretty.yml +- import_playbook: su_password.yml +- import_playbook: sudo_flags_failure.yml +- import_playbook: sudo_nonexistent.yml +- import_playbook: sudo_nopassword.yml +- import_playbook: sudo_password.yml +- import_playbook: sudo_requiretty.yml diff --git a/tests/ansible/integration/connection/all.yml b/tests/ansible/integration/connection/all.yml index 348857f5..b707b0eb 100644 --- a/tests/ansible/integration/connection/all.yml +++ b/tests/ansible/integration/connection/all.yml @@ -1,11 +1,11 @@ --- -- include: become_same_user.yml -- include: disconnect_during_module.yml -- include: disconnect_resets_connection.yml -- include: exec_command.yml -- include: home_dir.yml -- include: put_large_file.yml -- include: put_small_file.yml -- include: reset.yml -- include: reset_become.yml +- import_playbook: become_same_user.yml +- import_playbook: disconnect_during_module.yml +- import_playbook: disconnect_resets_connection.yml +- import_playbook: exec_command.yml +- import_playbook: home_dir.yml +- import_playbook: put_large_file.yml +- import_playbook: put_small_file.yml +- import_playbook: reset.yml +- import_playbook: reset_become.yml diff --git a/tests/ansible/integration/connection_delegation/all.yml b/tests/ansible/integration/connection_delegation/all.yml index c9b09687..8d5ffe03 100644 --- a/tests/ansible/integration/connection_delegation/all.yml +++ b/tests/ansible/integration/connection_delegation/all.yml @@ -1,5 +1,5 @@ -- include: delegate_to_template.yml -- include: local_action.yml -- include: osa_container_standalone.yml -- include: osa_delegate_to_self.yml -- include: stack_construction.yml +- import_playbook: delegate_to_template.yml +- import_playbook: local_action.yml +- import_playbook: osa_container_standalone.yml +- import_playbook: osa_delegate_to_self.yml +- import_playbook: stack_construction.yml diff --git a/tests/ansible/integration/connection_loader/all.yml b/tests/ansible/integration/connection_loader/all.yml index 76ffe8f4..7a44bb2f 100644 --- a/tests/ansible/integration/connection_loader/all.yml +++ b/tests/ansible/integration/connection_loader/all.yml @@ -1,3 +1,3 @@ -- include: local_blemished.yml -- include: paramiko_unblemished.yml -- include: ssh_blemished.yml +- import_playbook: local_blemished.yml +- import_playbook: paramiko_unblemished.yml +- import_playbook: ssh_blemished.yml diff --git a/tests/ansible/integration/context_service/all.yml b/tests/ansible/integration/context_service/all.yml index 7770629a..edcf8eff 100644 --- a/tests/ansible/integration/context_service/all.yml +++ b/tests/ansible/integration/context_service/all.yml @@ -1,4 +1,4 @@ -- include: disconnect_cleanup.yml -- include: lru_one_target.yml -- include: reconnection.yml -- include: remote_name.yml +- import_playbook: disconnect_cleanup.yml +- import_playbook: lru_one_target.yml +- import_playbook: reconnection.yml +- import_playbook: remote_name.yml diff --git a/tests/ansible/integration/glibc_caches/all.yml b/tests/ansible/integration/glibc_caches/all.yml index 8cff4ea8..7d524540 100644 --- a/tests/ansible/integration/glibc_caches/all.yml +++ b/tests/ansible/integration/glibc_caches/all.yml @@ -1,2 +1,2 @@ -- include: resolv_conf.yml +- import_playbook: resolv_conf.yml diff --git a/tests/ansible/integration/interpreter_discovery/all.yml b/tests/ansible/integration/interpreter_discovery/all.yml index 403fd761..56fbc622 100644 --- a/tests/ansible/integration/interpreter_discovery/all.yml +++ b/tests/ansible/integration/interpreter_discovery/all.yml @@ -1,2 +1,2 @@ -- include: complex_args.yml -- include: ansible_2_8_tests.yml +- import_playbook: complex_args.yml +- import_playbook: ansible_2_8_tests.yml diff --git a/tests/ansible/integration/local/all.yml b/tests/ansible/integration/local/all.yml index 5f8b4dd4..383a9108 100644 --- a/tests/ansible/integration/local/all.yml +++ b/tests/ansible/integration/local/all.yml @@ -1,4 +1,4 @@ -- include: cwd_preserved.yml -- include: env_preserved.yml +- import_playbook: cwd_preserved.yml +- import_playbook: env_preserved.yml diff --git a/tests/ansible/integration/module_utils/all.yml b/tests/ansible/integration/module_utils/all.yml index b68e2ee3..c8b8f2fb 100644 --- a/tests/ansible/integration/module_utils/all.yml +++ b/tests/ansible/integration/module_utils/all.yml @@ -1,6 +1,6 @@ -#- include: from_config_path.yml -#- include: from_config_path_pkg.yml -#- include: adjacent_to_playbook.yml -- include: adjacent_to_role.yml -#- include: overrides_builtin.yml +#- import_playbook: from_config_path.yml +#- import_playbook: from_config_path_pkg.yml +#- import_playbook: adjacent_to_playbook.yml +- import_playbook: adjacent_to_role.yml +#- import_playbook: overrides_builtin.yml diff --git a/tests/ansible/integration/playbook_semantics/all.yml b/tests/ansible/integration/playbook_semantics/all.yml index ec7a9a07..6c8dd065 100644 --- a/tests/ansible/integration/playbook_semantics/all.yml +++ b/tests/ansible/integration/playbook_semantics/all.yml @@ -1,4 +1,4 @@ -- include: become_flags.yml -- include: delegate_to.yml -- include: environment.yml -- include: with_items.yml +- import_playbook: become_flags.yml +- import_playbook: delegate_to.yml +- import_playbook: environment.yml +- import_playbook: with_items.yml diff --git a/tests/ansible/integration/process/all.yml b/tests/ansible/integration/process/all.yml index a309113a..c50d6bd5 100644 --- a/tests/ansible/integration/process/all.yml +++ b/tests/ansible/integration/process/all.yml @@ -1 +1 @@ -- include: "unix_socket_cleanup.yml" +- import_playbook: "unix_socket_cleanup.yml" diff --git a/tests/ansible/integration/runner/all.yml b/tests/ansible/integration/runner/all.yml index 19586547..5de9fb27 100644 --- a/tests/ansible/integration/runner/all.yml +++ b/tests/ansible/integration/runner/all.yml @@ -1,24 +1,24 @@ -- include: atexit.yml -- include: builtin_command_module.yml -- include: crashy_new_style_module.yml -- include: custom_bash_hashbang_argument.yml -- include: custom_bash_old_style_module.yml -- include: custom_bash_want_json_module.yml -- include: custom_binary_producing_json.yml -- include: custom_binary_producing_junk.yml -- include: custom_binary_single_null.yml -- include: custom_perl_json_args_module.yml -- include: custom_perl_want_json_module.yml -- include: custom_python_json_args_module.yml -- include: custom_python_new_style_missing_interpreter.yml -- include: custom_python_new_style_module.yml -- include: custom_python_prehistoric_module.yml -- include: custom_python_want_json_module.yml -- include: custom_script_interpreter.yml -- include: environment_isolation.yml +- import_playbook: atexit.yml +- import_playbook: builtin_command_module.yml +- import_playbook: crashy_new_style_module.yml +- import_playbook: custom_bash_hashbang_argument.yml +- import_playbook: custom_bash_old_style_module.yml +- import_playbook: custom_bash_want_json_module.yml +- import_playbook: custom_binary_producing_json.yml +- import_playbook: custom_binary_producing_junk.yml +- import_playbook: custom_binary_single_null.yml +- import_playbook: custom_perl_json_args_module.yml +- import_playbook: custom_perl_want_json_module.yml +- import_playbook: custom_python_json_args_module.yml +- import_playbook: custom_python_new_style_missing_interpreter.yml +- import_playbook: custom_python_new_style_module.yml +- import_playbook: custom_python_prehistoric_module.yml +- import_playbook: custom_python_want_json_module.yml +- import_playbook: custom_script_interpreter.yml +- import_playbook: environment_isolation.yml # I hate this test. I hope it dies, it has caused nothing but misery and suffering -#- include: etc_environment.yml -- include: forking_active.yml -- include: forking_correct_parent.yml -- include: forking_inactive.yml -- include: missing_module.yml +#- import_playbook: etc_environment.yml +- import_playbook: forking_active.yml +- import_playbook: forking_correct_parent.yml +- import_playbook: forking_inactive.yml +- import_playbook: missing_module.yml diff --git a/tests/ansible/integration/ssh/all.yml b/tests/ansible/integration/ssh/all.yml index 28495f49..a8335ab7 100644 --- a/tests/ansible/integration/ssh/all.yml +++ b/tests/ansible/integration/ssh/all.yml @@ -1,3 +1,3 @@ -- include: config.yml -- include: timeouts.yml -- include: variables.yml +- import_playbook: config.yml +- import_playbook: timeouts.yml +- import_playbook: variables.yml diff --git a/tests/ansible/integration/strategy/all.yml b/tests/ansible/integration/strategy/all.yml index b519e1bc..3304817c 100644 --- a/tests/ansible/integration/strategy/all.yml +++ b/tests/ansible/integration/strategy/all.yml @@ -1 +1 @@ -- include: mixed_vanilla_mitogen.yml +- import_playbook: mixed_vanilla_mitogen.yml diff --git a/tests/ansible/integration/stub_connections/all.yml b/tests/ansible/integration/stub_connections/all.yml index e1810138..a9744ab7 100644 --- a/tests/ansible/integration/stub_connections/all.yml +++ b/tests/ansible/integration/stub_connections/all.yml @@ -1,7 +1,7 @@ -- include: kubectl.yml -- include: lxc.yml -- include: lxd.yml -- include: mitogen_doas.yml -- include: mitogen_sudo.yml -- include: setns_lxc.yml -- include: setns_lxd.yml +- import_playbook: kubectl.yml +- import_playbook: lxc.yml +- import_playbook: lxd.yml +- import_playbook: mitogen_doas.yml +- import_playbook: mitogen_sudo.yml +- import_playbook: setns_lxc.yml +- import_playbook: setns_lxd.yml diff --git a/tests/ansible/integration/transport_config/all.yml b/tests/ansible/integration/transport_config/all.yml index d4ed832f..548e7f7e 100644 --- a/tests/ansible/integration/transport_config/all.yml +++ b/tests/ansible/integration/transport_config/all.yml @@ -1,11 +1,11 @@ -- include: become_method.yml -- include: become_pass.yml -- include: become_user.yml -- include: become.yml -- include: password.yml -- include: port.yml -- include: python_path.yml -- include: remote_addr.yml -- include: remote_user.yml -- include: transport.yml -- include: transport__smart.yml +- import_playbook: become_method.yml +- import_playbook: become_pass.yml +- import_playbook: become_user.yml +- import_playbook: become.yml +- import_playbook: password.yml +- import_playbook: port.yml +- import_playbook: python_path.yml +- import_playbook: remote_addr.yml +- import_playbook: remote_user.yml +- import_playbook: transport.yml +- import_playbook: transport__smart.yml From f1fde91984753ab1eb23160f14f964b1b0e90f78 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Sun, 12 Dec 2021 22:13:03 +0100 Subject: [PATCH 42/44] Revert "Revert "fixed tests for ansible 2.12"" This reverts commit ffb58cd5571e2077abb05554849b5ab10824b67d. --- tests/ansible/all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ansible/all.yml b/tests/ansible/all.yml index e8bf26f2..7a3e7000 100644 --- a/tests/ansible/all.yml +++ b/tests/ansible/all.yml @@ -1,6 +1,6 @@ -- include: setup/all.yml +- import_playbook: setup/all.yml tags: setup -- include: regression/all.yml +- import_playbook: regression/all.yml tags: regression -- include: integration/all.yml +- import_playbook: integration/all.yml tags: integration From 77c306199c201bbf00fb23f2a8ae4f519444b063 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 15 Dec 2021 12:07:00 +0000 Subject: [PATCH 43/44] ci: Explicitly test on macOS-11 VM Image As of writing this macOS-latest isn't quite yet upgraded, but warnings about it are spewing out. --- .ci/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 3484cd4d..7af6cdb5 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -77,14 +77,14 @@ jobs: STRATEGY: linear ANSIBLE_SKIP_TAGS: resource_intensive -- job: MacLatest +- job: Mac11 # vanilla Ansible is really slow timeoutInMinutes: 120 steps: - template: azure-pipelines-steps.yml pool: # https://github.com/actions/virtual-environments/blob/main/images/macos/ - vmImage: macOS-latest + vmImage: macOS-11 strategy: matrix: Mito_27: From d424895344d654a2ac5e81c43302d627c980b30c Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 15 Dec 2021 12:08:26 +0000 Subject: [PATCH 44/44] ci: Drop Mac1014 jobs The VM Image has been retired by Azure Pipelines. --- .ci/azure-pipelines.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 7af6cdb5..70a202b3 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -9,26 +9,6 @@ #ANSIBLE_VERBOSITY: 3 jobs: -- job: Mac1014 - # vanilla Ansible is really slow - timeoutInMinutes: 120 - steps: - - template: azure-pipelines-steps.yml - pool: - # https://github.com/actions/virtual-environments/blob/main/images/macos/ - vmImage: macOS-10.14 - strategy: - matrix: - Mito_27: - python.version: '2.7' - tox.env: py27-mode_mitogen - Mito_36: - python.version: '3.6' - tox.env: py36-mode_mitogen - Mito_39: - python.version: '3.9' - tox.env: py39-mode_mitogen - - job: Mac1015 # vanilla Ansible is really slow timeoutInMinutes: 120