freeipa/ipatests/test_integration
Sergey Orlov 2e92d0836d
ipatests: add utility for managing domain name resolvers
Many test scenarios need to configure resolvers on test machines. Most
notable patterns are:

* using IPA master as DNS resolver on clients and replicas
* intentionally breaking name resolution

Now it is done by directly editing /etc/resolv.conf file. While being
simple this approach has following issues:

* NetworkManager restores this file periodically and on specific events
* This is not how users are expected to manage resolvers on modern
  systems with NetworkManager and systemd-resolved.

This patch introduces three classes for main types of resolvers management:
* plain file
* NetworkManager
* systemd-resolved

For each resolver manager the native way of configuring of nameserves is
used: direct editing for /etc/resolv.conf or drop-in config files for
NM and resolved.

The type of resolver is automatically detected for each host and an
appropriate instance is added to Host object.

The Resolver class (and it's subclasses) provide convenience functions
for changing nameservers and restoring the original config.
During all operations (backup, modify, restore) it checks that resolver
configuration has not been altered unexpectedly and raises exception if it
was. This helps to detect unexpected changes in resolvers.

Related to https://pagure.io/freeipa/issue/8703

Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2021-03-04 18:47:32 +01:00
..
__init__.py Add marker needs_ipaapi and option to skip tests 2017-12-11 20:40:06 +01:00
base.py lint: Make Pylint-2.4 happy again 2020-02-12 18:08:32 +02:00
test_acme.py Revert "Remove test for minimum ACME support and rely on package deps" 2021-01-15 10:07:33 +01:00
test_adtrust_install.py ipatests: use pexpect to control inetractive session of ipa-adtrust-install 2021-02-03 09:06:12 +02:00
test_advise.py pylint: Synchronize pylint plugin to ipatests code 2020-02-12 18:08:32 +02:00
test_authselect.py ipatests: fix test_authselect 2020-07-30 13:10:39 +02:00
test_automember.py Tests for autounmembership feature 2019-06-06 16:51:55 +02:00
test_backup_and_restore.py ipatests: error message check in uninstall log for KRA 2021-02-18 16:44:29 +01:00
test_ca_custom_sdn.py test_integration: add tests for custom CA subject DN 2019-10-17 08:17:46 +02:00
test_caless.py ipatests: Check permissions of /etc/ipa/ca.crt new installations 2020-08-06 12:49:51 +02:00
test_cert.py ipatests: Test certmonger IPA responder switched to JSONRPC 2020-11-18 08:16:58 -05:00
test_cli_ipa_not_configured.py ipatests: Test for ipa-backup with ipa not configured 2019-08-27 12:04:45 +02:00
test_commands.py ipatests: use whole date when calling journalctl --since 2021-03-02 11:47:09 +01:00
test_crlgen_manage.py ipatests: fix test_crlgen_manage 2019-11-29 11:17:13 +01:00
test_customized_ds_config_install.py Fix nsslapd-db-lock tuning of BDB backend 2020-09-24 17:03:00 +02:00
test_dns_locations.py dnspython: Add compatibility shim 2020-08-31 09:46:03 +03:00
test_dns.py Tests for fake_mname parameter setup 2020-08-06 18:43:53 +02:00
test_dnssec.py ipatests: add a test for ZSK/KSK keytype in DNSKEY record 2021-02-04 14:20:59 +01:00
test_epn.py EPN: Allow authentication by SMTP client's certificate 2020-11-17 14:25:39 +02:00
test_external_ca.py Removes several pylint warnings. 2019-09-27 09:38:32 +02:00
test_fips.py Test installation with (fake) userspace FIPS 2019-11-14 16:01:15 +01:00
test_forced_client_reenrollment.py ipatests/test_integration/test_forced_client_reenrollment.py: Use unshare 2018-12-03 11:26:08 +01:00
test_http_kdc_proxy.py ipatests/test_integration/test_http_kdc_proxy.py: Use new firewall import 2018-12-03 11:26:08 +01:00
test_idviews.py ipatests: fix the method adding ifp to sssd.conf 2020-06-24 17:22:24 -04:00
test_installation_client.py ipatests: make sure dns_lookup_kdc is always true 2020-12-18 13:35:06 +02:00
test_installation.py ipatests: check that zonemgr is set correctly during server install 2021-02-25 20:24:55 +01:00
test_ipa_cert_fix.py ipatests: Test if ipa-cert-fix renews expired certs with kra installed 2021-02-23 13:25:26 +01:00
test_ipahealthcheck.py ipatests: update expected error message 2021-02-15 15:22:19 +02:00
test_kerberos_flags.py Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
test_krbtpolicy.py ccache_sweeper: Add gssproxy service 2021-03-04 14:17:01 +02:00
test_legacy_clients.py ipatests: when talking to AD DCs, use FQDN credentials 2021-01-26 13:05:27 -05:00
test_membermanager.py Show group-add/remove-member-manager failures 2019-11-20 17:08:40 +01:00
test_netgroup.py Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
test_nfs.py ipatests: remove the xfail for test_nfs.py 2020-07-30 13:10:39 +02:00
test_ntp_options.py pytest: Migrate xunit-style setups to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_otp.py ipatests: test_otp: convert test_2fa_enable_single_prompt to run_ssh_cmd 2020-07-29 13:53:52 +02:00
test_pki_config_override.py Fix and extend pki config override test 2019-04-24 17:08:24 +02:00
test_pkinit_manage.py Ensure that KDC cert has SAN DNS entry 2021-01-29 13:36:41 -05:00
test_pwpolicy.py ipatests: add test for password policies 2020-10-23 09:32:52 -04:00
test_replica_promotion.py ipatests: ipactl status now exits with 3 when a service is stopped 2021-02-08 09:55:01 +01:00
test_replication_layouts.py Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
test_resolvers_manager.py ipatests: add utility for managing domain name resolvers 2021-03-04 18:47:32 +01:00
test_server_del.py ipatests/test_integration/test_server_del.py: Enable dns in fw for dnssec 2018-12-07 17:29:59 +01:00
test_service_permissions.py Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
test_simple_replication.py Check ca_wrapped in ipa-custodia-check 2020-10-05 14:24:55 +02:00
test_smb.py ipatests: test Samba mount with NTLM authentication 2021-03-01 12:55:58 +01:00
test_sssd.py ipatests: cleanup in test_subdomain_lookup_with_certmaprule_containing_dn 2020-07-06 15:33:53 +02:00
test_sudo.py ipatests: test addition of invalid sudo command 2021-02-15 09:59:41 +02:00
test_testconfig.py Test installation with (fake) userspace FIPS 2019-11-14 16:01:15 +01:00
test_topologies.py Fix comparison-with-callable 2018-11-13 13:37:58 +01:00
test_topology.py Removes several pylint warnings. 2019-09-27 09:38:32 +02:00
test_trust.py ipatests: skip tests for AD trust with shared secret in FIPS mode 2021-02-19 13:31:28 +01:00
test_uninstallation.py ipatests: Test if server setup without dns uninstall properly 2021-02-01 10:38:30 -05:00
test_upgrade.py ipatest: fix test_upgrade.py::TestUpgrade::()::test_kra_detection 2021-01-14 14:56:26 +01:00
test_user_permissions.py ipatests: test_user_permissions: test_selinux_user_optimized Paramiko=>OpenSSH 2020-07-29 13:53:52 +02:00
test_vault.py Fix E266 too many leading '#' for block comment 2020-05-05 10:42:46 +02:00
test_winsyncmigrate.py pylint: Synchronize pylint plugin to ipatests code 2020-02-12 18:08:32 +02:00