Пример #1
0
def delete_installation_entities():
    """Fixture to ensure that CSE entities do not exist in vCD.

    This fixture executes automatically for this module's setup and teardown.

    Setup tasks:
    - Delete source ova files, vapp templates, temp vapps, catalogs
    - Unregister CSE from vCD

    Teardown tasks (only if config key 'teardown_installation'=True):
    - Delete source ova files, vapp templates, temp vapps, catalogs
    - Unregister CSE from vCD
    """
    config = testutils.yaml_to_dict(env.BASE_CONFIG_FILEPATH)
    for template in config['broker']['templates']:
        env.delete_catalog_item(template['source_ova_name'])
        env.delete_catalog_item(template['catalog_item'])
        env.delete_vapp(template['temp_vapp'])
    env.delete_catalog()
    env.unregister_cse()

    yield

    if env.TEARDOWN_INSTALLATION:
        for template in config['broker']['templates']:
            env.delete_catalog_item(template['source_ova_name'])
            env.delete_catalog_item(template['catalog_item'])
            env.delete_vapp(template['temp_vapp'])
        env.delete_catalog()
        env.unregister_cse()
Пример #2
0
def unregister_cse_before_test():
    """Fixture to ensure that CSE is not registered to vCD.

    Usage: add the parameter 'unregister_cse' to the test function.

    Note: we don't do teardown unregister_cse(), because the user may want
    to preserve the state of vCD after tests run.
    """
    env.unregister_cse()
Пример #3
0
def _remove_cse_artifacts():
    for template in env.TEMPLATE_DEFINITIONS:
        env.delete_catalog_item(template['source_ova_name'])
        catalog_item_name = ltm.get_revisioned_template_name(
            template['name'], template['revision'])
        env.delete_catalog_item(catalog_item_name)
        temp_vapp_name = testutils.get_temp_vapp_name(template['name'])
        env.delete_vapp(temp_vapp_name)
    env.delete_catalog()
    env.unregister_cse()
Пример #4
0
def delete_installation_entities():
    """Fixture to ensure that CSE entities do not exist in vCD.

    This fixture executes automatically for test module setup and teardown
    If 'developer_mode_aware' is enabled, then the teardown deletion will not
    occur.
    """
    config = testutils.yaml_to_dict(env.BASE_CONFIG_FILEPATH)
    for template in config['broker']['templates']:
        env.delete_catalog_item(template['source_ova_name'])
        env.delete_catalog_item(template['catalog_item'])
        env.delete_vapp(template['temp_vapp'])
    env.delete_catalog()
    env.unregister_cse()

    yield

    if not env.DEV_MODE:
        for template in config['broker']['templates']:
            env.delete_catalog_item(template['source_ova_name'])
            env.delete_catalog_item(template['catalog_item'])
            env.delete_vapp(template['temp_vapp'])
        env.delete_catalog()
        env.unregister_cse()
Пример #5
0
def unregister_cse():
    """Fixture to ensure that CSE is not registered to vCD.

    Usage: add the parameter 'unregister_cse' to the test function.
    """
    env.unregister_cse()