https://fedorahosted.org/freeipa/ticket/5606
Patch attached.
From 1fe93ac24694dc490ddc497b1cbd493cd38e8117 Mon Sep 17 00:00:00 2001 From: Martin Basti <mba...@redhat.com> Date: Wed, 24 Feb 2016 17:45:55 +0100 Subject: [PATCH] CI: allow customized DS install test to work with domain levels Test will use tasks methods instead of custom commands to be able work with domain levels. https://fedorahosted.org/freeipa/ticket/5606 --- ipatests/test_integration/tasks.py | 9 +++++++-- .../test_customized_ds_config_install.py | 23 ++++++---------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index 60e9e82391077ce6b997d0ed4ad4f2ff19f43d1e..672b09e4aa98bcf2cdd0c8574aaa538f33100c2f 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -262,7 +262,7 @@ def enable_replication_debugging(host): stdin_text=logging_ldif) -def install_master(host, setup_dns=True, setup_kra=False): +def install_master(host, setup_dns=True, setup_kra=False, extra_args=()): host.collect_log(paths.IPASERVER_INSTALL_LOG) host.collect_log(paths.IPACLIENT_INSTALL_LOG) inst = host.domain.realm.replace('.', '-') @@ -288,6 +288,8 @@ def install_master(host, setup_dns=True, setup_kra=False): '--auto-reverse' ]) + args.extend(extra_args) + host.run_command(args) enable_replication_debugging(host) setup_sssd_debugging(host) @@ -345,7 +347,7 @@ def replica_prepare(master, replica): def install_replica(master, replica, setup_ca=True, setup_dns=False, - setup_kra=False): + setup_kra=False, extra_args=()): replica.collect_log(paths.IPAREPLICA_INSTALL_LOG) replica.collect_log(paths.IPAREPLICA_CONNCHECK_LOG) allow_sync_ptr(master) @@ -363,6 +365,9 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False, ]) if master_authoritative_for_client_domain(master, replica): args.extend(['--ip-address', replica.ip]) + + args.extend(extra_args) + if domainlevel(master) == DOMAIN_LEVEL_0: # prepare the replica file on master and put it to replica, AKA "old way" replica_prepare(master, replica) diff --git a/ipatests/test_integration/test_customized_ds_config_install.py b/ipatests/test_integration/test_customized_ds_config_install.py index 0d8c836d9c511965d4158044a4bcecfdd7774800..b0ee8f73e1bf7ae0d859280642c01bbea93f87d5 100644 --- a/ipatests/test_integration/test_customized_ds_config_install.py +++ b/ipatests/test_integration/test_customized_ds_config_install.py @@ -59,14 +59,9 @@ class TestCustomInstallMaster(IntegrationTest): cls.master.put_file_contents(CONFIG_LDIF_PATH, DIRSRV_CONFIG_MODS) def test_customized_ds_install_master(self): - args = [ - 'ipa-server-install', '-U', - '-r', self.master.domain.name, - '-p', self.master.config.dirman_password, - '-a', self.master.config.admin_password, - '--dirsrv-config-file', CONFIG_LDIF_PATH, - ] - self.master.run_command(args) + tasks.install_master(self.master, setup_dns=False, extra_args=[ + '--dirsrv-config-file', CONFIG_LDIF_PATH + ]) class TestCustomInstallReplica(IntegrationTest): @@ -83,12 +78,6 @@ class TestCustomInstallReplica(IntegrationTest): tasks.install_master(cls.master) def test_customized_ds_install_replica(self): - tasks.replica_prepare(self.master, self.replicas[0]) - replica_filename = tasks.get_replica_filename(self.replicas[0]) - args = ['ipa-replica-install', '-U', - '-p', self.replicas[0].config.dirman_password, - '-w', self.replicas[0].config.admin_password, - '--ip-address', self.replicas[0].ip, - '--dirsrv-config-file', CONFIG_LDIF_PATH, - replica_filename] - self.replicas[0].run_command(args) + tasks.install_replica( + self.master, self.replicas[0], setup_ca=False, + extra_args=['--dirsrv-config-file', CONFIG_LDIF_PATH]) -- 2.5.0
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code