Ejemplo n.º 1
0
 def from_config(cls):
     url = cfme_data.get("bugzilla", {}).get("url")
     product = cfme_data.get("bugzilla", {}).get("product")
     if url is None:
         raise Exception("No Bugzilla URL specified!")
     cr_root = cfme_data.get("bugzilla", {}).get("credentials")
     username = credentials.get(cr_root, {}).get("username")
     password = credentials.get(cr_root, {}).get("password")
     return cls(
         url=url, user=username, password=password, cookiefile=None,
         tokenfile=None, product=product)
Ejemplo n.º 2
0
def pxe_servers(metafunc):
    """Provides pxe data
    """
    argnames = ['pxe_name']
    argvalues = [[k] for k in sorted(cfme_data.get('pxe_servers', {}).keys())]
    idlist = [k[0] for k in argvalues]
    return argnames, argvalues, idlist
Ejemplo n.º 3
0
def pytest_generate_tests(metafunc):
    auth_modes = cfme_data.get('auth_test_data')
    if not auth_modes:
        return
    argvalues = [[authmode] for authmode in auth_modes]
    if 'configure_auth' in metafunc.fixturenames:
        metafunc.parametrize(['auth_mode'], argvalues)
Ejemplo n.º 4
0
def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.providers_by_class(
        metafunc, [InfraProvider], required_fields=[
            'iso_datastore',
            ['provisioning', 'host'],
            ['provisioning', 'datastore'],
            ['provisioning', 'iso_template'],
            ['provisioning', 'iso_file'],
            ['provisioning', 'iso_kickstart'],
            ['provisioning', 'iso_root_password'],
            ['provisioning', 'iso_image_type'],
            ['provisioning', 'vlan'],
        ])

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        iso_cust_template = args['provider'].data['provisioning']['iso_kickstart']
        if iso_cust_template not in cfme_data.get('customization_templates', {}).keys():
            continue

        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
Ejemplo n.º 5
0
def pxe_servers(metafunc):
    """Provides pxe data
    """
    argnames = ['pxe_name']

    items = cfme_data.get('pxe_servers', {}).keys()

    return argnames, items, items
def configure_openldap_auth_mode(browser, available_auth_modes):
    """Configure LDAP authentication mode"""
    if 'miq_openldap' in available_auth_modes:
        auth_mode = current_appliance.server.authentication
        server_data = cfme_data.get('auth_modes', {})['miq_openldap']
        auth_mode.set_auth_mode(**server_data)
        yield
        current_appliance.server.login_admin()
        auth_mode.set_auth_mode()
    else:
        yield
def roles(request, all_possible_roles, appliance):
    result = {}
    for role in all_possible_roles:
        result[role] = role in cfme_data.get("server_roles", {})["sets"][request.param]
    # Hard-coded protection
    result["user_interface"] = True

    # ansible role introduced in CFME 5.8
    if appliance.version < '5.8' and result.get('embedded_ansible'):
        del result['embedded_ansible']
    return result
Ejemplo n.º 8
0
def pytest_generate_tests(metafunc):
    if metafunc.function in {test_upgrade_single_inplace}:
        return
    argnames, argvalues, idlist = ['db_url', 'db_version', 'db_desc'], [], []
    db_backups = cfme_data.get('db_backups', {})
    if not db_backups:
        return []
    for key, data in db_backups.iteritems():
        argvalues.append((data.url, data.version, data.desc))
        idlist.append(key)
    return metafunc.parametrize(argnames=argnames, argvalues=argvalues, ids=idlist)
Ejemplo n.º 9
0
def roles(request, all_possible_roles):
    result = {}
    try:
        for role in all_possible_roles:
            result[role] = role in cfme_data.get("server_roles", {})["sets"][request.param]
    except (KeyError, AttributeError):
        pytest.skip('Failed looking up role {} in cfme_data.server_roles.sets'.format(role))
    # Hard-coded protection
    result["user_interface"] = True

    return result
Ejemplo n.º 10
0
def vddk_url(provider):
    try:
        major, minor = str(provider.version).split(".")
    except ValueError:
        major = str(provider.version)
        minor = "0"
    vddk_version = "v{}_{}".format(major, minor)
    try:
        return cfme_data.get("basic_info").get("vddk_url").get(vddk_version)
    except AttributeError:
        pytest.skip("There is no vddk url for this VMware provider version")
def add_type_to_provider(apps, schema_editor):
    from cfme.utils.conf import cfme_data
    Provider = apps.get_model("appliances", "Provider")  # noqa
    for provider in Provider.objects.using(schema_editor.connection.alias).all():
        # Need to replicate the functionality from the model here
        provider_data = yaml.load(provider.object_meta_data).get('provider_data')
        if not provider_data:
            provider_data = cfme_data.get("management_systems", {}).get(provider.id, {})
        provider_type = provider_data.get('type', None)
        if provider_type is not None:
            provider.provider_type = provider_type
            provider.save(update_fields=['provider_type'])
Ejemplo n.º 12
0
def config_managers(metafunc):
    """Provides config managers
    """
    argnames = ['config_manager_obj']
    argvalues = []
    idlist = []

    data = cfme_data.get('configuration_managers', {})

    for cfg_mgr_key in data:
        argvalues.append([get_config_manager_from_config(cfg_mgr_key)])
        idlist.append(cfg_mgr_key)
    return argnames, argvalues, idlist
def configure_openldap_auth_mode_default_groups(browser, available_auth_modes):
    """Configure LDAP authentication mode"""
    if 'miq_openldap' in available_auth_modes:
        auth_mode = current_appliance.server.authentication
        server_data = cfme_data.get('auth_modes', {})['miq_openldap']
        server_data['get_groups'] = False
        server_data['default_groups'] = 'EvmRole-user'
        auth_mode.set_auth_mode(**server_data)
        yield
        current_appliance.server.login_admin()
        auth_mode.set_auth_mode()
    else:
        yield
def configure_aws_iam_auth_mode(browser, available_auth_modes):
    """Configure AWS IAM authentication mode"""
    if 'miq_aws_iam' in available_auth_modes:
        auth_mode = current_appliance.server.authentication
        aws_iam_data = dict(cfme_data.get('auth_modes', {})['miq_aws_iam'])
        aws_iam_creds = credentials[aws_iam_data.pop('credentials')]
        aws_iam_data['access_key'] = aws_iam_creds['username']
        aws_iam_data['secret_key'] = aws_iam_creds['password']
        auth_mode.set_auth_mode(**aws_iam_data)
        yield
        current_appliance.server.login_admin()
        auth_mode.set_auth_mode()
    else:
        yield
def add_type_to_provider(apps, schema_editor):
    from cfme.utils.conf import cfme_data
    Provider = apps.get_model("appliances", "Provider")  # noqa
    for provider in Provider.objects.using(
            schema_editor.connection.alias).all():
        # Need to replicate the functionality from the model here
        provider_data = yaml.load(
            provider.object_meta_data).get('provider_data')
        if not provider_data:
            provider_data = cfme_data.get("management_systems",
                                          {}).get(provider.id, {})
        provider_type = provider_data.get('type', None)
        if provider_type is not None:
            provider.provider_type = provider_type
            provider.save(update_fields=['provider_type'])
Ejemplo n.º 16
0
def vddk_url(provider):
    try:
        major, minor = str(provider.version).split(".")
    except ValueError:
        major = str(provider.version)
        minor = "0"
    vddk_version = "v{}_{}".format(major, minor)
    # cf. BZ 1651702 vddk_version 6_7 does not currently work with CFME, so use v6_5
    if BZ(1651702, forced_streams=['5.9', '5.10']).blocks:
        vddk_version = "v6_5"
    url = cfme_data.get("basic_info").get("vddk_url").get(vddk_version)
    if url is None:
        pytest.skip("There is no vddk url for this VMware provider version")
    else:
        return url
Ejemplo n.º 17
0
def vddk_url(provider):
    try:
        major, minor = str(provider.version).split(".")
    except ValueError:
        major = str(provider.version)
        minor = "0"
    vddk_version = "v{}_{}".format(major, minor)
    # cf. BZ 1651702 vddk_version 6_7 does not currently work with CFME, so use v6_5
    if BZ(1651702, forced_streams=['5.9','5.10']).blocks:
        vddk_version = "v6_5"
    url = cfme_data.get("basic_info").get("vddk_url").get(vddk_version)
    if url is None:
        pytest.skip("There is no vddk url for this VMware provider version")
    else:
        return url
Ejemplo n.º 18
0
def pytest_generate_tests(metafunc):
    if metafunc.function in {
            test_upgrade_single_inplace, test_db_migrate_replication
    }:
        return
    argnames, argvalues, idlist = ['db_url', 'db_version', 'db_desc'], [], []
    db_backups = cfme_data.get('db_backups', {})
    if not db_backups:
        return []
    for key, data in db_backups.iteritems():
        argvalues.append((data.url, data.version, data.desc))
        idlist.append(key)
    return metafunc.parametrize(argnames=argnames,
                                argvalues=argvalues,
                                ids=idlist)
Ejemplo n.º 19
0
def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.providers_by_class(
        metafunc, [InfraProvider],
        required_fields=[['provisioning', 'pxe_server'],
                         ['provisioning', 'pxe_image'],
                         ['provisioning', 'pxe_image_type'],
                         ['provisioning', 'pxe_kickstart'],
                         ['provisioning', 'pxe_template'],
                         ['provisioning', 'datastore'],
                         ['provisioning', 'host'],
                         ['provisioning', 'pxe_root_password'],
                         ['provisioning', 'vlan']])
    pargnames, pargvalues, pidlist = testgen.pxe_servers(metafunc)
    argnames = argnames + ['pxe_server', 'pxe_cust_template']
    pxe_server_names = [pval[0] for pval in pargvalues]

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        provider = args['provider']

        if provider.one_of(SCVMMProvider):
            continue

        provisioning_data = provider.data['provisioning']

        pxe_server_name = provisioning_data['pxe_server']
        if pxe_server_name not in pxe_server_names:
            continue

        pxe_cust_template = provisioning_data['pxe_kickstart']
        if pxe_cust_template not in cfme_data.get('customization_templates',
                                                  {}).keys():
            continue

        argvalues[i].append(get_pxe_server_from_config(pxe_server_name))
        argvalues[i].append(get_template_from_config(pxe_cust_template))
        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc,
                        argnames,
                        new_argvalues,
                        ids=new_idlist,
                        scope="module")
Ejemplo n.º 20
0
def pytest_generate_tests(metafunc):
    # Filter out providers without host provisioning data defined
    argnames, argvalues, idlist = testgen.providers_by_class(
        metafunc, [InfraProvider], required_fields=[
            ['host_provisioning', 'pxe_server'],
            ['host_provisioning', 'pxe_image'],
            ['host_provisioning', 'pxe_image_type'],
            ['host_provisioning', 'pxe_kickstart'],
            ['host_provisioning', 'datacenter'],
            ['host_provisioning', 'cluster'],
            ['host_provisioning', 'datastores'],
            ['host_provisioning', 'hostname'],
            ['host_provisioning', 'root_password'],
            ['host_provisioning', 'ip_addr'],
            ['host_provisioning', 'subnet_mask'],
            ['host_provisioning', 'gateway'],
            ['host_provisioning', 'dns'],
        ])
    pargnames, pargvalues, pidlist = testgen.pxe_servers(metafunc)
    pxe_server_names = [pval[0] for pval in pargvalues]

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))
        try:
            prov_data = args['provider'].data['host_provisioning']
        except KeyError:
            # No host provisioning data available
            continue

        holder = metafunc.config.pluginmanager.get_plugin('appliance-holder')
        stream = prov_data.get('runs_on_stream', '')
        if not holder.held_appliance.version.is_in_series(str(stream)):
            continue

        pxe_server_name = prov_data.get('pxe_server', '')
        if pxe_server_name not in pxe_server_names:
            continue

        pxe_cust_template = prov_data.get('pxe_kickstart', '')
        if pxe_cust_template not in cfme_data.get('customization_templates', {}).keys():
            continue

        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
Ejemplo n.º 21
0
def roles(request, all_possible_roles, appliance):
    result = {}
    for role in all_possible_roles:
        result[role] = role in cfme_data.get("server_roles", {})["sets"][request.param]
    # Hard-coded protection
    result["user_interface"] = True

    # ansible role introduced in CFME 5.8
    if appliance.version < '5.8' and result.get('embedded_ansible'):
        del result['embedded_ansible']

    # RHN Mirror role removed from CFME 5.9
    if appliance.version > '5.9':
        del result['rhn_mirror']

    return result
Ejemplo n.º 22
0
def pytest_generate_tests(metafunc):
    if metafunc.function in {test_upgrade_single_inplace, test_db_migrate_replication}:
        return

    argnames, argvalues, idlist = ['db_url', 'db_version', 'db_desc'], [], []
    db_backups = cfme_data.get('db_backups', {})
    if not db_backups:
        pytest.skip('No db backup information available!')
    for key, data in db_backups.items():
        # Once we can access the appliance in here, we can do
        # if data.version >= appliance.version or \
        #         get_stream(data.version) == get_stream(appliance.version):
        #     continue
        argvalues.append((data.url, data.version, data.desc))
        idlist.append(key)
    return metafunc.parametrize(argnames=argnames, argvalues=argvalues, ids=idlist)
Ejemplo n.º 23
0
def pytest_generate_tests(metafunc):
    if metafunc.function in {test_upgrade_single_inplace, test_db_migrate_replication}:
        return

    argnames, argvalues, idlist = ['db_url', 'db_version', 'db_desc'], [], []
    db_backups = cfme_data.get('db_backups', {})
    if not db_backups:
        pytest.skip('No db backup information available!')
    for key, data in db_backups.items():
        # Once we can access the appliance in here, we can do
        # if data.version >= appliance.version or \
        #         get_stream(data.version) == get_stream(appliance.version):
        #     continue
        argvalues.append((data.url, data.version, data.desc))
        idlist.append(key)
    return metafunc.parametrize(argnames=argnames, argvalues=argvalues, ids=idlist)
def auth_groups():
    """Build a list of tuples containing (group_name, context)
    Returns:
        tuple containing (group_name, context)
        where group_name is a string and context is ViaUI/SSUI
    """
    if 'miq_aws_iam' not in cfme_data.get('auth_modes'):
        pytest.skip('No yaml entry for "miq_aws_iam" in cfme_data.auth_modes')
    else:
        parameter_list = []
        # TODO: Include SSUI role_access dict and VIASSUI context
        roles_and_context = [(
            role_access_ui_59z if current_appliance.version >= '5.9' else role_access_ui_58z, ViaUI)
        ]
        for group_dict, context in roles_and_context:
            parameter_list.extend([(group, context) for group in group_dict.keys()])
    return parameter_list
Ejemplo n.º 25
0
def pytest_configure(config):
    path = cfme_data.get('cfme_annotations_path')
    if path:
        to_parse = project_path.join(path)
        parsed = parse(to_parse)
        if not parsed:
            store.terminalreporter.line(
                'no test annotation found in {}'.format(to_parse), yellow=True)
    else:
        store.terminalreporter.line('no test annotation found in {}'.format(path), yellow=True)
        parsed = []
    config.pluginmanager.register(MarkFromMap.from_parsed_list(
        parsed, 'tier', pytest.mark.tier))
    config.pluginmanager.register(MarkFromMap.from_parsed_list(
        parsed, 'requirement', pytest.mark.requirement))
    config.pluginmanager.register(MarkFromMap.from_parsed_list(parsed, 'type',
                                                               pytest.mark.__getattr__))
def test_server_role_failover(distributed_appliances):
    """Test that server roles failover successfully to a secondary appliance if evmserverd stops
    on the primary appliance.

    Metadata:
        test_flag: configuration

    Polarion:
        assignee: tpapaioa
        casecomponent: Appliance
        caseimportance: medium
        initialEstimate: 1/12h
    """
    primary_appliance, secondary_appliance = distributed_appliances

    all_server_roles = cfme_data.get('server_roles', {'all': []})['all']
    if not all_server_roles:
        pytest.skip(
            'Empty server_roles dictionary in cfme_data, skipping test')

    # Remove roles in cfme_data that are not in 5.11 or later.
    remove_roles = ['websocket']
    server_roles = [r for r in all_server_roles if r not in remove_roles]
    fill_values = {k: True for k in server_roles}

    # Enable all roles on both appliances.
    for appliance in distributed_appliances:
        appliance.browser_steal = True
        with appliance:
            view = navigate_to(appliance.server, 'Server')
            view.server_roles.fill(fill_values)
            view.save.click()
            view.flash.assert_no_error()

    # Stop evmserverd on secondary appliance.
    secondary_appliance.evmserverd.stop()

    # Verify that all roles are active on primary appliance.
    wait_for(lambda: primary_appliance.server_roles == fill_values)

    # Stop evmserverd on primary appliance and restart it on secondary appliance.
    secondary_appliance.evmserverd.start()
    primary_appliance.evmserverd.stop()

    # Verify that all roles are now active on secondary appliance.
    wait_for(lambda: secondary_appliance.server_roles == fill_values)
Ejemplo n.º 27
0
def auth_groups():
    """Build a list of tuples containing (group_name, context)
    Returns:
        tuple containing (group_name, context)
        where group_name is a string and context is ViaUI/SSUI
    """
    if 'miq_aws_iam' not in cfme_data.get('auth_modes'):
        pytest.skip('No yaml entry for "miq_aws_iam" in cfme_data.auth_modes')
    else:
        parameter_list = []
        # TODO: Include SSUI role_access dict and VIASSUI context
        roles_and_context = [(
            role_access_ui_59z if current_appliance.version >= '5.9' else role_access_ui_58z, ViaUI)
        ]
        for group_dict, context in roles_and_context:
            parameter_list.extend([(group, context) for group in group_dict.keys()])
    return parameter_list
def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.providers_by_class(
        metafunc, [InfraProvider],
        required_fields=[
            ['provisioning', 'pxe_server'],
            ['provisioning', 'pxe_image'],
            ['provisioning', 'pxe_image_type'],
            ['provisioning', 'pxe_kickstart'],
            ['provisioning', 'pxe_template'],
            ['provisioning', 'datastore'],
            ['provisioning', 'host'],
            ['provisioning', 'pxe_root_password'],
            ['provisioning', 'vlan']
        ]
    )
    pargnames, pargvalues, pidlist = testgen.pxe_servers(metafunc)
    argnames = argnames + ['pxe_server', 'pxe_cust_template']
    pxe_server_names = [pval[0] for pval in pargvalues]

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        provider = args['provider']

        if provider.one_of(SCVMMProvider):
            continue

        provisioning_data = provider.data['provisioning']

        pxe_server_name = provisioning_data['pxe_server']
        if pxe_server_name not in pxe_server_names:
            continue

        pxe_cust_template = provisioning_data['pxe_kickstart']
        if pxe_cust_template not in cfme_data.get('customization_templates', {}).keys():
            continue

        argvalues[i].append(get_pxe_server_from_config(pxe_server_name))
        argvalues[i].append(get_template_from_config(pxe_cust_template))
        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
Ejemplo n.º 29
0
def pxe_servers(metafunc):
    """Provides pxe data based on the server_type

    Args:
        server_name: One of the server names to filter by, or 'all'.

    """
    argnames = ['pxe_name', 'pxe_server_crud']
    argvalues = []
    idlist = []

    data = cfme_data.get('pxe_servers', {})

    for pxe_server in data:
        argvalues.append([data[pxe_server]['name'],
                          get_pxe_server_from_config(pxe_server)])
        idlist.append(pxe_server)
    return argnames, argvalues, idlist
Ejemplo n.º 30
0
def config_managers(metafunc, managers_type=None):
    """Provides config managers
    """
    argnames = ['config_manager_obj']
    argvalues = []
    idlist = []

    data = cfme_data.get('configuration_managers', {})

    for cfg_mgr_key in data:
        config_mgr = get_config_manager_from_config(cfg_mgr_key)
        if managers_type and config_mgr.type != managers_type:
            logger.info('Checking config managers type for [{}], skipping mismatched: [{}]'
                        .format(managers_type, config_mgr))
            continue  # skip it
        argvalues.append([config_mgr])
        idlist.append(cfg_mgr_key)
    return argnames, argvalues, idlist
Ejemplo n.º 31
0
def config_managers(metafunc, managers_type=None):
    """Provides config managers
    """
    argnames = ['config_manager_obj']
    argvalues = []
    idlist = []

    data = cfme_data.get('configuration_managers', {})

    for cfg_mgr_key in data:
        config_mgr = get_config_manager_from_config(cfg_mgr_key)
        if managers_type and config_mgr.type != managers_type:
            logger.info('Checking config managers type for [{}], skipping mismatched: [{}]'
                        .format(managers_type, config_mgr))
            continue  # skip it
        argvalues.append([config_mgr])
        idlist.append(cfg_mgr_key)
    return argnames, argvalues, idlist
Ejemplo n.º 32
0
def pxe_servers(metafunc):
    """Provides pxe data based on the server_type

    Args:
        server_name: One of the server names to filter by, or 'all'.

    """
    argnames = ['pxe_name', 'pxe_server_crud']
    argvalues = []
    idlist = []

    data = cfme_data.get('pxe_servers', {})

    for pxe_server in data:
        argvalues.append(
            [data[pxe_server]['name'],
             get_pxe_server_from_config(pxe_server)])
        idlist.append(pxe_server)
    return argnames, argvalues, idlist
Ejemplo n.º 33
0
def pytest_configure(config):
    path = cfme_data.get('cfme_annotations_path')
    if path:
        to_parse = project_path.join(path)
        parsed = parse(to_parse)
        if not parsed:
            store.terminalreporter.line(
                'no test annotation found in {}'.format(to_parse), yellow=True)
    else:
        store.terminalreporter.line(
            'no test annotation found in {}'.format(path), yellow=True)
        parsed = []
    config.pluginmanager.register(
        MarkFromMap.from_parsed_list(parsed, 'tier', pytest.mark.tier))
    config.pluginmanager.register(
        MarkFromMap.from_parsed_list(parsed, 'requirement',
                                     pytest.mark.requirement))
    config.pluginmanager.register(
        MarkFromMap.from_parsed_list(parsed, 'type', pytest.mark.__getattr__))
Ejemplo n.º 34
0
def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.providers_by_class(
        metafunc, [InfraProvider],
        required_fields=[
            'iso_datastore',
            ['provisioning', 'host'],
            ['provisioning', 'datastore'],
            ['provisioning', 'iso_template'],
            ['provisioning', 'iso_file'],
            ['provisioning', 'iso_kickstart'],
            ['provisioning', 'iso_root_password'],
            ['provisioning', 'iso_image_type'],
            ['provisioning', 'vlan'],
        ])
    argnames = argnames + ['iso_cust_template', 'iso_datastore']

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        iso_cust_template = args['provider'].data['provisioning'][
            'iso_kickstart']
        if iso_cust_template not in cfme_data.get('customization_templates',
                                                  {}).keys():
            continue

        argvalues[i].append(get_template_from_config(iso_cust_template))
        argvalues[i].append(ISODatastore(args['provider'].name))
        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc,
                        argnames,
                        new_argvalues,
                        ids=new_idlist,
                        scope="module")
def set_host_credentials(request, provider, vm_analysis_data):
    # Add credentials to host
    test_host = host.Host(name=vm_analysis_data['host'], provider=provider)
    wait_for(lambda: test_host.exists, delay=10, num_sec=120)

    host_list = cfme_data.get('management_systems', {})[provider.key].get('hosts', [])
    host_data = [x for x in host_list if x.name == vm_analysis_data['host']][0]

    # has valid creds appears broken
    if not test_host.has_valid_credentials:
        test_host.update(
            updates={'credentials': host.get_credentials_from_config(host_data['credentials'])},
            validate_credentials=True
        )

    # Remove creds after test
    @request.addfinalizer
    def _host_remove_creds():
        test_host.update(
            updates={'credentials': host.Host.Credential(
                principal="", secret="", verify_secret="")},
            validate_credentials=False
        )
def set_host_credentials(appliance, request, provider, vm_analysis_data):
    # Add credentials to host
    host_collection = appliance.collections.hosts
    test_host = host_collection.instantiate(name=vm_analysis_data['host'], provider=provider)
    wait_for(lambda: test_host.exists, delay=10, num_sec=120)

    host_list = cfme_data.get('management_systems', {})[provider.key].get('hosts', [])
    host_data = [x for x in host_list if x.name == vm_analysis_data['host']][0]

    # has valid creds appears broken
    if not test_host.has_valid_credentials:
        test_host.update(
            updates={'credentials': host.get_credentials_from_config(host_data['credentials'])},
            validate_credentials=True
        )

    # Remove creds after test
    @request.addfinalizer
    def _host_remove_creds():
        test_host.update(
            updates={'credentials': host.Host.Credential(
                principal="", secret="", verify_secret="")},
            validate_credentials=False
        )
Ejemplo n.º 37
0
def auth_groups(metafunc, auth_mode):
    """Provides two test params based on the 'auth_modes' and 'group_roles' in cfme_data:

        ``group_name``:
            expected group name in provided by the backend specified in ``auth_mode``

        ``group_data``:
            list of nav destinations that should be visible as a member of ``group_name``

    Args:

        auth_mode: One of the auth_modes specified in ``cfme_data.get('auth_modes', {})``

    """
    argnames = ['group_name', 'group_data']
    argvalues = []
    idlist = []

    if auth_mode in cfme_data.get('auth_modes', {}):
        # If auth_modes exists, group_roles is assumed to exist as well
        for group in group_data:
            argvalues.append([group, sorted(group_data[group])])
            idlist.append(group)
    return argnames, argvalues, idlist
def main():
    parser = argparse.ArgumentParser(epilog=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument(
        '--address',
        help='hostname or ip address of target appliance',
        default=None)
    parser.add_argument(
        '--sdk_url',
        help='url to download sdk pkg',
        default=cfme_data.get("basic_info", {}).get("netapp_sdk_url"))
    parser.add_argument('--restart', help='restart evmserverd after installation ' +
        '(required for proper operation)', action="store_true")

    args = parser.parse_args()
    if not args.address:
        appliance = get_or_create_current_appliance()
    else:
        appliance = IPAppliance(hostname=args.address)
    print('Address: {}'.format(appliance.hostname))
    print('SDK URL: {}'.format(args.sdk_url))
    print('Restart: {}'.format(args.restart))

    appliance.install_netapp_sdk(sdk_url=args.sdk_url, reboot=args.restart, log_callback=log)
def main():
    parser = argparse.ArgumentParser(epilog=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument(
        '--address',
        help='hostname or ip address of target appliance',
        default=None)
    parser.add_argument(
        '--sdk_url',
        help='url to download sdk pkg',
        default=cfme_data.get("basic_info", {}).get("netapp_sdk_url"))
    parser.add_argument('--restart', help='restart evmserverd after installation ' +
        '(required for proper operation)', action="store_true")

    args = parser.parse_args()
    if not args.address:
        appliance = get_or_create_current_appliance()
    else:
        appliance = IPAppliance(hostname=args.address)
    print('Address: {}'.format(appliance.hostname))
    print('SDK URL: {}'.format(args.sdk_url))
    print('Restart: {}'.format(args.restart))

    appliance.install_netapp_sdk(sdk_url=args.sdk_url, reboot=args.restart, log_callback=log)
Ejemplo n.º 40
0
def auth_groups(metafunc, auth_mode):
    """Provides two test params based on the 'auth_modes' and 'group_roles' in cfme_data:

        ``group_name``:
            expected group name in provided by the backend specified in ``auth_mode``

        ``group_data``:
            list of nav destinations that should be visible as a member of ``group_name``

    Args:

        auth_mode: One of the auth_modes specified in ``cfme_data.get('auth_modes', {})``

    """
    argnames = ['group_name', 'group_data']
    argvalues = []
    idlist = []

    if auth_mode in cfme_data.get('auth_modes', {}):
        # If auth_modes exists, group_roles is assumed to exist as well
        for group in group_data:
            argvalues.append([group, sorted(group_data[group])])
            idlist.append(group)
    return argnames, argvalues, idlist
Ejemplo n.º 41
0
# -*- coding: utf-8 -*-
import pytest

from cfme.utils.conf import cfme_data

server_roles_conf = cfme_data.get('server_roles',
                                  {'all': [], 'sets': {}})


@pytest.fixture(scope="session")
def all_possible_roles():
    roles = server_roles_conf['all']
    roles.remove('database_synchronization')
    return roles


@pytest.fixture(scope="module", params=server_roles_conf['sets'].keys())
def roles(request, all_possible_roles):
    result = {}
    try:
        for role in all_possible_roles:
            result[role] = role in cfme_data.get("server_roles", {})["sets"][request.param]
    except (KeyError, AttributeError):
        pytest.skip('Failed looking up role {} in cfme_data.server_roles.sets'.format(role))
    # Hard-coded protection
    result["user_interface"] = True

    return result


@pytest.mark.tier(3)
def available_auth_modes():
    return cfme_data.get('auth_modes', {}).keys()
Ejemplo n.º 43
0
    apps[0].wait_for_evm_service()
    apps[0].wait_for_web_ui()
    print("VMDB appliance provisioned and configured {}".format(ip0))
    command_set1 = ('ap', '', opt, '2', ip0, '', pwd, '',
                    '3') + port + ('', '', pwd, TimedCommand(pwd, 360), '')
    apps[1].appliance_console.run_commands(command_set1)
    apps[1].wait_for_evm_service()
    apps[1].wait_for_web_ui()
    print("Non-VMDB appliance provisioned and configured {}".format(ip1))
    print("Appliance pool lease time is {}".format(lease))


@main.command('ha', help='Sets up high availability environment')
@click.option('--cfme-version', required=True)
@click.option('--provider',
              default=cfme_data.get('basic_info', {}).get('ha_provider'),
              help='Specify sprout provider, must not be RHOS')
@click.option('--lease',
              default='3h',
              help='set pool lease time, example: 1d4h30m')
@click.option('--desc',
              default='HA configuration',
              help='Set description of the pool')
def setup_ha_env(cfme_version, provider, lease, desc):
    lease_time = tot_time(lease)
    """multi appliance setup consisting of dedicated primary and standy databases with a single
    UI appliance."""
    print("Provisioning and configuring HA environment")
    apps, request_id = provision_appliances(count=3,
                                            cfme_version=cfme_version,
                                            provider=provider,
Ejemplo n.º 44
0
 def open_states(self):
     return cfme_data.get("bugzilla", {}).get("skip", set([]))
Ejemplo n.º 45
0
 def loose(self):
     return cfme_data.get("bugzilla", {}).get("loose", [])
Ejemplo n.º 46
0
 def open_states(self):
     return cfme_data.get("bugzilla", {}).get("skip", set([]))
Ejemplo n.º 47
0
def test_ssa_template(request, local_setup_provider, provider, soft_assert,
                      vm_analysis_data, appliance):
    """ Tests SSA can be performed on a template

    Metadata:
        test_flag: vm_analysis
    """

    template_name = vm_analysis_data['image']
    template = Template.factory(template_name, provider, template=True)

    # Set credentials to all hosts set for this datastore
    if provider.type in ['virtualcenter', 'rhevm']:
        datastore_name = vm_analysis_data['datastore']
        datastore_collection = appliance.collections.datastores
        test_datastore = datastore_collection.instantiate(name=datastore_name,
                                                          provider=provider)
        host_list = cfme_data.get('management_systems',
                                  {})[provider.key].get('hosts', [])
        host_names = [h.name for h in test_datastore.get_hosts()]
        for host_name in host_names:
            host_collection = appliance.collections.hosts
            test_host = host_collection.instantiate(name=host_name,
                                                    provider=provider)
            hosts_data = [x for x in host_list if x.name == host_name]
            if len(hosts_data) > 0:
                host_data = hosts_data[0]

                if not test_host.has_valid_credentials:
                    creds = host.get_credentials_from_config(
                        host_data['credentials'])
                    test_host.update(updates={'credentials': creds},
                                     validate_credentials=True)

    template.smartstate_scan()
    wait_for(lambda: is_vm_analysis_finished(template_name),
             delay=15,
             timeout="35m",
             fail_func=lambda: toolbar.select('Reload'))

    # Check release and quadricon
    quadicon_os_icon = template.find_quadicon().data['os']
    details_os_icon = template.get_detail(properties=('Properties',
                                                      'Operating System'),
                                          icon_href=True)
    logger.info("Icons: {}, {}".format(details_os_icon, quadicon_os_icon))

    # We shouldn't use get_detail anymore - it takes too much time
    c_users = InfoBlock.text('Security', 'Users')
    c_groups = InfoBlock.text('Security', 'Groups')
    c_packages = 0
    if vm_analysis_data['fs-type'] not in ['ntfs', 'fat32']:
        c_packages = InfoBlock.text('Configuration', 'Packages')

    logger.info("SSA shows {} users, {} groups and {} packages".format(
        c_users, c_groups, c_packages))

    if vm_analysis_data['fs-type'] not in ['ntfs', 'fat32']:
        soft_assert(c_users != '0', "users: '{}' != '0'".format(c_users))
        soft_assert(c_groups != '0', "groups: '{}' != '0'".format(c_groups))
        soft_assert(c_packages != '0',
                    "packages: '{}' != '0'".format(c_packages))
    else:
        # Make sure windows-specific data is not empty
        c_patches = InfoBlock.text('Security', 'Patches')
        c_applications = InfoBlock.text('Configuration', 'Applications')
        c_win32_services = InfoBlock.text('Configuration', 'Win32 Services')
        c_kernel_drivers = InfoBlock.text('Configuration', 'Kernel Drivers')
        c_fs_drivers = InfoBlock.text('Configuration', 'File System Drivers')

        soft_assert(c_patches != '0', "patches: '{}' != '0'".format(c_patches))
        soft_assert(c_applications != '0',
                    "applications: '{}' != '0'".format(c_applications))
        soft_assert(c_win32_services != '0',
                    "win32 services: '{}' != '0'".format(c_win32_services))
        soft_assert(c_kernel_drivers != '0',
                    "kernel drivers: '{}' != '0'".format(c_kernel_drivers))
        soft_assert(c_fs_drivers != '0',
                    "fs drivers: '{}' != '0'".format(c_fs_drivers))
def list_orphaned_files_per_host(host_name, host_datastore_urls, provider_key, vm_registered_files,
                                 unregistered_files):
    try:
        providers_data = cfme_data.get("management_systems", {})
        hosts = providers_data[provider_key]['hosts']
        hostname = [host['name'] for host in hosts if host_name in host['name']]
        # check if hostname returned is ipaddress
        if not hostname:
            hostname = re.findall(r'[0-9]+(?:\.[0-9]+){3}', host_name)
        connect_kwargs = {
            'username': credentials['host_default']['username'],
            'password': credentials['host_default']['password'],
            'hostname': hostname[0]
        }
        with SSHClient(**connect_kwargs) as ssh_client:
            for datastore_url in host_datastore_urls:
                datastore_path = re.findall(r'([^ds:`/*].*)', str(datastore_url))

                command = 'ls ~/{}'.format(datastore_path[0])
                result = ssh_client.run_command(command)
                files_in_datastore = result.output.splitlines() if result.success else []
                for fil in files_in_datastore:
                    if fil not in vm_registered_files:
                        file_type = 'UNKNOWN'
                        number_of_files = 0
                        command = 'test -d ~/{}/{}; echo $?'.format(datastore_path[0], fil)
                        result = ssh_client.run_command(command)
                        file_extension = re.findall(r'.*\.(\w*)', fil)
                        if file_extension:
                            file_type = file_extension[0]
                            number_of_files = 1
                        if int(result.output.strip()) == 0:
                            command = 'ls ~/{}/{} | wc -l'.format(datastore_path[0], fil)
                            result = ssh_client.run_command(command)
                            number_of_files = result.output.strip()
                            command = 'find ~/{}/{} -name "*.vmx" | wc -l'.format(
                                datastore_path[0], fil)
                            vmx_result = ssh_client.run_command(command)
                            command = 'find ~/{}/{} -name "*.vmtx" | wc -l'.format(
                                datastore_path[0], fil)
                            vmtx_result = ssh_client.run_command(command)
                            command = 'find ~/{}/{} -name "*.vmdk" | wc -l'.format(
                                datastore_path[0], fil)
                            vmdk_result = ssh_client.run_command(command)

                            if int(vmx_result.output.strip()) > 0:
                                file_type = 'VirtualMachine'
                            elif int(vmtx_result.output.strip()) > 0:
                                file_type = 'Template'
                            elif int(vmdk_result.output.strip()) > 0:
                                file_type = 'VMDK'
                                # delete_this = '~/' + datastore_path[0] + fil
                                # command = 'rm -rf {}'.format(delete_this)
                                # result = ssh_client.run_command(command)
                                # logger.info(result.output)

                        file_path = '~/' + datastore_path[0] + fil
                        if file_path not in unregistered_files:
                            unregistered_files.append(file_path)
                            logger.info(
                                '{host}\t\t{path}\t\t{ftype}\t\t{num}'
                                .format(
                                    host=hostname[0],
                                    path=file_path,
                                    ftype=file_type,
                                    num=number_of_files
                                )
                            )

    except Exception:
        logger.exception('Exception listing orphaned files per host')
        return False
def list_orphaned_files_per_host(host_name, host_datastore_urls, provider_key, vm_registered_files,
                                 unregistered_files):
    try:
        providers_data = cfme_data.get("management_systems", {})
        hosts = providers_data[provider_key]['hosts']
        hostname = [host['name'] for host in hosts if host_name in host['name']]
        # check if hostname returned is ipaddress
        if not hostname:
            hostname = re.findall(r'[0-9]+(?:\.[0-9]+){3}', host_name)
        connect_kwargs = {
            'username': credentials['host_default']['username'],
            'password': credentials['host_default']['password'],
            'hostname': hostname[0]
        }
        with SSHClient(**connect_kwargs) as ssh_client:
            for datastore_url in host_datastore_urls:
                datastore_path = re.findall(r'([^ds:`/*].*)', str(datastore_url))

                command = 'ls ~/{}'.format(datastore_path[0])
                result = ssh_client.run_command(command)
                files_in_datastore = result.output.splitlines() if result.success else []
                for fil in files_in_datastore:
                    if fil not in vm_registered_files:
                        file_type = 'UNKNOWN'
                        number_of_files = 0
                        command = 'test -d ~/{}/{}; echo $?'.format(datastore_path[0], fil)
                        result = ssh_client.run_command(command)
                        file_extension = re.findall(r'.*\.(\w*)', fil)
                        if file_extension:
                            file_type = file_extension[0]
                            number_of_files = 1
                        if int(result.output.strip()) == 0:
                            command = 'ls ~/{}/{} | wc -l'.format(datastore_path[0], fil)
                            result = ssh_client.run_command(command)
                            number_of_files = result.output.strip()
                            command = 'find ~/{}/{} -name "*.vmx" | wc -l'.format(
                                datastore_path[0], fil)
                            vmx_result = ssh_client.run_command(command)
                            command = 'find ~/{}/{} -name "*.vmtx" | wc -l'.format(
                                datastore_path[0], fil)
                            vmtx_result = ssh_client.run_command(command)
                            command = 'find ~/{}/{} -name "*.vmdk" | wc -l'.format(
                                datastore_path[0], fil)
                            vmdk_result = ssh_client.run_command(command)

                            if int(vmx_result.output.strip()) > 0:
                                file_type = 'VirtualMachine'
                            elif int(vmtx_result.output.strip()) > 0:
                                file_type = 'Template'
                            elif int(vmdk_result.output.strip()) > 0:
                                file_type = 'VMDK'
                                # delete_this = '~/' + datastore_path[0] + fil
                                # command = 'rm -rf {}'.format(delete_this)
                                # result = ssh_client.run_command(command)
                                # logger.info(result.output)

                        file_path = '~/' + datastore_path[0] + fil
                        if file_path not in unregistered_files:
                            unregistered_files.append(file_path)
                            print('{}\t\t{}\t\t{}\t\t{}'.format(
                                hostname[0], file_path, file_type, number_of_files))

    except Exception as e:
        logger.error(e)
        return False
def test_ssa_template(request, local_setup_provider, provider, soft_assert, vm_analysis_data,
                      appliance):
    """ Tests SSA can be performed on a template

    Metadata:
        test_flag: vm_analysis
    """

    template_name = vm_analysis_data['image']
    template = Template.factory(template_name, provider, template=True)

    # Set credentials to all hosts set for this datastore
    if provider.type in ['virtualcenter', 'rhevm']:
        datastore_name = vm_analysis_data['datastore']
        datastore_collection = appliance.collections.datastores
        test_datastore = datastore_collection.instantiate(name=datastore_name, provider=provider)
        host_list = cfme_data.get('management_systems', {})[provider.key].get('hosts', [])
        host_names = [h.name for h in test_datastore.get_hosts()]
        for host_name in host_names:
            host_collection = appliance.collections.hosts
            test_host = host_collection.instantiate(name=host_name, provider=provider)
            hosts_data = [x for x in host_list if x.name == host_name]
            if len(hosts_data) > 0:
                host_data = hosts_data[0]

                if not test_host.has_valid_credentials:
                    creds = host.get_credentials_from_config(host_data['credentials'])
                    test_host.update(
                        updates={'credentials': creds},
                        validate_credentials=True
                    )

    template.smartstate_scan()
    wait_for(lambda: is_vm_analysis_finished(template_name),
             delay=15, timeout="35m", fail_func=lambda: toolbar.select('Reload'))

    # Check release and quadricon
    quadicon_os_icon = template.find_quadicon().data['os']
    details_os_icon = template.get_detail(
        properties=('Properties', 'Operating System'), icon_href=True)
    logger.info("Icons: {}, {}".format(details_os_icon, quadicon_os_icon))

    # We shouldn't use get_detail anymore - it takes too much time
    c_users = InfoBlock.text('Security', 'Users')
    c_groups = InfoBlock.text('Security', 'Groups')
    c_packages = 0
    if vm_analysis_data['fs-type'] not in ['ntfs', 'fat32']:
        c_packages = InfoBlock.text('Configuration', 'Packages')

    logger.info("SSA shows {} users, {} groups and {} packages".format(
        c_users, c_groups, c_packages))

    if vm_analysis_data['fs-type'] not in ['ntfs', 'fat32']:
        soft_assert(c_users != '0', "users: '{}' != '0'".format(c_users))
        soft_assert(c_groups != '0', "groups: '{}' != '0'".format(c_groups))
        soft_assert(c_packages != '0', "packages: '{}' != '0'".format(c_packages))
    else:
        # Make sure windows-specific data is not empty
        c_patches = InfoBlock.text('Security', 'Patches')
        c_applications = InfoBlock.text('Configuration', 'Applications')
        c_win32_services = InfoBlock.text('Configuration', 'Win32 Services')
        c_kernel_drivers = InfoBlock.text('Configuration', 'Kernel Drivers')
        c_fs_drivers = InfoBlock.text('Configuration', 'File System Drivers')

        soft_assert(c_patches != '0', "patches: '{}' != '0'".format(c_patches))
        soft_assert(c_applications != '0', "applications: '{}' != '0'".format(c_applications))
        soft_assert(c_win32_services != '0', "win32 services: '{}' != '0'".format(c_win32_services))
        soft_assert(c_kernel_drivers != '0', "kernel drivers: '{}' != '0'".format(c_kernel_drivers))
        soft_assert(c_fs_drivers != '0', "fs drivers: '{}' != '0'".format(c_fs_drivers))
Ejemplo n.º 51
0
        required_fields=[
            ('iso_datastore', True),
            ['provisioning', 'host'],
            ['provisioning', 'datastore'],
            ['provisioning', 'iso_template'],
            ['provisioning', 'iso_file'],
            ['provisioning', 'iso_kickstart'],
            ['provisioning', 'iso_root_password'],
            ['provisioning', 'iso_image_type'],
            ['provisioning', 'vlan'],
        ],
        scope="module"),
    pytest.mark.uncollectif(
        lambda provider:
        cfme_data.management_systems.get(provider.key, {}).get('provisioning', {}).get(
            'iso_kickstart') not in cfme_data.get(
            'customization_templates', {}).keys(),
        reason="Uncollected if custom template not present"
    ),
    pytest.mark.tier(2)
]


@pytest.fixture
def iso_cust_template(provider, appliance):
    iso_cust_template = provider.data['provisioning']['iso_kickstart']
    return get_template_from_config(iso_cust_template, create=True, appliance=appliance)


@pytest.fixture
def iso_datastore(provider, appliance):
    return ISODatastore(provider.name, appliance=appliance)
Ejemplo n.º 52
0
# -*- coding: utf-8 -*-
import pytest

from cfme.utils.conf import cfme_data

server_roles_conf = cfme_data.get('server_roles', {'all': [], 'sets': {}})


@pytest.fixture(scope="session")
def all_possible_roles():
    roles = server_roles_conf['all']
    roles.remove('database_synchronization')
    return roles


@pytest.fixture(scope="module", params=server_roles_conf['sets'].keys())
def roles(request, all_possible_roles, appliance):
    result = {}
    for role in all_possible_roles:
        result[role] = role in cfme_data.get("server_roles",
                                             {})["sets"][request.param]
    # Hard-coded protection
    result["user_interface"] = True

    # ansible role introduced in CFME 5.8
    if appliance.version < '5.8' and result.get('embedded_ansible'):
        del result['embedded_ansible']
    return result


@pytest.mark.tier(3)
Ejemplo n.º 53
0
                lines = report.readlines()
                template_missing = filter(lambda x: "MISSING" in x, lines)
                template_passed = filter(lambda x: "PASSED" in x, lines)
                template_failed = filter(lambda x: "FAILED" in x, lines)
                if template_failed:
                    status = "FAILED"

                if template_missing and not (template_passed
                                             or template_failed):
                    report.close()
                    sys.exit(
                        "Template is MISSING....Please verify uploads....")

        print("template_tester_results report generated:{}".format(status))
    else:
        print("No Templates tested on: {}".format(datetime.datetime.now()))


if __name__ == '__main__':
    args = parse_cmd_line()
    trackerbot_api = args.trackerbot_url or cfme_data.get('trackerbot',
                                                          {}).get('api', None)
    if not trackerbot_api:
        sys.exit('No trackerbot URL provided or in cfme_data.yaml')
    if not args.stream or not args.appliance_template:
        sys.exit("stream and appliance_template "
                 "cannot be None, specify the stream as --stream <stream-name>"
                 "and template as --template <template-name>")
    generate_html_report(trackerbot.api(trackerbot_api), args.stream,
                         args.output, args.appliance_template)
Ejemplo n.º 54
0
    apps[0].appliance_console.run_commands(command_set0)
    apps[0].wait_for_evm_service()
    apps[0].wait_for_web_ui()
    print("VMDB appliance provisioned and configured {}".format(ip0))
    command_set1 = ('ap', '', opt, '2', ip0, '', pwd, '', '3') + port + ('', '',
        pwd, TimedCommand(pwd, 360), '')
    apps[1].appliance_console.run_commands(command_set1)
    apps[1].wait_for_evm_service()
    apps[1].wait_for_web_ui()
    print("Non-VMDB appliance provisioned and configured {}".format(ip1))
    print("Appliance pool lease time is {}".format(lease))


@main.command('ha', help='Sets up high availability environment')
@click.option('--cfme-version', required=True)
@click.option('--provider', default=cfme_data.get('basic_info', {}).get('ha_provider'),
    help='Specify sprout provider, must not be RHOS')
@click.option('--lease', default='3h', help='set pool lease time, example: 1d4h30m')
@click.option('--desc', default='HA configuration', help='Set description of the pool')
def setup_ha_env(cfme_version, provider, lease, desc):
    lease_time = tot_time(lease)
    """multi appliance setup consisting of dedicated primary and standy databases with a single
    UI appliance."""
    print("Provisioning and configuring HA environment")
    apps, request_id = provision_appliances(count=3, cfme_version=cfme_version, provider=provider,
        lease_time=lease_time)
    sprout_client = SproutClient.from_config()
    sprout_client.set_pool_description(request_id, desc)
    ip0 = apps[0].hostname
    ip1 = apps[1].hostname
    ip2 = apps[2].hostname
Ejemplo n.º 55
0
 def upstream_version(self):
     if self.default_product is not None:
         return self.default_product.latest_version
     else:
         return Version(
             cfme_data.get("bugzilla", {}).get("upstream_version", "9.9"))