Hi guys,
Here are first two automated testcases from this (so far incomplete)
testplan: http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan
Testplan review is highly appreciated
--
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From 4f82f36f28bdb700331bb353b0d3862ec4d14a8e Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Mon, 9 Nov 2015 15:02:45 +0100
Subject: [PATCH] First part of replica promotion tests
---
ipatests/test_integration/tasks.py | 3 +-
.../test_integration/test_replica_promotion.py | 61 ++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 ipatests/test_integration/test_replica_promotion.py
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index ae26444f6d267c2ea2688cb2aaab5a2059688595..7bb4cbf286babffcb48c8e9e39691df636d89d4d 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -38,6 +38,7 @@ from ipatests.test_integration import util
from ipatests.test_integration.env_config import env_to_script
from ipatests.test_integration.host import Host
from ipalib.util import get_reverse_zone_default
+from ipalib.constants import MAX_DOMAIN_LEVEL
log = log_mgr.get_logger(__name__)
@@ -804,7 +805,7 @@ def tree2_topo(master, replicas):
master = replica
-def install_topo(topo, master, replicas, clients,
+def install_topo(topo, master, replicas, clients, domain_level=MAX_DOMAIN_LEVEL,
skip_master=False, setup_replica_cas=True):
"""Install IPA servers and clients in the given topology"""
replicas = list(replicas)
diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
new file mode 100644
index 0000000000000000000000000000000000000000..2b856b6d62aa914a2ec538303541980a9fc98f57
--- /dev/null
+++ b/ipatests/test_integration/test_replica_promotion.py
@@ -0,0 +1,61 @@
+from ipatests.test_integration.base import IntegrationTest
+from ipatests.test_integration import tasks
+from ipatests.test_integration.test_caless import assert_error
+
+
+class TestLevel0(IntegrationTest):
+ """
+ Testcase http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan#
+ Test_case:_Make_sure_the_feature_is_unavailable_under_domain_level_0
+ """
+
+ topology = 'line'
+ num_clients = 1
+ domain_level = 0
+ num_replicas = 0
+
+ @classmethod
+ def install(cls, mh):
+ tasks.install_topo(cls.topology, cls.master,
+ cls.replicas, cls.clients,
+ cls.domain_level)
+
+ def test_promotion_disabled(self):
+ client = self.clients[0]
+ args = ['ipa-replica-install', '-U',
+ '-p', self.master.config.dirman_password,
+ '-w', self.master.config.admin_password,
+ '--ip-address', client.ip]
+ result = client.run_command(args, raiseonerr=False)
+ assert_error(result,
+ 'You must provide a file generated by ipa-replica-prepare'
+ ' to create a replica when the domain is at level 0', 1)
+
+
+class TestLevel1(IntegrationTest):
+ """
+ TestCase: http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan#
+ Test_case:_Make_sure_the_old_workflow_is_disabled_at_domain_level_1
+ """
+
+ topology = 'line'
+ num_clients = 0
+ domain_level = 1
+ num_replicas = 1
+
+ @classmethod
+ def install(cls, mh):
+ tasks.install_topo(cls.topology, cls.master,
+ cls.replicas[:-1], cls.clients,
+ cls.domain_level)
+
+ def test_replica_prepare_disabled(self):
+ config = self.master.config
+ replica = self.replicas[0]
+ args = ['ipa-replica-prepare',
+ '-p', config.dirman_password,
+ '--ip-address', replica.ip,
+ replica.hostname]
+
+ result = self.master.run_command(args, raiseonerr=False)
+ assert_error(result, 'supported only in 0-level IPA domain', 1)
--
2.4.3
--
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