ipatests/test_integration/test_replica_promotion.py: Configure firewall

The tests in this file are calling ipa-[server,replica]-install directly
instead of using methods from tasks. Therefore it is required to enable
or disable the needed firewall services also.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Armando Neto <abiagion@redhat.com>
This commit is contained in:
Thomas Woerner 2018-11-30 17:21:39 +01:00
parent 3ac830c7b4
commit 3a7153c75c

View File

@ -12,6 +12,7 @@ from ipatests.test_integration.base import IntegrationTest
from ipatests.pytest_ipa.integration import tasks
from ipatests.pytest_ipa.integration.tasks import (
assert_error, replicas_cleanup)
from ipatests.pytest_ipa.integration.firewall import Firewall
from ipatests.pytest_ipa.integration.env_config import get_global_config
from ipalib.constants import (
DOMAIN_LEVEL_1, IPA_CA_NICKNAME)
@ -68,6 +69,8 @@ class TestReplicaPromotionLevel1(ReplicaPromotionBase):
raiseonerr=False)
assert result.returncode == 1
assert expected_err in result.stderr_text
Firewall(self.replicas[0]).enable_services(["freeipa-ldap",
"freeipa-ldaps"])
@replicas_cleanup
def test_one_command_installation(self):
@ -82,6 +85,8 @@ class TestReplicaPromotionLevel1(ReplicaPromotionBase):
'-r', self.master.domain.realm,
'--server', self.master.hostname,
'-U'])
Firewall(self.replicas[0]).enable_services(["freeipa-ldap",
"freeipa-ldaps"])
# Ensure that pkinit is properly configured, test for 7566
result = self.replicas[0].run_command(['ipa-pkinit-manage', 'status'])
assert "PKINIT is enabled" in result.stdout_text
@ -150,6 +155,8 @@ class TestUnprivilegedUserPermissions(IntegrationTest):
'-n', self.master.domain.name,
'-r', self.master.domain.realm,
'-U'])
Firewall(self.replicas[0]).enable_services(["freeipa-ldap",
"freeipa-ldaps"])
class TestProhibitReplicaUninstallation(IntegrationTest):
@ -170,6 +177,8 @@ class TestProhibitReplicaUninstallation(IntegrationTest):
" topology" % self.replicas[0].hostname, 1)
self.replicas[0].run_command(['ipa-server-install', '--uninstall',
'-U', '--ignore-topology-disconnect'])
Firewall(self.replicas[0]).disable_services(["freeipa-ldap",
"freeipa-ldaps"])
class TestWrongClientDomain(IntegrationTest):