Tezt_mavryk.AccuserSpawn Mavryk accuser and control them.
val create :
protocol:Protocol.t ->
?name:string ->
?color:Tezt_wrapper.Log.Color.t ->
?event_pipe:string ->
?base_dir:string ->
?runner:Tezt_wrapper.Runner.t ->
?preserved_levels:int ->
Node.t ->
tCreate an accuser.
This function just creates the t value, it does not call run.
The path to accuser binary is chosen from the protocol.
The standard output and standard error output of the accuser will be logged with prefix name and color color.
Default event_pipe is a temporary file whose name is derived from name. It will be created as a named pipe so that accuser events can be received.
base_dir corresponds to the (useless) "--base-dir" argument of the mavkit-accuser command.
The Node.t parameter is the accuser's node target. The accuser will be configured to be synchronised with the given node, and will communicate with it.
If runner is specified, the accuser will be spawned on this runner using SSH.
preserved_levels is the number of effective levels kept in the accuser's memory
val name : t -> stringSee Daemon.Make.name.
val node_rpc_port : t -> intGet the RPC port of the associated node.
val terminate : ?timeout:float -> t -> unit Lwt.tSend SIGTERM and wait for the process to terminate.
Default timeout is 30 seconds, after which SIGKILL is sent.
val kill : t -> unit Lwt.tSend SIGKILL and wait for the process to terminate.
val run : ?event_level:Daemon.Level.default_level -> t -> unit Lwt.tSpawn mavkit-accuser run.
The resulting promise is fulfilled as soon as the accuser has been spawned. It continues running in the background.
Exception raised by wait_for functions if the node terminates before the event.
You may catch or let it propagate to cause the test to fail. daemon is the name of the accuser. event is the name of the event. where is an additional optional constraint, such as "level >= 10".
val wait_for_ready : t -> unit Lwt.tWait until the accuser is ready.
More precisely, wait until the node on which the accuser is connected to is bootstrapped, and then, the accuser is ready.
val wait_for :
?where:string ->
t ->
string ->
(Tezt_wrapper.JSON.t -> 'a option) ->
'a Lwt.tSee Daemon.Make.wait_for.
val log_events : ?max_length:int -> t -> unitSee Daemon.Make.log_events.
val init :
protocol:Protocol.t ->
?name:string ->
?color:Tezt_wrapper.Log.Color.t ->
?event_pipe:string ->
?event_level:Daemon.Level.default_level ->
?base_dir:string ->
?runner:Tezt_wrapper.Runner.t ->
?preserved_levels:int ->
Node.t ->
t Lwt.tInitialize an accuser.
This creates an accuser and run, then waits for the accuser to be ready, and finally returns the accuser.
As the accuser usually needs to be connected to a node, we first wait for the node to be ready and then, run the accuser. If one does not want to wait for the node to be ready, it is necessary to use create and then run.
The path to accuser binary is chosen from the protocol.
The standard output and standard error output of the accuser will be logged with prefix name and color color.
Default event_pipe is a temporary file whose name is derived from name. It will be created as a named pipe so that accuser events can be received.
event_level specifies the verbosity of the file descriptor sink. The default value is `Info.
base_dir corresponds to the (useless) "--base-dir" argument of the mavkit-accuser command.
The Node.t parameter is the accuser's node target. The accuser will be configured to be synchronised with the given node, and will communicate with it.
If runner is specified, the accuser will be spawned on this runner using SSH.
preserved_levels is the number of effective levels kept in the accuser's memory