From c8205fb7688f165731491f59bef3ca9fe765fd95 Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Tue, 30 Aug 2016 11:47:28 +0200 Subject: [PATCH 1/3] Removed incorrect check for returncode The server installation in most cases returns response code 0 no matter what happens except for really severe errors. In this case when we try to uninstall the middle replica of a line topology, it fails, notifies us that we should use '--ignore-topology-disconnect', but returns 0 https://fedorahosted.org/freeipa/ticket/3230 --- ipatests/test_integration/test_replica_promotion.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 3e62f92..fdc2c58 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -348,10 +348,7 @@ def test_replica_uninstallation_prohibited(self): result = self.replicas[0].run_command(['ipa-server-install', '--uninstall', '-U'], raiseonerr=False) - assert(result.returncode > 0), ("The replica was removed without " - "'--ignore-topology-disconnect' option") - assert("Uninstallation leads to disconnected topology" - in result.stdout_text), ("Expected error message was not found") + assert_error(result, "Uninstallation leads to disconnected topology", 0) self.replicas[0].run_command(['ipa-server-install', '--uninstall', '-U', '--ignore-topology-disconnect']) From e4ecee6da64ced91449e47f86eb1e9abc52f142c Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Tue, 30 Aug 2016 11:53:15 +0200 Subject: [PATCH 2/3] Several fixes in replica_promotion tests Some replica installation calls lacked '--server' and '-U' options which resulted in unexpected failures --- ipatests/test_integration/test_replica_promotion.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index fdc2c58..234052b 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -187,7 +187,9 @@ def test_one_command_installation(self): self.replicas[0].run_command(['ipa-replica-install', '-w', self.master.config.admin_password, '-n', self.master.domain.name, - '-r', self.master.domain.realm]) + '-r', self.master.domain.realm, + '--server', self.master.hostname, + '-U']) class TestReplicaManageCommands(IntegrationTest): @@ -308,6 +310,7 @@ def test_client_enrollment_by_unprivileged_user(self): '-w', self.new_password, '--domain', replica.domain.name, '--realm', replica.domain.realm, '-U'], + '--server', self.master.hostname], raiseonerr=False) assert_error(result1, "No permission to join this host", 1) @@ -332,6 +335,7 @@ def test_replica_promotion_after_adding_to_admin_group(self): '-p', self.new_password, '-n', self.master.domain.name, '-r', self.master.domain.realm]) + '-U']) class TestProhibitReplicaUninstallation(IntegrationTest): From 1f04fcc775f61f1a45bbb53c4e13fb63def3427a Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Tue, 30 Aug 2016 13:13:05 +0200 Subject: [PATCH 3/3] Xfailed the tests due to a known bug with replica preparation https://fedorahosted.org/freeipa/ticket/6274 --- ipatests/test_integration/test_replica_promotion.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 234052b..47238d9 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -114,6 +114,7 @@ def test_kra_install_without_replica_file(self): tasks.install_kra(replica2) +@pytest.mark.xfail(reason="Ticket N 6274", strict=True) class TestCAInstall(IntegrationTest): topology = 'star' domain_level = DOMAIN_LEVEL_0 @@ -192,6 +193,7 @@ def test_one_command_installation(self): '-U']) +@pytest.mark.xfail(reason="Ticket N 6274", strict=True) class TestReplicaManageCommands(IntegrationTest): topology = "star" num_replicas = 2 @@ -357,6 +359,7 @@ def test_replica_uninstallation_prohibited(self): '-U', '--ignore-topology-disconnect']) +@pytest.mark.xfail(reason="Ticket N 6274", strict=True) class TestOldReplicaWorksAfterDomainUpgrade(IntegrationTest): topology = 'star' num_replicas = 1