Fixing tests on TestReplicaManageDel

This commit fixes the tests on class TestReplicaManageDel:
- test_replica_managed_del_domlevel1
- test_clean_dangling_ruv_multi_ca
- test_replica_managed_del_domlevel0

Given that domain level 0 doest not have autodiscovery, we need to
configure /etc/resolv.conf with the master data (search <domain> and
nameserver <master_ip>) in order to ipa-replica-install succeed.

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Felipe Barreto 2018-04-18 14:54:09 -03:00
parent 8a8b641c72
commit 23c23a3cc1

View File

@ -340,10 +340,25 @@ def master_authoritative_for_client_domain(master, client):
raiseonerr=False)
return result.returncode == 0
def _config_replica_resolvconf_with_master_data(master, replica):
"""
Configure replica /etc/resolv.conf to use master as DNS server
"""
content = ('search {domain}\nnameserver {master_ip}'
.format(domain=master.domain.name, master_ip=master.ip))
replica.put_file_contents(paths.RESOLV_CONF, content)
def replica_prepare(master, replica, extra_args=(),
raiseonerr=True, stdin_text=None):
fix_apache_semaphores(replica)
prepare_reverse_zone(master, replica.ip)
# in domain level 0 there is no autodiscovery, so it's necessary to
# change /etc/resolv.conf to find master DNS server
_config_replica_resolvconf_with_master_data(master, replica)
args = ['ipa-replica-prepare',
'-p', replica.config.dirman_password,
replica.hostname]