URL: https://github.com/freeipa/freeipa/pull/902
Author: felipevolpone
 Title: #902: Improving replica promotion tests
Action: opened

PR body:
"""
Adding two new test cases in replica promotion scenario:

* Testing not interactive mode: Install client; kinit as admin;
  then ipa-replica-install (without prompting a password)

* Testing interactive mode: only the admin password should be prompted

https://pagure.io/freeipa/issue/6554
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/902/head:pr902
git checkout pr902
From 6695015bcc40fe18d80b453f3928e05fb100f865 Mon Sep 17 00:00:00 2001
From: Felipe Volpone <felipevolp...@gmail.com>
Date: Mon, 3 Jul 2017 19:27:22 -0300
Subject: [PATCH] Improving replica promotion tests

Adding two new test cases:
* Testing not interactive mode: Install client; kinit as admin;
  then ipa-replica-install (without prompting a password)

* Test interactive mode: only the admin password should be prompted

https://pagure.io/freeipa/issue/6554
---
 .../test_integration/test_replica_promotion.py     | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
index bc52566f15..f2da3396e0 100644
--- a/ipatests/test_integration/test_replica_promotion.py
+++ b/ipatests/test_integration/test_replica_promotion.py
@@ -196,6 +196,40 @@ def test_one_command_installation(self):
                                      '-U'])
 
 
+class TestReplicaPromotionLevel1Interactively(ReplicaPromotionBase):
+
+    topology = 'star'
+    num_replicas = 1
+    domain_level = DOMAIN_LEVEL_1
+
+    @replicas_cleanup
+    def test_replica_install_inserting_only_password(self):
+        replica = self.replicas[0]
+        tasks.install_client(self.master, replica)
+        tasks.kinit_admin(self.master)
+        self.replicas[0].run_command(['ipa-replica-install'],
+                                     stdin_text=self.master.config.admin_password)
+
+
+class TestReplicaPromotionLevel1NotInteractive(ReplicaPromotionBase):
+
+    topology = 'star'
+    num_replicas = 1
+    domain_level = DOMAIN_LEVEL_1
+
+    @replicas_cleanup
+    def test_replica_install_not_interactive_mode(self):
+        replica = self.replicas[0]
+        tasks.install_client(self.master, replica)
+        tasks.kinit_admin(self.master)
+        self.replicas[0].run_command(['ipa-replica-install', '-w',
+                                      self.master.config.admin_password,
+                                      '-n', self.master.domain.name,
+                                      '-r', self.master.domain.realm,
+                                      '--server', self.master.hostname,
+                                      '-U'])
+
+
 @pytest.mark.xfail(reason="Ticket N 6274")
 class TestReplicaManageCommands(IntegrationTest):
     topology = "star"
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to