mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ipatests: fix the topologysegment-reinitialize command
There is no guarantee for the topologysegement name, it could be master-to-replica or replica-to-master. If it is master-to-replica then --right should be used with the command else --left. Fixes: https://pagure.io/freeipa/issue/9137 Signed-off-by: Mohammad Rizwan <myusuf@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
parent
f91e9d3fd4
commit
4514e8090a
@ -35,6 +35,7 @@ from ipatests.test_integration.base import IntegrationTest
|
||||
from ipatests.pytest_ipa.integration import tasks
|
||||
from ipatests.test_integration.test_dnssec import wait_until_record_is_signed
|
||||
from ipatests.test_integration.test_simple_replication import check_replication
|
||||
from ipatests.test_integration.test_topology import find_segment
|
||||
from ipatests.util import assert_deepequal
|
||||
from ldap.dn import escape_dn_chars
|
||||
|
||||
@ -862,13 +863,14 @@ class TestReplicaInstallAfterRestore(IntegrationTest):
|
||||
stdin_text=dirman_password + '\nyes')
|
||||
|
||||
# re-initialize topology after restore.
|
||||
topo_name = "{}-to-{}".format(master.hostname, replica1.hostname)
|
||||
for topo_suffix in 'domain', 'ca':
|
||||
arg = ['ipa',
|
||||
'topologysegment-reinitialize',
|
||||
topo_suffix,
|
||||
topo_name,
|
||||
'--left']
|
||||
topo_name = find_segment(master, replica1, topo_suffix)
|
||||
arg = ['ipa', 'topologysegment-reinitialize',
|
||||
topo_suffix, topo_name]
|
||||
if topo_name.split('-to-', maxsplit=1)[0] != master.hostname:
|
||||
arg.append('--left')
|
||||
else:
|
||||
arg.append('--right')
|
||||
replica1.run_command(arg)
|
||||
|
||||
# wait sometime for re-initialization
|
||||
|
Loading…
Reference in New Issue
Block a user