Command line interface. Provides a default main method for common Jepsen functions (like the web interface), and utility functions for Jepsen tests to create their own test runners.
Command line interface. Provides a default main method for common Jepsen functions (like the web interface), and utility functions for Jepsen tests to create their own test runners.
(-main & args)
(one-of coll)
Takes a collection and returns a string like "Must be one of ..." and a list of names. For maps, uses keys.
Takes a collection and returns a string like "Must be one of ..." and a list of names. For maps, uses keys.
(package-opt default)
(package-opt option-name default)
(parse-concurrency parsed)
Takes a parsed map. Parses :concurrency; if it is a string ending with n, e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain integer.
Takes a parsed map. Parses :concurrency; if it is a string ending with n, e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain integer.
(parse-nodes parsed)
Takes a parsed map and merges all the various node specifications together. In particular:
The new parsed map will have a merged nodes list in :nodes, and lose :nodes-file and :node options.
Takes a parsed map and merges all the various node specifications together. In particular: - If :nodes-file and :nodes are blank, and :node is the default node list, uses the default node list. - Otherwise, merges together :nodes-file, :nodes, and :node into a single list. The new parsed map will have a merged nodes list in :nodes, and lose :nodes-file and :node options.
(rename-keys m replacements)
Given a map m, and a map of keys to replacement keys, yields m with keys renamed.
Given a map m, and a map of keys to replacement keys, yields m with keys renamed.
(rename-options parsed replacements)
Like rename-keys, but takes a parsed map and updates keys in :options.
Like rename-keys, but takes a parsed map and updates keys in :options.
(rename-ssh-options parsed)
Takes a parsed map and moves SSH options to a map under :ssh.
Takes a parsed map and moves SSH options to a map under :ssh.
(repeated-opt short-opt long-opt docstring default)
(repeated-opt short-opt long-opt docstring default parse-map)
Helper for vector options where we want to replace the default vector (checking via identical?) if any options are passed, building a vector for multiple args. If parse-map is provided (a map of string cmdline options to parsed values), the special word "all" can be used to specify every value in the map.
Helper for vector options where we want to replace the default vector (checking via identical?) if any options are passed, building a vector for multiple args. If parse-map is provided (a map of string cmdline options to parsed values), the special word "all" can be used to specify every value in the map.
(run! subcommands [command & arguments])
Parses arguments and runs tests, etc. Takes a map of subcommand names to subcommand-specs, and a list of arguments. Each subcommand-spec is a map with the following keys:
:opt-spec - The option parsing spec to use. :opt-fn - A function to transform the tools.cli options map, e.g. {:options ..., :arguments ..., :summary ...}. Default: identity :usage - A usage string (default: "Usage:") :run - Function to execute with the transformed options (default: pprint)
If an unrecognized (or no command) is given, prints out a general usage guide and exits.
For a subcommand, if help or --help is given, prints out a help string with usage for the given subcommand and exits with status 0.
If invalid arguments are given, prints those errors to the console, and exits with status 254.
Finally, if everything looks good, calls the given subcommand's run
function with parsed options, and exits with status 0.
Catches exceptions, logs them to the console, and exits with status 255.
Parses arguments and runs tests, etc. Takes a map of subcommand names to subcommand-specs, and a list of arguments. Each subcommand-spec is a map with the following keys: :opt-spec - The option parsing spec to use. :opt-fn - A function to transform the tools.cli options map, e.g. {:options ..., :arguments ..., :summary ...}. Default: identity :usage - A usage string (default: "Usage:") :run - Function to execute with the transformed options (default: pprint) If an unrecognized (or no command) is given, prints out a general usage guide and exits. For a subcommand, if help or --help is given, prints out a help string with usage for the given subcommand and exits with status 0. If invalid arguments are given, prints those errors to the console, and exits with status 254. Finally, if everything looks good, calls the given subcommand's `run` function with parsed options, and exits with status 0. Catches exceptions, logs them to the console, and exits with status 255.
(single-test-cmd opts)
A command which runs a single test with standard built-ins. Options:
{:opt-spec A vector of additional options for tools.cli. Appended to
test-opt-spec
. Optional.
:opt-fn A function which transforms parsed options. Composed after
test-opt-fn
. Optional.
:tarball If present, adds a --tarball option to this command, defaulting to
whatever URL is given here.
:usage Defaults to jc/test-usage
. Optional.
:test-fn A function that receives the option map and constructs a test.}
This comes with two commands: test
, which runs a test and analyzes it, and
analyze
, which constructs a test map using the same arguments as run
, but
analyzes a history from disk instead.
A command which runs a single test with standard built-ins. Options: {:opt-spec A vector of additional options for tools.cli. Appended to `test-opt-spec`. Optional. :opt-fn A function which transforms parsed options. Composed after `test-opt-fn`. Optional. :tarball If present, adds a --tarball option to this command, defaulting to whatever URL is given here. :usage Defaults to `jc/test-usage`. Optional. :test-fn A function that receives the option map and constructs a test.} This comes with two commands: `test`, which runs a test and analyzes it, and `analyze`, which constructs a test map using the same arguments as `run`, but analyzes a history from disk instead.
(tarball-opt default)
(test-opt-fn parsed)
An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes, reads :nodes-file into :nodes, and parses :concurrency.
An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes, reads :nodes-file into :nodes, and parses :concurrency.
(test-usage)
(validate-tarball parsed)
Takes a parsed map and ensures a tarball is present.
Takes a parsed map and ensures a tarball is present.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close