Ejemplo n.º 1
0
def test(name="build", config=None, log=None, log_level="INFO",
         secret_path=None):
    """
    Tests an openstack deployment
    """
    _set_log(log, log_level)
    deployment = _load(name, config, secret_path)
    branch = TempestQuantum.tempest_branch(deployment.branch)
    if "grizzly" in branch:
        tempest = TempestQuantum(deployment)
    else:
        tempest = TempestNeutron(deployment)
    tempest.test()
Ejemplo n.º 2
0
def test(name="autotest", config="pubcloud-neutron.yaml", log=None,
         log_level="DEBUG", tempest=False, ha=False, secret_path=None,
         deployment=None, iterations=1, progress=False):
    """
    Test an OpenStack deployment
    """
    if progress:
        log_level = "ERROR"
    util.set_log_level(log_level)
    if not deployment:
        deployment = _load(name, config, secret_path)
    if not tempest and not ha:
        tempest = True
        ha = True
    if not deployment.feature_in("highavailability"):
        ha = False
    if ha:
        ha = HATest(deployment, progress)
    if tempest:
        branch = TempestQuantum.tempest_branch(deployment.branch)
        if "grizzly" in branch:
            tempest = TempestQuantum(deployment)
        else:
            tempest = TempestNeutron(deployment)

    env = deployment.environment.name
    local = "./results/{0}/".format(env)
    controllers = deployment.search_role('controller')
    for controller in controllers:
        ip, user, password = controller.get_creds()
        remote = "{0}@{1}:~/*.xml".format(user, ip)
        getFile(ip, user, password, remote, local)

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

        #Prepare directory for xml files to be SCPed over
        subprocess.call(['mkdir', '-p', '{0}'.format(local)])

        if ha:
            util.logger.info(Color.cyan('Running High Availability test!'))
            ha.test(iterations)
        if tempest:
            util.logger.info(Color.cyan('Running Tempest test!'))
            tempest.test()

    util.logger.info(Color.cyan("Tests have been completed with {0} "
                                "iterations".format(iterations)))
Ejemplo n.º 3
0
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..."))