예제 #1
0
def setup_servers():
    logging.info("Setup servers...")
    # Blockade up
    parser = block.setup_parser()
    opts = parser.parse_args(args=["up"])
    block.cmd_up(opts)
    # Ceph start
    subp.call(["./ceph_start.sh"])
예제 #2
0
def setup_servers():
    logging.info("Setup servers...")
    # Blockade up
    parser = block.setup_parser()
    opts = parser.parse_args(args=["up"])
    block.cmd_up(opts)
    # Zk start
    subp.call(["./zk_start.sh"])
예제 #3
0
def get_servers_addrs():
    # Get server addresses through Blockade
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    config = block.load_config(opts)
    b = block.get_blockade(config)
    containers = b.status()
    
    global servers
    for c in containers:
        servers.append((c.ip_address, 5000))
예제 #4
0
def get_servers_addrs():
    # Get server addresses through Blockade
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    config = block.load_config(opts)
    b = block.get_blockade(config)
    containers = b.status()

    global servers
    for c in containers:
        servers.append((c.ip_address, 5000))
예제 #5
0
def get_servers_addrs():
    # Get server addresses through Blockade
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    config = block.load_config(opts)
    b = block.get_blockade(config)
    containers = b.status()

    global servers
    global num_servers
    for c in containers:
        servers += c.ip_address
        servers += ":2181,"
        num_servers += 1
    servers.strip(",")
예제 #6
0
def write():
    p = ThreadPool(num_write)

    # partition one random server from the others
    partition(random.choice(["ceph1","ceph2","ceph3"]))
    
    # print partition status
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    block.cmd_status(opts)
    
    for i in p.map(_issue_writes, range(0,num_clients)):
        pass
   
    #time.sleep(2)
    p.close()
    p.join()
    join_partition()
예제 #7
0
def write():
    p = ThreadPool(num_write)

    # partition one random server from the others
    partition(random.choice(["ceph1", "ceph2", "ceph3"]))

    # print partition status
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    block.cmd_status(opts)

    for i in p.map(_issue_writes, range(0, num_clients)):
        pass

    #time.sleep(2)
    p.close()
    p.join()
    join_partition()
예제 #8
0
def write():
    p = ThreadPool(num_write)

    # partition one random server from the others
    partition("zk" + str(random.randint(1, num_servers)) + "," + "zk" +
              str(random.randint(1, num_servers)))

    # print partition status
    parser = block.setup_parser()
    opts = parser.parse_args(args=["status"])
    block.cmd_status(opts)

    for i in p.map(_issue_writes, clients):
        pass

    #time.sleep(2)
    p.close()
    p.join()
    join_partition()
예제 #9
0
 def test_parser(self):
     # just make sure we don't have any typos for now
     cli.setup_parser()
예제 #10
0
def shutdown():
    # Blocakde destroy
    parser = block.setup_parser()
    opts = parser.parse_args(args=["destroy"])
    block.cmd_destroy(opts)
예제 #11
0
def join_partition():
    # Blockade join
    logging.info("Joining partitions")
    parser = block.setup_parser()
    opts = parser.parse_args(args=["join"])
    block.cmd_join(opts)
예제 #12
0
def partition(srv):
    # Blockade partition
    logging.info("Partitioning " + srv)
    parser = block.setup_parser()
    opts = parser.parse_args(args=["partition", srv])
    block.cmd_partition(opts)
예제 #13
0
파일: test_cli.py 프로젝트: DXist/blockade
 def test_parser(self):
     # just make sure we don't have any typos for now
     cli.setup_parser()
예제 #14
0
def join_partition():
    # Blockade join
    logging.info("Joining partitions")
    parser = block.setup_parser()
    opts = parser.parse_args(args=["join"])
    block.cmd_join(opts)
예제 #15
0
def partition(srv):
    # Blockade partition
    logging.info("Partitioning " + srv)
    parser = block.setup_parser()
    opts = parser.parse_args(args=["partition", srv])
    block.cmd_partition(opts)
예제 #16
0
def shutdown():
    # Blocakde destroy
    parser = block.setup_parser()
    opts = parser.parse_args(args=["destroy"])
    block.cmd_destroy(opts)