Esempio n. 1
0
def then_the_node_is_deleted(step):

    Assertions.assert_response_ok(world.response)

    assert_equals(
        Fabutils.execute_delete_node(group=world.group_name,
                                     node_name=world.node_name), False)
Esempio n. 2
0
def given_a_generated_node_group1_in_the_tenant_group2(step, node_name,
                                                       group_name):

    world.node_name = node_name
    world.group_name = group_name

    for examples in step.hashes:
        print examples[ACTION]
        if examples[ACTION] == INSTALL:
            res = api_utils.install(group=group_name,
                                    node_name=node_name,
                                    software_name=examples[SOFTWARE_NAME],
                                    version=examples[VERSION])

            Assertions.assert_response_ok(response=res)
        elif examples[ACTION] == UNINSTALL:
            res = api_utils.uninstall(group=group_name,
                                      node_name=node_name,
                                      software_name=examples[SOFTWARE_NAME],
                                      version=examples[VERSION])

            Assertions.assert_install_response(response=res,
                                               node_name=node_name,
                                               group_name=group_name)
        else:
            assert False, 'Not valid action'

    res = api_utils.generate(node_name=node_name)

    Assertions.assert_response_ok(response=res)
Esempio n. 3
0
def the_node_is_not_deleted_from_the_system(step):

    Assertions.assert_response_ok(world.response)

    assert_equals(
        Fabutils.execute_delete_node(group=world.group_name,
                                     node_name=world.node_name), True)
    assert_equals(Fabutils.execute_import_deleted(group=world.group_name),
                  True)
Esempio n. 4
0
def given_a_downloaded_module_from_repository(step):

    for examples in step.hashes:
        url = examples[URL]
        module_name = examples[MODULE_NAME]
        repository = examples[REPOSITORY]
        response = api_utils.download_module(software_name=module_name, repository=repository, url=url)
        Assertions.assert_response_ok(response)
        assert_true(Fabutils.execute_assert_download(module_name))
        world.software_downloaded.append(module_name)
Esempio n. 5
0
def given_a_generated_node_group1_in_the_tenant_group2(step, node_name, group_name):

    world.node_name = node_name
    world.group_name = group_name

    for examples in step.hashes:
        print examples[ACTION]
        if examples[ACTION] == INSTALL:
            res = api_utils.install(group=group_name, node_name=node_name, software_name=examples[SOFTWARE_NAME],
                                    version=examples[VERSION])

            Assertions.assert_response_ok(response=res)
        elif examples[ACTION] == UNINSTALL:
            res = api_utils.uninstall(group=group_name, node_name=node_name, software_name=examples[SOFTWARE_NAME],
                                      version=examples[VERSION])

            Assertions.assert_install_response(response=res, node_name=node_name, group_name=group_name)
        else:
            assert False, 'Not valid action'

    res = api_utils.generate(node_name=node_name)

    Assertions.assert_response_ok(response=res)
Esempio n. 6
0
def the_node_is_not_deleted_from_the_system(step):

    Assertions.assert_response_ok(world.response)

    assert_equals(Fabutils.execute_delete_node(group=world.group_name, node_name=world.node_name), True)
    assert_equals(Fabutils.execute_import_deleted(group=world.group_name), True)
Esempio n. 7
0
def then_the_node_is_deleted(step):

    Assertions.assert_response_ok(world.response)

    assert_equals(Fabutils.execute_delete_node(group=world.group_name, node_name=world.node_name), False)
Esempio n. 8
0
def then_the_module_is_downloaded(step):

    Assertions.assert_response_ok(world.response)
    assert_true(Fabutils.execute_assert_download(world.software_name))
Esempio n. 9
0
def then_the_module_is_downloaded(step):

    Assertions.assert_response_ok(world.response)
    assert_true(Fabutils.execute_assert_download(world.software_name))
Esempio n. 10
0
def then_the_module_is_not_deleted_from_the_system(step):

    Assertions.assert_response_ok(world.response)
    assert_false(Fabutils.execute_assert_download(world.module_name))
    for module in world.software_downloaded:
        assert_true(Fabutils.execute_assert_download(module))
Esempio n. 11
0
def then_the_module_is_deleted_from_the_system(step):
    Assertions.assert_response_ok(world.response)
    assert_false(Fabutils.execute_assert_download(world.module_name))