Ejemplo n.º 1
0
def env(request, fuel):
    """Environment instance"""
    env = fuel.get_last_created_cluster()
    if getattr(request.node, 'reverted',
               getattr(request.session, 'reverted', True)):
        env.wait_for_ostf_pass()
        os_conn = get_os_conn(env)
        wait(os_conn.is_nova_ready,
             timeout_seconds=60 * 5,
             expected_exceptions=Exception,
             waiting_for="OpenStack nova computes is ready")
    return env
Ejemplo n.º 2
0
def is_any_compute_suitable_for_max_flavor(env):
    attrs_to_check = {
        "vcpus": 8,
        "free_disk_gb": 160,
        "free_ram_mb": 16000,
    }

    def check_hypervisor_fit(hv):
        hv_result = all(
            [getattr(hv, attr) >= value
             for attr, value in attrs_to_check.items()])
        return hv_result

    os_connection = get_os_conn(env)
    result = any(
        check_hypervisor_fit(hv)
        for hv in os_connection.nova.hypervisors.list())
    return result
Ejemplo n.º 3
0
def is_any_compute_suitable_for_max_flavor(env):
    attrs_to_check = {
        "vcpus": 8,
        "free_disk_gb": 160,
        "free_ram_mb": 16000,
    }

    def check_hypervisor_fit(hv):
        hv_result = all([
            getattr(hv, attr) >= value
            for attr, value in attrs_to_check.items()
        ])
        return hv_result

    os_connection = get_os_conn(env)
    result = any(
        check_hypervisor_fit(hv)
        for hv in os_connection.nova.hypervisors.list())
    return result
Ejemplo n.º 4
0
def os_conn(env):
    """Openstack common actions"""
    return get_os_conn(env)
Ejemplo n.º 5
0
def os_conn_for_unittests(request, fuel_master_ip):
    fuel_client = get_fuel_client(fuel_master_ip)
    environment = fuel_client.get_last_created_cluster()
    request.cls.env = environment
    request.cls.os_conn = get_os_conn(environment)
Ejemplo n.º 6
0
 def wait_keystone_alive():
     common.wait(lambda: common.get_os_conn(env), timeout_seconds=60 * 3,
                 waiting_for='keystone available',
                 expected_exceptions=Exception)