from ipatests.pytest_ipa.integration import tasks from ipatests.pytest_ipa.integration.tasks import ( assert_error, replicas_cleanup) from ipatests.pytest_ipa.integration.firewall import Firewall from ipatests.pytest_ipa.integration.env_config import get_global_config from ipalib.constants import ( DOMAIN_LEVEL_1, IPA_CA_NICKNAME, CA_SUFFIX_NAME) from ipaplatform.paths import paths from ipapython import certdb from ipatests.test_integration.test_dns_locations import ( resolve_records_from_server, IPA_DEFAULT_MASTER_SRV_REC ) from ipapython.dnsutil import DNSName from ipalib.constants import IPA_CA_RECORD config = get_global_config() class ReplicaPromotionBase(IntegrationTest): @classmethod def install(cls, mh): tasks.install_master(cls.master, domain_level=cls.domain_level) def test_kra_install_master(self): result1 = tasks.install_kra(self.master, first_instance=True, raiseonerr=False) assert result1.returncode == 0, result1.stderr_text tasks.kinit_admin(self.master) result2 = self.master.run_command(["ipa", "vault-find"],
import time from cryptography.hazmat.primitives import hashes import pytest from ipalib.constants import DOMAIN_LEVEL_0 from ipaplatform.constants import constants from ipaplatform.paths import paths from ipaplatform.tasks import tasks as platformtasks from ipatests.pytest_ipa.integration.env_config import get_global_config from ipatests.test_integration.base import IntegrationTest from ipatests.pytest_ipa.integration import tasks from ipatests.test_integration.test_caless import CALessBase, ipa_certs_cleanup from ipalib import x509 config = get_global_config() def create_broken_resolv_conf(master): # Force a broken resolv.conf to simulate a bad response to # reverse zone lookups master.run_command([ '/bin/mv', paths.RESOLV_CONF, '%s.sav' % paths.RESOLV_CONF ]) contents = "# Set as broken by ipatests\nnameserver 127.0.0.2\n" master.put_file_contents(paths.RESOLV_CONF, contents)