package tezt

  1. Overview
  2. Docs

Extension to Stdlib.Sys that can also execute on remote runners.

Most functions from this module just call their Stdlib.Sys equivalent when runner is not specified. When runner is specified, they instead use SSH to execute a shell command remotely with a similar effect.

type error

Errors that can occur when executing a Sys command on a remote runner.

exception Remote_error of error

Exception raised when failing to execute a Sys command remotely.

This is not raised when running a command without a runner. Instead, Sys_error is raised.

val show_error : error -> string

Convert an error to an error message.

val file_exists : ?runner:t -> string -> bool

Check if a file exists on the system.

For the local version, see Sys.file_exists.

val mkdir : ?runner:t -> ?perms:int -> string -> unit

Create a new directory.

For the local version, see Unix.mkdir.

val is_directory : ?runner:t -> string -> bool

Check if a file exists and is a directory.

For the local version, see Sys.is_directory.

val readdir : ?runner:t -> string -> string array

Return the contents of a directory.

For the local version, see Sys.readdir.

val remove : ?runner:t -> string -> unit

Remove a file.

For the local version, see Sys.remove.

val rm_rf : t -> string -> unit

Remove recursively with rm -rf.

Only implemented for remote runners.

val rmdir : ?runner:t -> string -> unit

Remove a directory.

For the local version, see Unix.rmdir.

val mkfifo : ?runner:t -> ?perms:int -> string -> unit

Create a named pipe.

For the local version, see Unix.mkfifo.

OCaml

Innovation. Community. Security.