diff options
author | Oleg Fayans <ofayans@redhat.com> | 2016-02-01 11:34:11 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-02-01 16:05:38 +0100 |
commit | aa30199e0b6002aeb8c01e2561a3d55fe3f1ceb5 (patch) | |
tree | ddeb2d760ee3fda127f71982f56f580bee57fc19 /ipatests/test_integration | |
parent | 23f5edb4be08b359c6acd8a18a5e23c3dd784136 (diff) | |
download | freeipa-aa30199e0b6002aeb8c01e2561a3d55fe3f1ceb5.tar.gz freeipa-aa30199e0b6002aeb8c01e2561a3d55fe3f1ceb5.tar.xz freeipa-aa30199e0b6002aeb8c01e2561a3d55fe3f1ceb5.zip |
Updated connect/disconnect replica to work with both domainlevels
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests/test_integration')
-rw-r--r-- | ipatests/test_integration/tasks.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index 27d2449ec..318c8c880 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -604,14 +604,31 @@ def sync_time(host, server): host.run_command(['ntpdate', server.hostname]) -def connect_replica(master, replica): - kinit_admin(replica) - replica.run_command(['ipa-replica-manage', 'connect', master.hostname]) +def connect_replica(master, replica, domain_level=None): + if domain_level is None: + domain_level = master.config.domain_level + if domain_level == DOMAIN_LEVEL_0: + replica.run_command(['ipa-replica-manage', 'connect', master.hostname]) + else: + kinit_admin(master) + master.run_command(["ipa", "topologysegment-add", DOMAIN_SUFFIX_NAME, + "%s-to-%s" % (master.hostname, replica.hostname), + "--leftnode=%s" % master.hostname, + "--rightnode=%s" % replica.hostname + ]) -def disconnect_replica(master, replica): - kinit_admin(replica) - replica.run_command(['ipa-replica-manage', 'disconnect', master.hostname]) +def disconnect_replica(master, replica, domain_level=None): + if domain_level is None: + domain_level = master.config.domain_level + if domain_level == DOMAIN_LEVEL_0: + replica.run_command(['ipa-replica-manage', 'disconnect', master.hostname]) + else: + kinit_admin(master) + master.run_command(["ipa", "topologysegment-del", DOMAIN_SUFFIX_NAME, + "%s-to-%s" % (master.hostname, replica.hostname), + "--continue" + ]) def kinit_admin(host): |