Example #1
0
def mh(request, class_integration_logs):
    """IPA's multihost fixture object
    """
    cls = request.cls

    domain_description = {
        'type': 'IPA',
        'hosts': {
            'master': 1,
            'replica': cls.num_replicas,
            'client': cls.num_clients,
        },
    }
    domain_description['hosts'].update(
        {role: 1 for role in cls.required_extra_roles})

    domain_descriptions = [domain_description]
    for i in range(cls.num_ad_domains):
        domain_descriptions.append({
            'type': 'AD',
            'hosts': {'ad': 1, 'ad_subdomain': 1},
        })

    mh = make_multihost_fixture(
        request,
        domain_descriptions,
        config_class=Config,
        _config=get_global_config(),
    )

    mh.domain = mh.config.domains[0]
    [mh.master] = mh.domain.hosts_by_role('master')
    mh.replicas = mh.domain.hosts_by_role('replica')
    mh.clients = mh.domain.hosts_by_role('client')

    cls.logs_to_collect = class_integration_logs

    def collect_log(host, filename):
        log.info('Adding %s:%s to list of logs to collect' %
                 (host.external_hostname, filename))
        class_integration_logs.setdefault(host, []).append(filename)

    print(mh.config)
    for host in mh.config.get_all_hosts():
        host.add_log_collector(collect_log)
        cls.log.info('Preparing host %s', host.hostname)
        tasks.prepare_host(host)

    setup_class(cls, mh)
    mh._pytestmh_request.addfinalizer(lambda: teardown_class(cls))

    yield mh.install()

    for host in cls.get_all_hosts():
        host.remove_log_collector(collect_log)

    collect_test_logs(request.node, class_integration_logs, request.config)
Example #2
0
def mh(request, class_integration_logs):
    """IPA's multihost fixture object
    """
    cls = request.cls

    domain_description = {
        'type': 'IPA',
        'hosts': {
            'master': 1,
            'replica': cls.num_replicas,
            'client': cls.num_clients,
        },
    }
    domain_description['hosts'].update(
        {role: 1 for role in cls.required_extra_roles})

    domain_descriptions = [domain_description]
    for _i in range(cls.num_ad_domains):
        domain_descriptions.append({
            'type': 'AD',
            'hosts': {'ad': 1, 'ad_subdomain': 1},
        })

    mh = make_multihost_fixture(
        request,
        domain_descriptions,
        config_class=Config,
        _config=get_global_config(),
    )

    mh.domain = mh.config.domains[0]
    [mh.master] = mh.domain.hosts_by_role('master')
    mh.replicas = mh.domain.hosts_by_role('replica')
    mh.clients = mh.domain.hosts_by_role('client')

    cls.logs_to_collect = class_integration_logs

    def collect_log(host, filename):
        log.info('Adding %s:%s to list of logs to collect' %
                 (host.external_hostname, filename))
        class_integration_logs.setdefault(host, []).append(filename)

    print(mh.config)
    for host in mh.config.get_all_hosts():
        host.add_log_collector(collect_log)
        cls.log.info('Preparing host %s', host.hostname)
        tasks.prepare_host(host)

    setup_class(cls, mh)
    mh._pytestmh_request.addfinalizer(lambda: teardown_class(cls))

    yield mh.install()

    for host in cls.get_all_hosts():
        host.remove_log_collector(collect_log)

    collect_test_logs(request.node, class_integration_logs, request.config)
Example #3
0
#
# Copyright (C) 2015  FreeIPA Contributors see COPYING for license
#
"""
Module provides tests which testing ability of various subsystems to be
installed.
"""

import pytest
from ipalib.constants import DOMAIN_LEVEL_0
from ipatests.test_integration.env_config import get_global_config
from ipatests.test_integration.base import IntegrationTest
from ipatests.test_integration import tasks

config = get_global_config()


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])
Example #4
0
#
# Copyright (C) 2015  FreeIPA Contributors see COPYING for license
#

"""
Module provides tests which testing ability of various subsystems to be
installed.
"""

import pytest
from ipalib.constants import DOMAIN_LEVEL_0
from ipatests.test_integration.env_config import get_global_config
from ipatests.test_integration.base import IntegrationTest
from ipatests.test_integration import tasks

config = get_global_config()

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])