1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets
Alexei Znamensky f5b1b3c6f0
Command Runner (#4476)
* initial commit, passing unit tests

* passing one very silly integration test

* multiple changes:

- updated copyright year
- cmd_runner
  - added fmt_optval
  - created specific exceptions
  - fixed bug in context class where values from module params were not
    being used for resolving cmd arguments
  - changed order of class declaration for readability purpose
- tests
  - minor improvements in integration test code
  - removed some extraneous code in msimple.yml
  - minor improvements in unit tests
  - added few missing cases to unit test

* multiple changes

cmd_runner.py

- renamed InvalidParameterName to MissingArgumentFormat
  - improved exception parameters
- added repr and str to all exceptions
- added unpacking decorator for fmt functions
- CmdRunner
  - improved parameter validation
- _CmdRunnerContext
  - Context runs must now pass named arguments
  - Simplified passing of additional arguments to module.run_command()
  - Provided multiple context variables with info about the run

Integration tests

- rename msimple.py to cmd_echo.py for clarity
- added more test cases

* cmd_runner: env update can be passed to runner

* adding runner context info to output

* added comment on OrderedDict

* wrong variable

* refactored all fmt functions into static methods of a class

Imports should be simpler now, only one object fmt, with attr access to all callables

* added unit tests for CmdRunner

* fixed sanity checks

* fixed mock imports

* added more unit tests for CmdRunner

* terminology consistency

* multiple adjustments:

- remove extraneous imports
- renamed some variables
- added wrapper around arg formatters to handle individual arg ignore_none behaviour

* removed old code commented out in test

* multiple changes:

- ensure fmt functions return list of strings
- renamed fmt parameter from `option` to `args`
- renamed fmt.mapped to fmt.as_map
- simplified fmt.as_map
- added tests for fmt.as_fixed

* more improvements in formats

* fixed sanity

* args_order can be a string (to be split())

and improved integration test

* simplified integration test

* removed overkill str() on values - run_command does that for us

* as_list makes more sense than as_str in that context

* added changelog fragment

* Update plugins/module_utils/cmd_runner.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* adjusted __repr__ output for the exceptions

* added superclass object to classes

* added additional comment on the testcase sample/example

* suggestion from PR

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-25 22:12:00 +02:00
..
aix_devices Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
aix_filesystem Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
alternatives CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
ansible_galaxy_install Re-enable ansible_galaxy_install tests. (#4253) 2022-02-22 23:01:23 +01:00
apache2_module apache2_module - multiple improvements (#3106) 2021-07-30 18:07:38 +02:00
archive Fix OSX 10.11 CI runs (#3501) 2021-10-02 21:18:03 +02:00
callback YAML callback: do not remove non-ASCII Unicode from multi-line string output (#1522) 2020-12-22 09:24:20 +01:00
callback_diy YAML callback: do not remove non-ASCII Unicode from multi-line string output (#1522) 2020-12-22 09:24:20 +01:00
callback_log_plays Fix callback_log_plays tests for current devel branch of ansible-base. (#1221) 2020-11-03 14:11:31 +01:00
callback_yaml Revert "Temporarily disable yaml callback tests. (#3651)" (#3657) 2021-11-01 19:12:37 +01:00
cargo Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
cloud_init_data_facts CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
cmd_runner Command Runner (#4476) 2022-04-25 22:12:00 +02:00
connection Test of using FQCN for some builtin plugins (#660) 2020-07-16 12:24:04 +03:00
connection_chroot chroot: re-enable connection chroot tests (#1591) 2021-01-06 08:07:46 +01:00
connection_jail Fix FQCRs. (#64) 2020-03-29 13:02:28 +02:00
connection_lxc Fix FQCRs. (#64) 2020-03-29 13:02:28 +02:00
connection_lxd Fix FQCRs. (#64) 2020-03-29 13:02:28 +02:00
connection_posix Initial commit 2020-03-09 09:11:07 +00:00
consul CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
copr Fix copr integration tests (#3237) 2021-09-01 22:58:10 +02:00
cpanm cpanm - revamp module (#2218) 2021-04-18 10:55:47 +02:00
cronvar cronvar: ensure creation of /etc/cron.d in test (#4440) 2022-04-02 18:18:59 +02:00
deploy_helper Improve CI (#3348) 2021-09-09 07:31:44 +02:00
discord Add discord integration tests (#4463) 2022-04-10 08:41:46 +02:00
django_manage Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
dnf_versionlock CI: Remove 'warn:' that's removed in ansible-core 2.14 (#4434) 2022-04-01 22:53:05 +02:00
dpkg_divert Disable docker tests (#1194) 2020-10-29 08:02:33 +01:00
etcd3 Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
filesize filesize: fix alpine linux sparse file (#4288) 2022-02-27 13:45:41 +01:00
filesystem Implement btrfs resize support (#4465) 2022-04-13 07:07:51 +02:00
filter_counter Add counter filter (#3921) 2021-12-26 14:56:21 +01:00
filter_dict Add dict filter (#2171) 2021-04-08 07:50:28 +02:00
filter_dict_kv Add filter dict_kv (#1264) 2020-11-24 05:41:18 +01:00
filter_from_csv New Filter plugin from_csv (#2037) 2021-03-21 13:21:54 +01:00
filter_groupby Enable tests (#3015) 2021-07-16 19:29:00 +02:00
filter_hashids New filter plugins: hashids_encode and hashids_decode (#2244) 2021-04-17 20:00:03 +02:00
filter_jc Add macOS 11.1 tests (#1619) 2021-01-18 10:52:56 +00:00
filter_json_query Add macOS 11.1 tests (#1619) 2021-01-18 10:52:56 +00:00
filter_list Add options to filter lists_mergeby (#4058) 2022-01-28 08:19:19 +01:00
filter_path_join_shim Add path_join compatibility shim (#2172) 2021-04-08 07:49:57 +02:00
filter_random_mac Improve CI (#3348) 2021-09-09 07:31:44 +02:00
filter_time Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
filter_unicode_normalize New filter plugin - unicode_normalization (#3359) 2021-09-12 13:46:53 +02:00
filter_version_sort Add version_sort filter to properly sort list of versions (#1916) 2021-02-27 17:42:45 +01:00
flatpak Improve CI (#3348) 2021-09-09 07:31:44 +02:00
flatpak_remote removed extraneous dependency in integration test (#3114) 2021-07-30 18:00:14 +02:00
gandi_livedns Add gandi_livedns module (#328) 2021-03-21 11:25:24 +01:00
gem CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
git_config Improve CI (#3348) 2021-09-09 07:31:44 +02:00
github_issue Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
gitlab_branch add module gitlab_branch (#3795) 2021-12-09 21:02:58 +01:00
gitlab_deploy_key Feature/gitlab deploykey updkey (#1661) 2021-02-05 07:30:05 +01:00
gitlab_group Add require_two_factor_authentication property to gitlab group (#3367) 2021-09-20 06:55:43 +02:00
gitlab_group_members Enhancement to gitlab_group_members to accept user lists as input (#3047) 2021-08-31 15:07:52 +02:00
gitlab_group_variable Rework of gitlab_project_variable over gitlab_group_variable (#4086) 2022-02-18 20:58:38 +01:00
gitlab_hook Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
gitlab_project gitlab_project: Add initialize_with_readme option (#3601) 2021-10-30 08:14:30 +02:00
gitlab_project_members Get behavior of gitlab_project_members to the one of gitlab_group_members (#3319) 2021-09-16 22:26:31 +02:00
gitlab_project_variable gitlab_project_variable: Allow delete without value (#4150) 2022-02-05 21:02:04 +01:00
gitlab_runner Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
gitlab_user gitlab_user: add expires_at option (#2450) 2021-05-14 10:00:59 +02:00
hg Improve CI (#3348) 2021-09-09 07:31:44 +02:00
homebrew Fix OSX 10.11 CI runs (#3501) 2021-10-02 21:18:03 +02:00
homebrew_cask homebrew_cask: reinstall when force is install option (#4090) 2022-02-02 21:31:05 +01:00
homectl CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
hwc_ecs_instance Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_evs_disk Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_network_vpc Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_smn_topic Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_eip Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_peering_connect Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_port Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_private_ip Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_route Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_security_group Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_security_group_rule Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
hwc_vpc_subnet Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
ilo_redfish_config Modules for managing HPE iLO (#3740) 2021-12-11 21:27:09 +01:00
ilo_redfish_info Modules for managing HPE iLO (#3740) 2021-12-11 21:27:09 +01:00
influxdb_user Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
ini_file ini_file: Don't report changed=true when removing if nothing is changed. (#4155) 2022-02-17 13:35:46 +01:00
interfaces_file interfaces_file - fixed dup options bug (#3862) 2021-12-07 21:54:54 +01:00
ipify_facts Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
iptables_state iptables_state: fix broken query of async_status result (#2671) 2021-05-29 10:50:24 +02:00
ipwcli_dns Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
iso_create Improve CI (#3348) 2021-09-09 07:31:44 +02:00
iso_extract CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
java_cert Improve CI (#3348) 2021-09-09 07:31:44 +02:00
java_keystore Improve CI (#3348) 2021-09-09 07:31:44 +02:00
jboss Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
jira jira - module revamp -> moved code to class (#2208) 2021-04-26 13:09:19 +02:00
kernel_blacklist kernel_blacklist - revamped the module (#3329) 2021-09-20 19:39:35 +02:00
keycloak_client Bugfix keycloak client do not report changes when there is none (#3610) 2021-10-30 08:18:31 +02:00
keycloak_identity_provider Keycloak: add identity providers management (#3210) 2021-08-31 07:07:53 +02:00
keycloak_role Add Keycloak roles module (#2930) 2021-07-19 23:17:39 +02:00
keycloak_user_federation Add keycloak_user_federation module (#3340) 2021-09-20 19:19:42 +02:00
launchd removed extraneous dependency in integration test (#3114) 2021-07-30 18:00:14 +02:00
ldap_search Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
listen_ports_facts Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
locale_gen removed extraneous dependency in integration test (#3114) 2021-07-30 18:00:14 +02:00
lookup_cartesian Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
lookup_collection_version Add collection_version lookup (#3633) 2021-11-01 19:01:52 +01:00
lookup_dependent Add dependent lookup plugin (#2164) 2021-05-11 19:27:05 +02:00
lookup_etcd3 Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
lookup_flattened Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
lookup_lmdb_kv Fix lmdb lookup tests (#842) 2020-08-29 10:47:28 +02:00
lookup_passwordstore CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
lookup_random_pet random_pet: Random pet name generator (#2479) 2021-05-14 10:55:27 +02:00
lookup_random_string Fix spurious test errors. (#2709) 2021-06-04 09:53:34 +02:00
lookup_random_words In the nightly CI run this test failed. Adjust it to be on the safe side. (#3638) 2021-10-30 10:58:01 +02:00
lvg Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
mail mail: adding capability to specify ehlo hostname (#3425) 2021-09-24 05:30:14 +00:00
mas Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_dns_reload Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_memstore_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_server_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_zone Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_zone_domain Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
memset_zone_record Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
module_helper MH decorators - added decorators for check_mode (#3849) 2021-12-05 21:47:51 +01:00
monit CI: Remove 'warn:' that's removed in ansible-core 2.14 (#4434) 2022-04-01 22:53:05 +02:00
mqtt Check targets (#3019) 2021-07-16 19:52:09 +02:00
mssql_script added module mssql_script (#3557) 2021-10-27 22:38:35 +02:00
nomad CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
npm CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
odbc Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
one_host Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
one_template Make ready for split-controller testing in ansible-core (#3345) 2021-09-21 08:16:42 +02:00
osx_defaults Bugfix: Fix parsing array values from osx_defaults (#358) 2020-12-09 08:29:58 +03:00
pacman pacman: Fix removing locally installed packages (#4464) 2022-04-13 13:34:33 +02:00
pagerduty_user a new module pagerduty_user (#1025) 2020-11-26 13:22:35 +01:00
pam_limits pam_limits: adds check mode and diff mode (#1575) 2021-01-03 13:32:54 +01:00
pamd pamd - fixed issue+minor refactorings (#3285) 2021-08-31 12:34:57 +02:00
pids pids: re-enabled tests on Alpine Linux (#4405) 2022-04-02 08:18:19 +02:00
pipx pipx - fixed --include-apps bug (#3800) 2021-11-30 07:10:20 +01:00
pkgng CI: remove FreeBSD 12.0 and 12.2, re-enable pkgng tests (#4511) 2022-04-16 12:09:35 +02:00
pkgutil pkgutil: add update all, check-mode, squashing and examples (#799) 2020-09-30 06:19:36 +02:00
proxmox Add proxmox_nic module (#2449) 2021-05-13 21:48:49 +02:00
python_requirements_info python_requirements_info - improvements (#3797) 2021-11-30 06:08:45 +00:00
read_csv Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
redis_info Redis: slave -> replica (#2867) 2021-06-24 22:33:29 +02:00
rundeck Add new modules rundeck_job_run and rundeck_job_executions_info (#3521) 2021-10-11 06:55:47 +02:00
scaleway_compute Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_database_backup Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_image_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_ip Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_ip_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_lb Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_organization_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_security_group Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_security_group_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_security_group_rule Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_server_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_snapshot_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_sshkey Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_user_data Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_volume Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
scaleway_volume_info Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
sefcontext Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
sensu_client Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
sensu_handler Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_cron CI: Remove 'warn:' that's removed in ansible-core 2.14 (#4434) 2022-04-01 22:53:05 +02:00
setup_epel/tasks Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_etcd3 Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_flatpak_remote CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
setup_gnutar Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
setup_influxdb/tasks Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_java_keytool Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
setup_mosquitto Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_openldap Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
setup_opennebula Make ready for split-controller testing in ansible-core (#3345) 2021-09-21 08:16:42 +02:00
setup_openssl CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
setup_pkg_mgr/tasks Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
setup_postgresql_db CI: Remove 'warn:' that's removed in ansible-core 2.14 (#4434) 2022-04-01 22:53:05 +02:00
setup_redis_replication CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
setup_remote_constraints Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_remote_tmp_dir Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_rundeck Improve ArchLinux tests (#4291) 2022-02-27 13:51:26 +01:00
setup_snap Re-enable snap tests (#3967) 2022-01-05 17:13:50 +01:00
setup_tls Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
setup_wildfly_server Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
shutdown CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
snap Add option "options" to snap module (#3943) 2022-01-24 06:39:37 +01:00
snap_alias Re-enable snap tests (#3967) 2022-01-05 17:13:50 +01:00
spectrum_model_attrs spectrum_model_attrs: Initial commit (#1802) 2021-04-12 22:26:43 +02:00
ssh_config ssh_config: Add 'forwardagent' option (#3495) 2021-10-14 21:24:23 +02:00
sudoers feat: sudoers module supports runas parameter with default of root (#4380) 2022-03-24 07:07:07 +01:00
supervisorctl Improve CI (#3348) 2021-09-09 07:31:44 +02:00
sysrc Clean up test entries from sysrc tests (#2330) 2021-05-03 21:05:07 +02:00
terraform Terraform init -upgrade flag (#4455) 2022-04-13 11:16:54 +00:00
test_a_module a_module test: fix crash in case of tombstoning (#3660) 2021-11-04 08:29:17 +01:00
timezone Make timezone tests work on Alpine. (#4292) 2022-02-27 13:55:03 +01:00
ufw Run tests with macOS 10.15. (#971) 2020-09-30 14:00:05 +02:00
wakeonlan Add headers to ci tests (#954) 2020-09-25 08:01:17 +02:00
xattr Improve CI (#3348) 2021-09-09 07:31:44 +02:00
xfs_quota bugfix: xfs_quota feedback on projects not initialized has changed (#1596) 2021-02-27 08:38:24 +01:00
xml Massive adjustment in integration tests for changed and failed (#2577) 2021-05-22 13:51:36 +02:00
yarn CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) 2022-02-21 21:14:45 +01:00
yum_versionlock Update AZP config (#3111) 2021-08-05 23:46:39 +02:00
zypper Diable netcat conflict in zypper tests as one package seems to be no longer available. (#3438) 2021-09-25 17:16:22 +02:00
zypper_repository zypper_repository: Improve .repo file idempotency (#3474) 2021-10-08 07:40:30 +02:00
__init__.py Initial commit 2020-03-09 09:11:07 +00:00