Ejemplo n.º 1
0
def run_tests(storage_type, hosts, io_devs=None):
    for threads, bsz, sz in tests:
        if 1 == threads:
            fname = "/tmp/tt.bin"
        else:
            fname = "/tmp/tt_%s.bin"

        if "host" == storage_type:
            loc_sensor = False
        else:
            loc_sensor = True

        set_hosts([hosts], force=True)
        results = {}
        data = fabric.api.execute(
            iozone,
            fname,
            storage_type,
            size=sz,
            bsize=bsz,
            threads=threads,
            local_sensor="io,iodev",
            remote_sensor="io,iodev",
            results=results,
        )

        fabric.network.disconnect_all()
        data = results.values()[0]

        data["storage_type"] = storage_type
        data["image"] = fname

        yield data
Ejemplo n.º 2
0
import os
import re
import mock
import uuid
import warnings

from oktest import ok

from fabric.contrib.files import exists

from fablib import wget, core

from config import host

core.set_hosts([host])

def test_no_cache():
    url = "http://docs.python.org/library/fcntl.html"
    fname = url.split('/')[-1]
    
    rdir = "/tmp/{0!s}/{0!s}/{0!s}".format(
        uuid.uuid1(), uuid.uuid1(), uuid.uuid1())
    
    ok(exists(rdir)) == False
    core.make_remote_dir(rdir)
    ok(exists(rdir)) == True
    
    ldir = "/tmp/{0!s}".format(
        uuid.uuid1(), uuid.uuid1(), uuid.uuid1())
    
    ok(os.path.isdir(ldir)) == False
Ejemplo n.º 3
0
from fabric.api import *
from fabric.context_managers import *

from fablib.core import install, set_hosts
from fablib.fab_os import set_apt_proxy, allow_all_sudo_no_passwd,\
                            set_service_run_at
from fablib.recipes import install_monitoring
from fablib.recipes.nosql import riak, cassandra, mongodb
from fablib.recipes.general import install_supervisord
from fablib.recipes.java import install_deb_java

from vm_fab import vm2hosts, update_network


set_hosts(vm2hosts('ubuntu', 'ubuntu'))

def crun(cmd):
    run(cmd.replace('+', ' '))

def csudo(cmd):
    sudo(cmd.replace('+', ' '))
    
def basic():
    set_apt_proxy('192.168.122.1', )
    install('gcc')
    install('python-pip')
    #install_supervisord()
    allow_all_sudo_no_passwd()
    
def sensor():
    install_monitoring.install_graphite_sensor('192.168.122.1:2003')
Ejemplo n.º 4
0
fabric recipe to install openstack
"""

import os

from fabric.api import *
from fabric.context_managers import *
from fabric.contrib.files import append

from fablib.core import install, \
                        put_rf, set_hosts, replace_in_file,\
                        get_tfile, upstart_restart

from fablib.recipes.sqldb.postgres import psql
    
set_hosts(['ubuntu:ubuntu@nova'])

nova_config = """
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/var/lock/nova
--state_path=/var/lib/nova
--verbose
--s3_host={0}
--rabbit_host={0}
--cc_host={0}
--ec2_url=http://{0}:8773/services/Cloud
--nova_url=http://{0}:8774/v1.1/
--fixed_range={1}