コード例 #1
0
ファイル: executable.py プロジェクト: jacobwagner/monster
def ha(name, iterations=1, progress=False):
    """Test an OpenStack deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    test_object = HATest(deployment, progress)
    local = "./results/{0}/".format(deployment.name)
    run_cmd("mkdir -p {}".format(local))

    for controller in deployment.controllers:
        ip, user, password = (controller.ipaddress, controller.user,
                              controller.password)
        remote = "{0}@{1}:~/*.xml".format(user, ip)
        get_file(ip, user, password, remote, local)

    for i in xrange(iterations):
        logger.info(Color.cyan('HA: running iteration {0} of {1}!'
                         .format(i + 1, iterations)))
        test_object.test(iterations)

    logger.info(Color.cyan("HA tests completed..."))
コード例 #2
0
ファイル: executable.py プロジェクト: jacobwagner/monster
def tempest(name, iterations=1):
    """Test an OpenStack deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    branch = TempestQuantum.tempest_branch(deployment.branch)
    if "grizzly" in branch:
        test_object = TempestQuantum(deployment)
    else:
        test_object = TempestNeutron(deployment)
    local = "./results/{}/".format(deployment.name)
    run_cmd("mkdir -p {}".format(local))

    for controller in deployment.controllers:
        ip, user, password = (controller.ipaddress, controller.user,
                              controller.password)
        remote = "{0}@{1}:~/*.xml".format(user, ip)
        get_file(ip, user, password, remote, local)

    for i in range(iterations):
        logger.info(Color.cyan('Tempest: running iteration {0} of {1}!'
                         .format(i + 1, iterations)))
        test_object.test()

    logger.info(Color.cyan("Tempest tests completed..."))
コード例 #3
0
ファイル: cloudcafe.py プロジェクト: jcourtois/monster
    def config(self, cmd, network_name="ENV01-FLAT", files=None):
        endpoint = self.get_endpoint()
        admin_user, admin_password, admin_tenant = self.get_admin_user()
        admin_tenant_id, admin_user_id, admin_project_id = self.get_admin_ids(
            admin_user, admin_password, admin_tenant)
        second_user, second_password, second_tenant = self.get_non_admin_user()
        primary_image_id, secondary_image_id = self.get_image_ids()
        if self.deployment.has_feature("neutron"):
            network_id = self.get_network_id(network_name)
            networks = "{'%s':{'v4': True, 'v6': False}}" % network_name
        else:
            # How connectivity works in cloudcafe for novanet needs work
            # May not be possible atm due to floating ips
            network_name = "public"
            network_id = "0000" * 5
            networks = "{'%s':{'v4': True, 'v6': False}}" % network_name

        endpoint_versioned = "{0}/v2.0".format(endpoint)
        admin_endpoint_versioned = endpoint_versioned.replace("5000", "35357")

        args = {
            "compute_admin_user": {
                "username": admin_user,
                "password": admin_password,
                "tenant_name": admin_tenant
            },
            "user_auth_config": {
                "endpoint": endpoint
            },
            "coumpute_admin_auth_config": {
                "endpoint": endpoint
            },
            "user": {
                "username": admin_user,
                "password": admin_password,
                "tenant_name": admin_tenant,
                "tenant_id": admin_tenant_id,
                "user_id": admin_user_id,
                "project_id": admin_project_id
            },
            "compute_secondary_user": {
                "username": second_user,
                "password": second_password,
                "tenant_name": second_tenant
            },
            "images": {
                "primary_image": primary_image_id,
                "secondary_image": secondary_image_id
            },
            "servers": {
                "network_for_ssh": network_name,
                "expected_networks": networks,
                "default_network": network_id
            },
            "identity_v2_user": {
                "username": second_user,
                "password": second_password,
                "tenant_name": second_tenant,
                "authentication_endpoint": endpoint_versioned
            },
            "identity_v2_admin": {
                "username": admin_user,
                "password": admin_password,
                "tenant_name": admin_tenant,
                "authentication_endpoint": admin_endpoint_versioned
            }
        }

        for section, values in args.items():
            self.export_variables(section, values)

        run_cmd(cmd)