The patches were rebased against the current master

On 03/04/2016 05:33 PM, Martin Basti wrote:
> * old messages have been removed *
>>>>> 1)
>>>>> this method is unused please remove it
>>>>>
>>>>>      def test_kra_install_master(self):
>> Well, in fact it is used twice: in both domain levels, so I'd better
>> keep it:
>>
>> -bash-4.3$ ipa-run-tests test_integration/test_replica_promotion.py
>> --collect-only
>> ====================================================================================
>>
>> test session starts
>> =====================================================================================
>>
>> platform linux2 -- Python 2.7.10 -- py-1.4.30 -- pytest-2.7.3
>> rootdir: /usr/lib/python2.7/site-packages/ipatests, inifile: pytest.ini
>> plugins: sourceorder, multihost
>> collected 8 items
>> <Module 'test_integration/test_replica_promotion.py'>
>>    <Class 'TestReplicaPromotionLevel0'>
>>      <Instance '()'>
>>        <Function 'test_kra_install_master'>
>>        <Function 'test_promotion_disabled'>
>>        <Function 'test_backup_restore'>
>>    <Class 'TestKRAInstall'>
>>      <Instance '()'>
>>        <Function 'test_kra_install_without_replica_file'>
>>    <Class 'TestCAInstall'>
>>      <Instance '()'>
>>        <Function 'test_ca_install_without_replica_file'>
>>    <Class 'TestReplicaPromotionLevel1'>
>>      <Instance '()'>
>>        <Function 'test_kra_install_master'>
>>        <Function 'test_replica_prepare_disabled'>
>>    <Class 'TestReplicaManageCommands'>
>>      <Instance '()'>
>>        <Function 'test_replica_manage_commands'>
> aah my bad, I forgot that pytest executes it when it begins with test_*
> even in parent class
>>
>>>>> 2)
>>>>> Why are these there? I do not see any usage
>>>>>
>>>>> from env_config import get_global_config
>>>>> config = get_global_config()
>> Removed
>>
>>>>> 3) nitpick
>>>>> +    num_clients = 0
>>>>> this is set by default
>> Removed
>>
>>>>> otherwise LGTM
>>>>>
>>>>> Results of testing tomorrow.
>>>>>
>>>>> Martin^2
>>>>>
>>>> I applied all patches including workarounds, but test failed.
>>>>
>>>> ipatests.test_integration.test_replica_promotion.TestReplicaPromotionLevel0
>>>>
>>>>
>>>>
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51] RUN
>>>> ['ipa-replica-install', '-U', '-p', 'Secret123', '-w', 'Secret123',
>>>> '--setup-ca', '--ip-address', '192.168.144.102',
>>>> '/root/ipatests/replica-info.gpg']
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51] The host
>>>> replica1.ipa.test already exists on the master server.
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51] You should
>>>> remove it before proceeding:
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51]     % ipa
>>>> host-del replica1.ipa.test
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51]
>>>> ipa.ipapython.install.cli.install_tool(Replica): ERROR    The
>>>> ipa-replica-install command failed. See
>>>> /var/log/ipareplica-install.log for more information
>>>> [ipa.ipatests.test_integration.host.Host.replica1.cmd51] Exit code: 3
>>>> FAILED
>> this is exactly the error that happens when a workaround for 5627 is not
>> applied. I have re-run the tests with all the patches and everything
>> passed. Could you please double-check, whether patch 0027 was applied
>> correctly?
>>
>> bash-4.3$ ipa-run-tests test_integration/test_replica_promotion.py --pdb
>> ====================================================================================
>>
>> test session starts
>> =====================================================================================
>>
>> platform linux2 -- Python 2.7.10 -- py-1.4.30 -- pytest-2.7.3
>> rootdir: /usr/lib/python2.7/site-packages/ipatests, inifile: pytest.ini
>> plugins: sourceorder, multihost
>> collected 8 items
>>
>> test_integration/test_replica_promotion.py ........
>>
>> ================================================================================
>>
>> 8 passed in 7561.93 seconds
>> =================================================================================
>>
>>
> I will
> 
>>> And it needs ticket, otherwise it will not be in 4-3 branch.
>> https://fedorahosted.org/freeipa/ticket/5723
> 

-- 
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From 0e203fcabfc41bed8be0f5dc2d14f8284b7a8591 Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Tue, 8 Mar 2016 12:29:35 +0100
Subject: [PATCH] Enabled setting domain level explicitly in test class

Needed for replica promotion tests
---
 ipatests/test_integration/base.py  |  8 +++++++-
 ipatests/test_integration/tasks.py | 17 +++++++++++------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py
index 4f57e959032a5fda0ad002fca95501da1160605b..ee271679912fa6218dcd91de61570f9d8fc09d06 100644
--- a/ipatests/test_integration/base.py
+++ b/ipatests/test_integration/base.py
@@ -37,6 +37,7 @@ class IntegrationTest(object):
     num_ad_domains = 0
     required_extra_roles = []
     topology = None
+    domain_level = None
 
     @classmethod
     def setup_class(cls):
@@ -62,11 +63,16 @@ class IntegrationTest(object):
 
     @classmethod
     def install(cls, mh):
+        if cls.domain_level is not None:
+            domain_level = cls.domain_level
+        else:
+            domain_level = cls.master.config.domain_level
         if cls.topology is None:
             return
         else:
             tasks.install_topo(cls.topology,
-                               cls.master, cls.replicas, cls.clients)
+                               cls.master, cls.replicas,
+                               cls.clients, domain_level)
     @classmethod
     def teardown_class(cls):
         pass
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index cb9620133263eb4ed67cbb982080327898cadcef..8c3c01cfb8fc8e9f34f7cb9f83595bcc4ffb39ea 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -224,7 +224,10 @@ def enable_replication_debugging(host):
                      stdin_text=logging_ldif)
 
 
-def install_master(host, setup_dns=True, setup_kra=False, extra_args=()):
+def install_master(host, setup_dns=True, setup_kra=False, extra_args=(),
+                   domain_level=None):
+    if domain_level is None:
+        domain_level = host.config.domain_level
     host.collect_log(paths.IPASERVER_INSTALL_LOG)
     host.collect_log(paths.IPACLIENT_INSTALL_LOG)
     inst = host.domain.realm.replace('.', '-')
@@ -240,7 +243,7 @@ def install_master(host, setup_dns=True, setup_kra=False, extra_args=()):
         '-r', host.domain.realm,
         '-p', host.config.dirman_password,
         '-a', host.config.admin_password,
-        "--domain-level=%i" % host.config.domain_level
+        "--domain-level=%i" % domain_level,
     ]
 
     if setup_dns:
@@ -309,7 +312,9 @@ def replica_prepare(master, replica):
 
 
 def install_replica(master, replica, setup_ca=True, setup_dns=False,
-                    setup_kra=False, extra_args=()):
+                    setup_kra=False, extra_args=(), domain_level=None):
+    if domain_level is None:
+        domain_level = domainlevel(master)
     replica.collect_log(paths.IPAREPLICA_INSTALL_LOG)
     replica.collect_log(paths.IPAREPLICA_CONNCHECK_LOG)
     allow_sync_ptr(master)
@@ -330,7 +335,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
 
     args.extend(extra_args)
 
-    if domainlevel(master) == DOMAIN_LEVEL_0:
+    if domainlevel == DOMAIN_LEVEL_0:
         # prepare the replica file on master and put it to replica, AKA "old way"
         replica_prepare(master, replica)
         replica_filename = get_replica_filename(replica)
@@ -976,13 +981,13 @@ def double_circle_topo(master, replicas, site_size=6):
             yield site[1], site_servers[-1]
 
 
-def install_topo(topo, master, replicas, clients,
+def install_topo(topo, master, replicas, clients, domain_level=None,
                  skip_master=False, setup_replica_cas=True):
     """Install IPA servers and clients in the given topology"""
     replicas = list(replicas)
     installed = {master}
     if not skip_master:
-        install_master(master)
+        install_master(master, domain_level=domain_level)
 
     add_a_records_for_hosts_in_master_domain(master)
 
-- 
2.5.0

From 49013ab0f5a04793eea8c7f7d1d3fb8aa075902f Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Tue, 8 Mar 2016 12:08:08 +0100
Subject: [PATCH] Made apply_common_fixes call at replica installation 
 independent on domain_level

 Besides added obligatory domain/realm-specific commandline options
 to replica installation
---
 ipatests/test_integration/tasks.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 2a3370c08ecd4d087ab12008b575256fd531302c..0148c63aa776b7ae066c2094741f073f1a9faa61 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -295,7 +295,6 @@ def master_authoritative_for_client_domain(master, client):
 
 
 def replica_prepare(master, replica):
-    apply_common_fixes(replica)
     fix_apache_semaphores(replica)
     prepare_reverse_zone(master, replica.ip)
     args = ['ipa-replica-prepare',
@@ -314,6 +313,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
                     setup_kra=False, extra_args=(), domain_level=None):
     if domain_level is None:
         domain_level = domainlevel(master)
+    apply_common_fixes(replica)
     replica.collect_log(paths.IPAREPLICA_INSTALL_LOG)
     replica.collect_log(paths.IPAREPLICA_CONNCHECK_LOG)
     allow_sync_ptr(master)
@@ -343,7 +343,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
         # install client on a replica machine and then promote it to replica
         install_client(master, replica)
         fix_apache_semaphores(replica)
-
+        args.extend(['-r', replica.domain.realm])
     replica.run_command(args)
     enable_replication_debugging(replica)
     setup_sssd_debugging(replica)
-- 
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

Reply via email to