|
|
86baa9 |
From 9c62af973d71cabaf8d93216717468385ac2abbe Mon Sep 17 00:00:00 2001
|
|
|
86baa9 |
From: Christian Heimes <cheimes@redhat.com>
|
|
|
86baa9 |
Date: Mon, 25 Mar 2019 18:36:19 +0100
|
|
|
86baa9 |
Subject: [PATCH] More test fixes
|
|
|
86baa9 |
|
|
|
86baa9 |
Fixes: https://pagure.io/freeipa/issue/7892
|
|
|
86baa9 |
Signed-off-by: Christian Heimes <cheimes@redhat.com>
|
|
|
86baa9 |
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
|
|
|
86baa9 |
Reviewed-By: Francois Cami <fcami@redhat.com>
|
|
|
86baa9 |
---
|
|
|
86baa9 |
.../test_integration/test_replica_promotion.py | 18 +++++++++++++-----
|
|
|
86baa9 |
1 file changed, 13 insertions(+), 5 deletions(-)
|
|
|
86baa9 |
|
|
|
86baa9 |
diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
|
|
|
86baa9 |
index 3be2ea95fa2325edfc74cbb902ce0a5966aa82d7..9ce0074ea0df276b4800b306530d04c8274ece69 100644
|
|
|
86baa9 |
--- a/ipatests/test_integration/test_replica_promotion.py
|
|
|
86baa9 |
+++ b/ipatests/test_integration/test_replica_promotion.py
|
|
|
86baa9 |
@@ -843,7 +843,7 @@ class TestHiddenReplicaPromotion(IntegrationTest):
|
|
|
86baa9 |
def _check_server_role(self, host, status):
|
|
|
86baa9 |
roles = [u'IPA master', u'CA server', u'KRA server', u'DNS server']
|
|
|
86baa9 |
for role in roles:
|
|
|
86baa9 |
- result = self.master.run_command([
|
|
|
86baa9 |
+ result = self.replicas[0].run_command([
|
|
|
86baa9 |
'ipa', 'server-role-find',
|
|
|
86baa9 |
'--server', host.hostname,
|
|
|
86baa9 |
'--role', role
|
|
|
86baa9 |
@@ -859,7 +859,7 @@ class TestHiddenReplicaPromotion(IntegrationTest):
|
|
|
86baa9 |
'IPA DNS servers'
|
|
|
86baa9 |
]
|
|
|
86baa9 |
|
|
|
86baa9 |
- result = self.master.run_command(['ipa', 'config-show'])
|
|
|
86baa9 |
+ result = self.replicas[0].run_command(['ipa', 'config-show'])
|
|
|
86baa9 |
values = {}
|
|
|
86baa9 |
for line in result.stdout_text.split('\n'):
|
|
|
86baa9 |
if ':' not in line:
|
|
|
86baa9 |
@@ -868,8 +868,9 @@ class TestHiddenReplicaPromotion(IntegrationTest):
|
|
|
86baa9 |
values[k.strip()] = {item.strip() for item in v.split(',')}
|
|
|
86baa9 |
|
|
|
86baa9 |
for service in services:
|
|
|
86baa9 |
- assert values[service] == enabled
|
|
|
86baa9 |
- assert values['Hidden {}'.format(service)] == hidden
|
|
|
86baa9 |
+ hservice = 'Hidden {}'.format(service)
|
|
|
86baa9 |
+ assert values.get(service, set()) == enabled
|
|
|
86baa9 |
+ assert values.get(hservice, set()) == hidden
|
|
|
86baa9 |
|
|
|
86baa9 |
def test_hidden_replica_install(self):
|
|
|
86baa9 |
# TODO: check that all services are running on hidden replica
|
|
|
86baa9 |
@@ -909,19 +910,26 @@ class TestHiddenReplicaPromotion(IntegrationTest):
|
|
|
86baa9 |
# backup
|
|
|
86baa9 |
backup_path = backup(self.replicas[0])
|
|
|
86baa9 |
# uninstall
|
|
|
86baa9 |
- tasks.uninstall_replica(self.master, self.replicas[0])
|
|
|
86baa9 |
+ tasks.uninstall_master(self.replicas[0])
|
|
|
86baa9 |
# restore
|
|
|
86baa9 |
dirman_password = self.master.config.dirman_password
|
|
|
86baa9 |
self.replicas[0].run_command(
|
|
|
86baa9 |
['ipa-restore', backup_path],
|
|
|
86baa9 |
stdin_text=dirman_password + '\nyes'
|
|
|
86baa9 |
)
|
|
|
86baa9 |
+ # give replication some time
|
|
|
86baa9 |
+ time.sleep(5)
|
|
|
86baa9 |
+
|
|
|
86baa9 |
# check that role is still hidden
|
|
|
86baa9 |
+ tasks.kinit_admin(self.replicas[0])
|
|
|
86baa9 |
+ self._check_config([self.master], [self.replicas[0]])
|
|
|
86baa9 |
self._check_server_role(self.replicas[0], 'hidden')
|
|
|
86baa9 |
self._check_dnsrecords([self.master], [self.replicas[0]])
|
|
|
86baa9 |
+
|
|
|
86baa9 |
# check that the resulting server can be promoted to enabled
|
|
|
86baa9 |
self.replicas[0].run_command([
|
|
|
86baa9 |
'ipa', 'server-mod', self.replicas[0].hostname, '--state=enabled'
|
|
|
86baa9 |
])
|
|
|
86baa9 |
+ self._check_config([self.master, self.replicas[0]])
|
|
|
86baa9 |
self._check_server_role(self.replicas[0], 'enabled')
|
|
|
86baa9 |
self._check_dnsrecords([self.master, self.replicas[0]])
|
|
|
86baa9 |
--
|
|
|
86baa9 |
2.20.1
|
|
|
86baa9 |
|