Re: [Freeipa-devel] [Test][patch-0042] Automated 2 testcases from Managed Topology testplan

2016-06-03 Thread Martin Babinsky

On 06/03/2016 02:09 PM, Oleg Fayans wrote:

The patch applies and passes pylint




Hi Oleg,

You don't need to implement server-del tests as I have an extensive CI 
test suite for that already, see 
https://www.redhat.com/archives/freeipa-devel/2016-April/msg00101.html.


--
Martin^3 Babinsky

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


[Freeipa-devel] [Test][patch-0042] Automated 2 testcases from Managed Topology testplan

2016-06-03 Thread Oleg Fayans
The patch applies and passes pylint

-- 
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From 39fd39118a6d6e84a4c8791c17ad54da5cbffd0d Mon Sep 17 00:00:00 2001
From: Oleg Fayans 
Date: Fri, 3 Jun 2016 13:22:48 +0200
Subject: [PATCH] Automated 2 managed topology 4.4 testcases

---
 ipatests/test_integration/test_topology.py | 53 ++
 1 file changed, 53 insertions(+)

diff --git a/ipatests/test_integration/test_topology.py b/ipatests/test_integration/test_topology.py
index e956563c27eafd84deed5786274a73d0d3594642..9deeb4c552cc147ef536bb515ac2e731e44b8b10 100644
--- a/ipatests/test_integration/test_topology.py
+++ b/ipatests/test_integration/test_topology.py
@@ -159,3 +159,56 @@ class TestTopologyOptions(IntegrationTest):
 assert err == "", err
 returncode, error = tasks.destroy_segment(self.master, "%s-to-%s" % replicas)
 assert returncode == 0, error
+
+
+class TestServerDel(IntegrationTest):
+num_replicas = 1
+topology = 'star'
+
+def test_server_del_command(self):
+"""
+http://www.freeipa.org/page/V4/Manage_replication_topology_4_4/
+Test_Plan#Test_case:_ipa_server-del_command
+"""
+self.master.run_command(['ipa', 'server-del',
+ self.replicas[0].hostname])
+result1 = self.master.run_command(['ipa', 'host-find'])
+assert(self.replicas[0].hostname in result1.stdout_text), (
+"Server-del has deleted replica's host record from the master")
+result2 = self.master.run_command(['ipa', 'dnsrecord-find',
+   self.master.domain.name])
+assert(self.replicas[0].hostname in result2.stdout_text), (
+"Server-del has removed replica's A record from master dns")
+result3 = self.master.run_command(['ipa-replica-manage', 'list-ruv'])
+assert(self.replicas[0].hostname not in result3.stdout_text), (
+"Server-del did not clean out replica's RUVs")
+
+
+class TestRemoteServerDelCall(IntegrationTest):
+num_replicas = 2
+domain_level = 0
+topology = 'star'
+
+def test_remote_server_del_execution(self):
+"""
+http://www.freeipa.org/page/V4/Manage_replication_topology_4_4/
+Test_Plan#Test_case:_server_del_API_call_is_executed_at_
+ipa-server-install_--uninstall_on_the_replica_under_domain_level_1
+"""
+tasks.uninstall_master(self.replicas[0])
+result1 = self.master.run_command(['ipa-replica-manage', 'list-ruv'])
+assert(self.replicas[0].hostname in result1.stdout_text), (
+"Remote execution of server-del was performed under domain ldvel 0")
+self.master.run_command(['ipa', 'domainlevel-set', '1'])
+tasks.uninstall_master(self.replicas[1])
+result2 = self.master.run_command(['ipa', 'host-find'])
+assert(self.replicas[1].hostname in result2.stdout_text), (
+"Server-del has deleted replica's host record from the master")
+result3 = self.master.run_command(['ipa', 'dnsrecord-find',
+   self.master.domain.name])
+assert(self.replicas[1].hostname in result3.stdout_text), (
+"Server-del has removed replica's A record from master dns")
+result4 = self.master.run_command(['ipa-replica-manage', 'list-ruv'])
+assert(self.replicas[1].hostname not in result4.stdout_text), (
+"Replica uninstallation did not cause deleting of corresponding"
+" RUVs from master")
-- 
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