2015-12-04 10:12:05 -06:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
|
|
|
#
|
|
|
|
|
|
|
|
"""
|
|
|
|
Module provides tests which testing ability of various subsystems to be
|
|
|
|
installed.
|
|
|
|
"""
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
import pytest
|
|
|
|
from ipalib.constants import DOMAIN_LEVEL_0
|
|
|
|
from ipatests.test_integration.env_config import get_global_config
|
2015-12-04 10:12:05 -06:00
|
|
|
from ipatests.test_integration.base import IntegrationTest
|
|
|
|
from ipatests.test_integration import tasks
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
config = get_global_config()
|
2015-12-04 10:12:05 -06:00
|
|
|
|
|
|
|
class InstallTestBase1(IntegrationTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
topology = 'star'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False)
|
|
|
|
|
|
|
|
def test_replica0_ca_less_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[0], setup_ca=False)
|
|
|
|
|
|
|
|
def test_replica0_ipa_ca_install(self):
|
|
|
|
tasks.install_ca(self.replicas[0])
|
|
|
|
|
|
|
|
def test_replica0_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[0], first_instance=True)
|
|
|
|
|
|
|
|
def test_replica0_ipa_dns_install(self):
|
|
|
|
tasks.install_dns(self.replicas[0])
|
|
|
|
|
|
|
|
def test_replica1_with_ca_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[1], setup_ca=True)
|
|
|
|
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[1])
|
|
|
|
|
|
|
|
def test_replica1_ipa_dns_install(self):
|
|
|
|
tasks.install_dns(self.replicas[1])
|
|
|
|
|
|
|
|
def test_replica2_with_ca_kra_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[2], setup_ca=True,
|
|
|
|
setup_kra=True)
|
|
|
|
|
|
|
|
def test_replica2_ipa_dns_install(self):
|
|
|
|
tasks.install_dns(self.replicas[2])
|
|
|
|
|
|
|
|
|
|
|
|
class InstallTestBase2(IntegrationTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
topology = 'star'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False)
|
|
|
|
|
|
|
|
def test_replica0_with_ca_kra_dns_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[0], setup_ca=True,
|
|
|
|
setup_kra=True, setup_dns=True)
|
|
|
|
|
|
|
|
def test_replica1_with_ca_dns_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[1], setup_ca=True,
|
|
|
|
setup_dns=True)
|
|
|
|
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[1])
|
|
|
|
|
|
|
|
def test_replica2_with_dns_install(self):
|
|
|
|
tasks.install_replica(self.master, self.replicas[2], setup_ca=False,
|
|
|
|
setup_dns=True)
|
|
|
|
|
|
|
|
def test_replica2_ipa_ca_install(self):
|
|
|
|
tasks.install_ca(self.replicas[2])
|
|
|
|
|
|
|
|
def test_replica2_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[2])
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Master X Replicas installation tests
|
|
|
|
##
|
|
|
|
|
|
|
|
class TestInstallWithCA1(InstallTestBase1):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False)
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA1, self).test_replica1_ipa_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_with_ca_kra_install(self):
|
|
|
|
super(TestInstallWithCA1, self).test_replica2_with_ca_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_ipa_dns_install(self):
|
|
|
|
super(TestInstallWithCA1, self).test_replica2_ipa_dns_install()
|
|
|
|
|
2015-12-04 10:12:05 -06:00
|
|
|
|
|
|
|
class TestInstallWithCA2(InstallTestBase2):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False)
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica0_with_ca_kra_dns_install(self):
|
|
|
|
super(TestInstallWithCA2, self).test_replica0_with_ca_kra_dns_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA2, self).test_replica1_ipa_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA2, self).test_replica2_ipa_kra_install()
|
|
|
|
|
2015-12-04 10:12:05 -06:00
|
|
|
|
|
|
|
class TestInstallWithCA_KRA1(InstallTestBase1):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False, setup_kra=True)
|
|
|
|
|
|
|
|
def test_replica0_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[0], first_instance=False)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInstallWithCA_KRA2(InstallTestBase2):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=False, setup_kra=True)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInstallWithCA_DNS1(InstallTestBase1):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=True)
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA_DNS1, self).test_replica1_ipa_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_with_ca_kra_install(self):
|
|
|
|
super(TestInstallWithCA_DNS1, self).test_replica2_with_ca_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_ipa_dns_install(self):
|
|
|
|
super(TestInstallWithCA_DNS1, self).test_replica2_ipa_dns_install()
|
|
|
|
|
2015-12-04 10:12:05 -06:00
|
|
|
|
|
|
|
class TestInstallWithCA_DNS2(InstallTestBase2):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=True)
|
|
|
|
|
2016-10-13 10:42:27 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica0_with_ca_kra_dns_install(self):
|
|
|
|
super(
|
|
|
|
TestInstallWithCA_DNS2, self
|
|
|
|
).test_replica0_with_ca_kra_dns_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica1_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA_DNS2, self).test_replica1_ipa_kra_install()
|
|
|
|
|
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
|
|
|
def test_replica2_ipa_kra_install(self):
|
|
|
|
super(TestInstallWithCA_DNS2, self).test_replica2_ipa_kra_install()
|
|
|
|
|
2015-12-04 10:12:05 -06:00
|
|
|
|
|
|
|
class TestInstallWithCA_KRA_DNS1(InstallTestBase1):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=True, setup_kra=True)
|
|
|
|
|
|
|
|
def test_replica0_ipa_kra_install(self):
|
|
|
|
tasks.install_kra(self.replicas[0], first_instance=False)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInstallWithCA_KRA_DNS2(InstallTestBase2):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
tasks.install_master(cls.master, setup_dns=True, setup_kra=True)
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Rest of master installation tests
|
|
|
|
##
|
|
|
|
|
|
|
|
class TestInstallMaster(IntegrationTest):
|
|
|
|
|
|
|
|
num_replicas = 0
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def test_install_master(self):
|
|
|
|
tasks.install_master(self.master, setup_dns=False)
|
|
|
|
|
|
|
|
def test_install_kra(self):
|
|
|
|
tasks.install_kra(self.master, first_instance=True)
|
|
|
|
|
|
|
|
def test_install_dns(self):
|
|
|
|
tasks.install_dns(self.master)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInstallMasterKRA(IntegrationTest):
|
|
|
|
|
|
|
|
num_replicas = 0
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def test_install_master(self):
|
|
|
|
tasks.install_master(self.master, setup_dns=False, setup_kra=True)
|
|
|
|
|
|
|
|
def test_install_dns(self):
|
|
|
|
tasks.install_dns(self.master)
|
|
|
|
|
|
|
|
|
|
|
|
class TestInstallMasterDNS(IntegrationTest):
|
|
|
|
|
|
|
|
num_replicas = 0
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def test_install_master(self):
|
|
|
|
tasks.install_master(self.master, setup_dns=True)
|
|
|
|
|
|
|
|
def test_install_kra(self):
|
|
|
|
tasks.install_kra(self.master, first_instance=True)
|