Exemple #1
0
def destroy(name):
    """Destroy an existing OpenStack deployment."""
    deployment = data.load_deployment(name)
    data.load_config(name)
    logger.info(deployment)
    deployment.destroy()
    database.remove_key(deployment.name)
Exemple #2
0
def retrofit(name='autotest', retro_branch='dev', ovs_bridge='br-eth1',
             x_bridge='lxb-mgmt', iface='eth0', del_port=None):
    """Retrofit a deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    logger.info(deployment)
    deployment.retrofit(retro_branch, ovs_bridge, x_bridge, iface, del_port)
Exemple #3
0
def add_nodes(name, compute_nodes=0, controller_nodes=0, cinder_nodes=0,
              request=None):
    """Add a node (or nodes) to an existing deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    node_request = request or list([['compute']] * compute_nodes +
                                   [['controller']] * controller_nodes +
                                   [['cinder']] * cinder_nodes)
    deployment.add_nodes(node_request)
    database.store(deployment)
Exemple #4
0
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..."))
Exemple #5
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..."))
Exemple #6
0
def cloudcafe(cmd, name, network=None):
    """Run CloudCafe test suite against a deployment."""
    deployment = data.load_deployment(name)
    data.load_config(name)
    CloudCafe(deployment).config(cmd, network_name=network)
Exemple #7
0
def explore(name):
    """Explore a deployment in IPython."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    from IPython import embed; embed()
Exemple #8
0
def show(name):
    """Show details about an OpenStack deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    return deployment
Exemple #9
0
def horizon(name):
    """Open Horizon in a browser tab."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.horizon()
Exemple #10
0
def tmux(name):
    """Load OpenStack nodes into a new tmux session."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.tmux()
Exemple #11
0
def openrc(name):
    """Export OpenStack credentials into shell environment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.openrc()
Exemple #12
0
def artifact(name):
    """Artifact a deployment (configs/running services)."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.artifact()
Exemple #13
0
def upgrade(name, upgrade_branch='v4.1.3rc'):
    """Upgrade a current deployment to the new branch / tag."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    logger.info(deployment)
    deployment.upgrade(upgrade_branch)
Exemple #14
0
def update(name):
    """Runs package updates on all nodes in a deployment, in addition to
    running chef-client (or the equivalent) on all non-orchestrator nodes."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.update()
Exemple #15
0
def load(name):
    """Helper function for loading a deployment object in iPython."""
    return data.load_deployment(name)
Exemple #16
0
def explore(name):
    """Explore a deployment in IPython."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    IPython.embed()