Example #1
0
def main(args):
    # This test assumes for now that the nodes are running at the given ports.
    # This is done by travis.sh. Please check that file and the corresponding
    # yml files for each dynomite instance there to get an idea of the topology.
    r = RedisNode(host="localhost", ip="127.0.0.1", port=1212)
    d1 = DynoNode(host="127.0.0.1", ip="127.0.0.1", stats_port=22221,
                  data_store_port=22121)
    d2 = DynoNode(host="127.0.0.2", ip="127.0.0.2", stats_port=22222,
                  data_store_port=22122)
    d3 = DynoNode(host="127.0.0.3", ip="127.0.0.3", stats_port=22223,
                  data_store_port=22123)
    d4 = DynoNode(host="127.0.0.4", ip="127.0.0.4", stats_port=22224,
                  data_store_port=22124)
    d5 = DynoNode(host="127.0.0.5", ip="127.0.0.5", stats_port=22225,
                  data_store_port=22125)
    dyno_nodes = [d1,d2,d3,d4,d5]
    cluster = DynoCluster(dyno_nodes)
    r_c = r.get_connection()
    d_c = cluster.get_connection()
    c = dual_run(r_c, d_c, args.debug)
    try:
        run_key_value_tests(c)
        run_key_value_tests(c, max_payload=16384*1024)
        run_hash_tests(c, max_keys=10, max_fields=100)
        print "All test ran fine"
    except ResultMismatchError as r:
        print r;
        return 1
    return 0
Example #2
0
def launch_dynomite(nodes):
    seeds_list = [n.seed_string for n in nodes]
    launched_nodes = [DynoNode(n.ip) for n in nodes]
    with ExitStack() as stack:
        launched_nodes = [
            stack.enter_context(n.launch(seeds_list)) for n in nodes
        ]

        yield DynoCluster(launched_nodes)
def main(args):
    # This test assumes for now that the nodes are running at the given ports.
    # This is done by travis.sh. Please check that file and the corresponding
    # yml files for each dynomite instance there to get an idea of the topology.
    r = RedisNode(ip="127.0.1.1", port=1212)
    d1 = DynoNode(ip="127.0.1.2", data_store_port=22121)
    d2 = DynoNode(ip="127.0.1.3", data_store_port=22122)
    d3 = DynoNode(ip="127.0.1.4", data_store_port=22123)
    d4 = DynoNode(ip="127.0.1.5", data_store_port=22124)
    d5 = DynoNode(ip="127.0.1.6", data_store_port=22125)
    dyno_nodes = [d1, d2, d3, d4, d5]
    cluster = DynoCluster(dyno_nodes)
    try:
        comparison_test(r, cluster, args.debug)
    except ResultMismatchError as r:
        print(r)
        return 1
    return 0
    def launch(self, seeds_list):
        config_filename = self.write_config(seeds_list)

        with launch_redis(self.ip):
            logfile = 'logs/dynomite_{}.log'.format(self.ip)
            dynomite_future = dynomite['-o', logfile, '-c', config_filename,
                '-v6'] & BG(-9)

            try:
                yield DynoNode(self.ip)
            finally:
                dynomite_future.proc.kill()
                dynomite_future.wait()
Example #5
0
    def launch(self, seeds_list):
        config_filename = self.write_config(seeds_list)

        with launch_redis(self.ip):
            logfile = 'logs/dynomite_{}.log'.format(self.ip)
            # Add '-v', '11' for maximum verbosity in logs
            # Dynomite exits with status 1 on SIGINT, this is what we expect.
            dynomite_future = dynomite['-v', '11', '-o', logfile, '-c',
                                       config_filename, '-v6'] & BG(1)

            try:
                yield DynoNode(self.ip)
            finally:
                dynomite_future.proc.send_signal(SIGINT)
                return_code = dynomite_future.wait()