--box BENCH-3.
With lager lease, a test requests a box from a pool instead. A pool is a
named set of requirements, for example “an nRF52840 board and a debug probe”.
A lease server finds a box that agrees with the requirements, is online, and is
not in use. Lager then runs your command on that box and releases the box when
the command stops.
The lease server is not part of Lager. Lager sends the pool name and gets one
box. The server keeps the pools and the record of each lease.
Syntax
-- separates the lager lease options from your command. lager lease
does not read the text after --.
Options
How it operates
- Lager asks the lease server for a box from the pool.
- The server locks one box for the lease, and sends the box address to Lager.
-
Lager runs COMMAND with these environment variables:
- While COMMAND runs, Lager renews the lease at the interval that the server sets.
- When COMMAND stops, Lager releases the box. This also occurs when COMMAND fails and when you push Ctrl-C.
lager command in COMMAND uses LAGER_BOX and LAGER_LOCK_HOLDER. Thus,
each command uses the leased box, and each command sees the lock of the lease
as its own lock. See Box Locking.
Examples
Run one script on a leased box:Server and credentials
Lager finds the lease server in this sequence:- The
--serveroption. - The
STOUT_URLenvironment variable. - The server of your
lager loginsession, if you have exactly one session.
STOUT_TOKEN environment variable if it is
set. If not, Lager uses your lager login session. See
Signing In. Use a token in CI, because a CI job
cannot sign in.
Exit status
Status 75 is different from a test failure. Thus, your CI can show “no box
available” separately from “test failed”.

