Exemplo n.º 1
0
 def __init__(self):
     FCG.__init__(self, CONF.fcg_name, root_helper=rootwrap.root_helper())
Exemplo n.º 2
0
 def __init__(self):
     FCG.__init__(self, CONF.fcg_name, root_helper=rootwrap.root_helper())
Exemplo n.º 3
0
sys.path.append('..')

from libfcg.fcg import FCG


def run_time(func, *args, **kwargs):
    t0 = time.time()
    func(*args, **kwargs)
    t1 = time.time()
    print '%d s, %s' % (t1 - t0, func)


if __name__ == '__main__':
    hdd1 = '/dev/loop0'
    hdd2 = '/dev/loop1'
    hdd3 = '/dev/loop2'
    ssd = '/dev/loop3'
    fcg = FCG('tfcg')
    run_time(fcg.create_group, [ssd], '4k', 'back')
    run_time(fcg.add_disk, hdd1)
    run_time(fcg.add_disk, hdd2)
    run_time(fcg.add_disk, hdd3)
    run_time(fcg.rm_disk, hdd1)
    run_time(fcg.rm_disk, hdd3)
    run_time(fcg.add_disk, hdd3)
    run_time(fcg.add_disk, hdd1)
    run_time(fcg.rm_disk, hdd1)
    run_time(fcg.rm_disk, hdd2)
    run_time(fcg.rm_disk, hdd3)
    run_time(fcg.delete_group)
Exemplo n.º 4
0
 def __init__(self):
     FCG.__init__(self, CONF.fcg_name)
Exemplo n.º 5
0
from libfcg.fcg import FCG


def run_time(func, *args, **kwargs):
    t0 = time.time()
    func(*args, **kwargs)
    t1 = time.time()
    print '%d s, %s' % (t1 - t0, func)


if __name__ == '__main__':
    hdd1 = '/dev/loop0'
    hdd2 = '/dev/loop1'
    hdd3 = '/dev/loop2'
    ssd = '/dev/loop3'
    fcg = FCG('tfcg', 'sudo')
    run_time(fcg.create_group, [ssd], '4k', 'back')
    run_time(fcg.add_disk, hdd1)
    run_time(fcg.add_disk, hdd1)
    run_time(fcg.add_disk, hdd2)
    run_time(fcg.add_disk, hdd2)
    run_time(fcg.add_disk, hdd2)
    run_time(fcg.add_disk, hdd2)
    run_time(fcg.add_disk, hdd3)
    run_time(fcg.rm_disk, hdd1)
    run_time(fcg.rm_disk, hdd3)
    run_time(fcg.add_disk, hdd3)
    run_time(fcg.add_disk, hdd1)
    run_time(fcg.rm_disk, hdd1)
    run_time(fcg.rm_disk, hdd2)
    run_time(fcg.rm_disk, hdd3)