예제 #1
0
def template_export(api):
    engine = api.system_service()

    template_cirros = test_utils.get_template_service(engine, TEMPLATE_CIRROS)
    if template_cirros is None:
        raise SkipTest('{0}: template {1} is missing'.format(
            template_export.__name__,
            TEMPLATE_CIRROS
            )
        )

    storage_domain = engine.storage_domains_service().list(search='name={}'.format(SD_TEMPLATES_NAME))[0]
    with test_utils.TestEvent(engine, 1164):
        # IMPORTEXPORT_STARTING_EXPORT_TEMPLATE event
        template_cirros.export(
            storage_domain=types.StorageDomain(
                id=storage_domain.id,
            ),
        )

    with test_utils.TestEvent(engine, 1156):
        # IMPORTEXPORT_EXPORT_TEMPLATE event
        testlib.assert_true_within_long(
            lambda:
            template_cirros.get().status == types.TemplateStatus.OK,
        )
def template_export(api):
    engine = api.system_service()

    template_cirros = test_utils.get_template_service(engine, TEMPLATE_CIRROS)
    if template_cirros is None:
        raise SkipTest('{0}: template {1} is missing'.format(
            template_export.__name__, TEMPLATE_CIRROS))

    storage_domain = engine.storage_domains_service().list(
        search='name={}'.format(SD_TEMPLATES_NAME))[0]
    template_cirros.export(storage_domain=types.StorageDomain(
        id=storage_domain.id, ), )
    testlib.assert_true_within_long(
        lambda: template_cirros.get().status == types.TemplateStatus.OK, )
예제 #3
0
def template_update(api):
    template_cirros = test_utils.get_template_service(
        api.system_service(),
        TEMPLATE_CIRROS,
    )

    if template_cirros is None:
        raise SkipTest('{0}: template {1} is missing'.format(
            template_update.__name__,
            TEMPLATE_CIRROS,
        ))
    new_comment = "comment by ovirt-system-tests"
    template_cirros.update(template=types.Template(comment=new_comment))
    testlib.assert_true_within_short(
        lambda: template_cirros.get().status == types.TemplateStatus.OK)
    nt.assert_true(template_cirros.get().comment == new_comment)
예제 #4
0
def test_template_export(api_v4):
    engine = api_v4.system_service()

    template_guest = test_utils.get_template_service(engine, TEMPLATE_GUEST)
    if template_guest is None:
        pytest.skip('{0}: template {1} is missing'.format(
            template_export.__name__, TEMPLATE_GUEST))

    storage_domain = engine.storage_domains_service().list(
        search='name={}'.format(SD_TEMPLATES_NAME))[0]
    with test_utils.TestEvent(engine, 1164):
        # IMPORTEXPORT_STARTING_EXPORT_TEMPLATE event
        template_guest.export(storage_domain=types.StorageDomain(
            id=storage_domain.id, ), )

    with test_utils.TestEvent(engine, 1156):
        # IMPORTEXPORT_EXPORT_TEMPLATE event
        testlib.assert_true_within_long(
            lambda: template_guest.get().status == types.TemplateStatus.OK, )
예제 #5
0
def test_template_export(engine_api, cirros_image_glance_template_name):
    engine = engine_api.system_service()

    template_guest = test_utils.get_template_service(
        engine, cirros_image_glance_template_name)
    if template_guest is None:
        pytest.skip('{0}: template {1} is missing'.format(
            template_export.__name__, cirros_image_glance_template_name))

    storage_domain = engine.storage_domains_service().list(
        search='name={}'.format(SD_TEMPLATES_NAME))[0]
    with engine_utils.wait_for_event(engine, 1164):
        # IMPORTEXPORT_STARTING_EXPORT_TEMPLATE event
        template_guest.export(storage_domain=types.StorageDomain(
            id=storage_domain.id, ), )

    with engine_utils.wait_for_event(engine, 1156):
        # IMPORTEXPORT_EXPORT_TEMPLATE event
        assertions.assert_true_within_long(
            lambda: template_guest.get().status == types.TemplateStatus.OK, )
예제 #6
0
def template_update(api):
    template_cirros = test_utils.get_template_service(api.system_service(), TEMPLATE_CIRROS)

    if template_cirros is None:
        raise SkipTest('{0}: template {1} is missing'.format(
            template_update.__name__,
            TEMPLATE_CIRROS
        )
    )
    new_comment = "comment by ovirt-system-tests"
    template_cirros.update(
        template = types.Template(
            comment=new_comment
        )
    )
    testlib.assert_true_within_short(
        lambda:
        template_cirros.get().status == types.TemplateStatus.OK
    )
    nt.assert_true(
        template_cirros.get().comment == new_comment
    )