def cli_args(add=lambda x: None, accept_unknown=False): parser = argparse.ArgumentParser() parser.add_argument("-c", "--client", help="Client binary", required=True) parser.add_argument( "-n", "--nodes", help= "List of hostnames[,pub_hostnames:ports]. If empty, two nodes are spawned locally", action="append", ) parser.add_argument( "-cn", "--client-nodes", help= "List of hostnames for spawning client(s). If empty, one client is spawned locally", action="append", ) parser.add_argument( "--send-tx-to", choices=["primary", "followers", "all"], default="all", help= "Send client requests only to primary, only to followers, or to all nodes", ) parser.add_argument("-t", "--threads", help="Number of client threads", default=1) parser.add_argument( "-f", "--fixed-seed", help="Set a fixed seed for port and IP generation.", action="store_true", ) # Client binary args are parsed from a config file # Default is in the same directory as this script default_config_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), "common_config.ini") parser.add_argument("--config", help="Path to config for client binary", default=default_config_path) # Some common client binary args are exposed here for ease parser.add_argument("--label", help="Test label name in perf summary output file") parser.add_argument("-i", "--iterations", help="Number of transactions", required=True, type=int) parser.add_argument("--sign", action="store_true") return e2e_args.cli_args(add=add, parser=parser, accept_unknown=accept_unknown)
def cli_args(add=lambda x: None, accept_unknown=False): parser = argparse.ArgumentParser() parser.add_argument("-c", "--client", help="Client binary", required=True) parser.add_argument( "-n", "--nodes", help= "List of hostnames[,pub_hostnames:ports]. If empty, two nodes are spawned locally", action="append", ) parser.add_argument( "-cn", "--client-nodes", help= "List of hostnames for spawning client(s). If empty, one client is spawned locally", action="append", ) parser.add_argument( "--send-tx-to", choices=["primary", "backups", "all"], default="all", help= "Send client requests only to primary, only to backups, or to all nodes", ) parser.add_argument( "--metrics-file", default="metrics.json", help= "Path to json file where the transaction rate metrics will be saved to", ) parser.add_argument( "-f", "--fixed-seed", help="Set a fixed seed for port and IP generation.", action="store_true", ) # Client binary args are parsed from a config file # Default is in the same directory as this script default_config_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), "common_config.ini") parser.add_argument("--config", help="Path to config for client binary", default=default_config_path) return e2e_args.cli_args(add=add, parser=parser, accept_unknown=accept_unknown)
check(c.rpc("LOG_get", {"id": 100}), result={"msg": follower_msg}) check(c.rpc("LOG_get", {"id": 42}), result={"msg": msg}) LOG.debug("Write/Read large messages on leader") with primary.user_client(format="json") as c: id = 44 for p in range(14, 20): long_msg = "X" * (2**p) check_commit( c.rpc("LOG_record", { "id": id, "msg": long_msg }), result="OK", ) check(c.rpc("LOG_get", {"id": id}), result={"msg": long_msg}) id += 1 if __name__ == "__main__": args = e2e_args.cli_args() args.package = "libloggingenc" notify_server_host = "localhost" args.notify_server = ( notify_server_host + ":" + str(infra.net.probably_free_local_port(notify_server_host))) run(args)
new_node.join_network_custom(new_leader.host, new_leader.tls_port, net_cert) network.wait_for_node_commit_sync() if __name__ == "__main__": def add(parser): parser.add_argument( "-p", "--package", help="The enclave package to load (e.g., libsimplebank)", default="libloggingenc", ) parser.add_argument( "--oesign", help="Path to oesign binary", type=str, required=True ) parser.add_argument( "--oeconfpath", help="Path to oe configuration file", type=str, required=True, ) parser.add_argument( "--oesignkeypath", help="Path to oesign key", type=str, required=True ) args = e2e_args.cli_args(add) args.package = args.app_script and "libluagenericenc" or "libloggingenc" args.patched_file_name = "{}.patched".format(args.package) run(args)