#exec #directory #timeout #unix-timestamp #status #trigger #scenario

app exclave

A frontend for running factory tests

5 releases

Uses old Rust 2015

0.2.6 Mar 1, 2019
0.2.5 Oct 30, 2018
0.2.2 Oct 22, 2018
0.2.1 Oct 15, 2018
0.1.0 Dec 13, 2017

33 downloads per month

BSD-3-Clause

530KB
5.5K SLoC

Rust 5K SLoC // 0.0% comments PowerShell 448 SLoC // 0.5% comments Shell 82 SLoC // 0.1% comments C 52 SLoC

Contains (DOS exe, 115KB) test/wintests/writetest.exe, (DOS exe, 115KB) test/lintests/writetest.exe

Exclave: Factory Test Infrastructure

Exclave is a factory test infrastructure, written in Rust. Tests are designed to be easy to write in any language you care to, as Exclave will capture the output from your program and log it all. Once your test finishes, exit with a zero return code to indicate success, or nonzero to indicate failure.

Building

To build, install Rust. To build the latest release, run:

cargo install exclave

To build from source, check out this repository, change to the root directory, and run:

cargo build

Running

To run, you must specify a configuration directory with the "-c" argument. For example, if your configuration directory is in /etc/exclave, run:

exclave -c /etc/exclave

Or, if you're doing development and using cargo, run:

cargo run -- -c /etc/exclave

If exclave detects that it's connected to a terminal, you will be presented with a live view of all units. If it's not connected to a terminal (i.e. if it's running under systemd or init), then exclave will log all unit transitions to stdout, unless the "-q" option is specified.

Defining Configurations

An example configuration directory is present under "test/config". You can use this to get started. You can run it using "exclave -c test/config".

The unit configuration language is defined in doc/Units.md.

Writing Tests

Tests may be written in any language, but you must make sure the required interpreter (if any) is installed.

Log any progress to stdout, and log any error to stderr.

When a particular test has concluded, print the test result to stdout and exit. If the test was successful, exit 0. If the test failed, return nonzero.

Tests can time out, and if that occurs your test will first receive a SIGTERM. After a configurable amount of time, your test will receive a SIGKILL.

All tests are run in their own session, and are connected to a pseudoterminal (PTY). This will remove any buffering that would normally occur for things like printf.

Writing Interfaces, Loggers, and Triggers

Interfaces, Loggers, and Triggers all must interact with exclave using custom streams. The inter-process communication is documented in doc/IPC.md

Dependencies

~8–20MB
~259K SLoC