Hi Martin,

I've updated the patch with regard to your review. Thank you!

On 04/12/2016 03:35 PM, Martin Babinsky wrote:
> On 04/07/2016 12:35 PM, Oleg Fayans wrote:
>>
>>
>>
> Hi Oleg,
> 
> since this is a part of replica promotion test suite please add the link
> to https://fedorahosted.org/freeipa/ticket/5723 to the commit message.

Done

> 
> The patch cannot be applied cleanly, even 3-way merge fails with:
> 
> """
> git am
> ../review/ofayans/freeipa-ofayans-0035-Add-test-if-replica-is-working-after-domain-upgrade.patch
> -3
> Applying: Add test if replica is working after domain upgrade
> error: invalid object 100644 acae5c924594cc73bf262eeab5f843f252723207
> for 'ipatests/test_integration/test_replica_promotion.py'
> fatal: git-write-tree: error building trees
> Repository lacks necessary blobs to fall back on 3-way merge.
> Cannot fall back to three-way merge.
> Patch failed at 0001 Add test if replica is working after domain upgrade
> """
> 
> I had to fall back to plain 'patch -p1'
> 
> I have your previous patches 0033-0034 applied. The patch probably needs
> a rebase.

Fixed

> 
> Also I would be more happy if the username for 'testuser' was not
> hardcoded in the code. You can factor it out as a class member.
> 

Done

-- 
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From a0a0fd1ca1a06704e5e692f53385f4430e453160 Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Wed, 13 Apr 2016 10:02:32 +0200
Subject: [PATCH] Add test if replica is working after domain upgrade

Corresponds to the testcase described in
http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan#Test_case:
_Replica_created_using_old_workflow_is_functional_after_domain_upgrade

https://fedorahosted.org/freeipa/ticket/5723
---
 .../test_integration/test_replica_promotion.py     | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
index 85beaec4530848b6005712a1ae1dead5f5d69cd4..1f683b6d5c067ec526b307eea1460cafbadb80cb 100644
--- a/ipatests/test_integration/test_replica_promotion.py
+++ b/ipatests/test_integration/test_replica_promotion.py
@@ -351,3 +351,29 @@ class TestProhibitReplicaUninstallation(IntegrationTest):
                in result.stdout_text), ("Expected error message was not found")
         self.replicas[0].run_command(['ipa-server-install', '--uninstall',
                                       '-U', '--ignore-topology-disconnect'])
+
+
+class TestOldReplicaWorksAfterDomainUpgrade(IntegrationTest):
+    topology = 'star'
+    num_replicas = 1
+    domain_level = DOMAIN_LEVEL_0
+    username = 'testuser'
+
+    def test_replica_after_domain_upgrade(self):
+        tasks.kinit_admin(self.master)
+        tasks.kinit_admin(self.replicas[0])
+        self.master.run_command(['ipa', 'user-add', self.username,
+                                 '--first', 'test',
+                                 '--last', 'user'])
+        tasks.wait_for_replication(self.replicas[0].ldap_connect())
+        self.master.run_command(['ipa', 'domainlevel-set',
+                                 str(DOMAIN_LEVEL_1)])
+        result = self.replicas[0].run_command(['ipa', 'user-show',
+                                               self.username])
+        assert("User login: %s" % self.username in result.stdout_text), (
+                "A testuser was not found on replica after domain upgrade")
+        self.replicas[0].run_command(['ipa', 'user-del', self.username])
+        tasks.wait_for_replication(self.master.ldap_connect())
+        result1 = self.master.run_command(['ipa', 'user-show', self.username],
+                                          raiseonerr=False)
+        assert_error(result1, "%s: user not found" % self.username, 2)
-- 
1.8.3.1

-- 
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