Lab Configuration¶
A lab is a set of hosts described in one or more hosts.json files. Each
file lists every host in a given location; each host entry declares which lab
names it belongs to, so a single file can serve multiple labs and a host can
belong to more than one lab at once. This page is the full per-host schema
reference. For repo-level settings (paths, libs, init modules) see
Repository Setup.
Lab files¶
Each directory listed under the labs key in .otto/settings.toml may
contain a hosts.json file. The file is a JSON array of host objects:
[
{
"ip": "10.10.200.11",
"ne": "carrot",
"board": "seed",
"creds": { "vagrant": "vagrant" },
"labs": ["veggies"]
},
{
"ip": "192.0.2.1",
"ne": "sprout",
"board": "seed",
"osType": "zephyr",
"labs": ["embedded"]
}
]
Each entry carries a labs field listing the lab names it belongs to. Pass
--lab veggies (or set OTTO_LAB=veggies) and otto loads every host whose
labs field includes "veggies".
The host id used by get_host(), --list-hosts, and the rest of the CLI
is derived from the ne, board, and neId fields. carrot with board
seed becomes carrot_seed; carrot with board seed and neId 2
becomes carrot_seed_2.
Per-host fields¶
Required¶
Field |
Type |
Description |
|---|---|---|
|
string |
IP address or DNS name otto will connect to. |
|
string |
Network-element name. Combined with |
|
object |
Map of username → password. At least one entry required for Unix hosts; optional for embedded hosts (RTOS telnet shells typically have no login step). |
|
array of strings |
Lab names this host belongs to. Without this the host is invisible to |
Common optional¶
Field |
Type |
Description |
|---|---|---|
|
string |
Board type, included in the host id when set. |
|
integer |
Disambiguates multiple instances of the same NE; appended to the host id. |
|
string |
Pin a specific user from |
|
string |
Terminal protocol — |
|
string |
File-transfer protocol — |
|
string |
Host id of an intermediate SSH jump host. Otto opens an SSH tunnel through it and routes all subsequent connections automatically. Hops can chain. |
|
array of strings |
Free-form resource tags used by the reservation backend. |
|
boolean |
|
|
boolean |
Whether to log output to stdout and log files (default |
|
boolean |
Whether to log output to stdout (default |
|
boolean |
|
Host type / OS¶
Field |
Type |
Description |
|---|---|---|
|
string |
Profile selector. Defaults to |
|
string |
Human-readable OS name (e.g. |
|
string |
OS or kernel version string (e.g. |
Embedded-only fields¶
These fields apply only to hosts with an embedded base type (e.g.
osType: "zephyr" or osType: "embedded"). See Embedded Hosts for full
details.
Field |
Type |
Description |
|---|---|---|
|
string |
Shell-framing dialect (e.g. |
|
string |
On-device filesystem variant ( |
|
integer |
Maximum filename length accepted by the target filesystem. |
File transfer for embedded hosts uses "console" or "tftp" — see
Embedded Hosts.
SNMP monitoring¶
The optional snmp block configures SNMP polling for a host’s metrics. See
the SNMP section of otto monitor.
Field |
Type |
Description |
|---|---|---|
|
string |
SNMP agent IP address. |
|
integer |
SNMP UDP port. |
|
string |
SNMP community string. |
|
array of strings |
OIDs to poll. |
Per-protocol option tables¶
Each of the following keys accepts an object that overrides individual
protocol fields. They merge per-key with repo-level [host_defaults]; the
host’s own values win. See otto host for the full connection-options
reference.
Key |
Protocol |
|---|---|
|
SSH (term and hop) |
|
Telnet (term, and the embedded console) |
|
SFTP transfer |
|
SCP transfer |
|
FTP transfer |
|
Netcat transfer |
Coverage toolchain¶
The toolchain object points to the cross-toolchain binaries used by the
coverage pipeline. See Coverage Collection.
Field |
Type |
Description |
|---|---|---|
|
string |
Path to the cross-toolchain sysroot. |
|
string |
Path to |
|
string |
Path to the |
Example¶
Two real entries from the test fixture — one Unix host and one Zephyr host:
[
{
"ip": "10.10.200.11",
"ne": "carrot",
"osType": "unix",
"board": "seed",
"term": "ssh",
"transfer": "scp",
"is_virtual": true,
"creds": {
"vagrant": "vagrant",
"test": "Password1"
},
"resources": [
"carrot"
],
"labs": [
"veggies"
]
},
{
"ip": "192.0.2.1",
"ne": "sprout",
"osType": "zephyr",
"osVersion": "3.7",
"transfer": "console",
"filesystem": "fat-ram",
"max_filename_len": 32,
"is_virtual": true,
"hop": "basil_seed",
"snmp": {
"address": "10.10.200.14",
"port": 16101,
"community": "public",
"oids": [
"1.3.6.1.2.1.1.3.0",
"1.3.6.1.4.1.63245.1.1.0",
"1.3.6.1.4.1.63245.1.2.0",
"1.3.6.1.4.1.63245.1.3.0",
"1.3.6.1.4.1.63245.1.4.0"
]
},
"resources": [
"sprout"
],
"labs": [
"embedded"
]
}
]
Repo-level host defaults¶
Most labs share a common set of connection conventions — a non-standard SSH
port, a longer connect timeout, an alternate nc binary, etc. Restating
those values on every host entry is repetitive and error-prone. Move the
shared values into [host_defaults] in .otto/settings.toml and let the
per-host *_options tables override only the values that genuinely differ.
# .otto/settings.toml
[host_defaults.ssh_options]
port = 2222
connect_timeout = 5.0
keepalive_interval = 30
[host_defaults.telnet_options]
cols = 200
echo_negotiation_timeout = 1.0
[host_defaults.nc_options]
exec_name = "ncat"
port_strategy = "proc"
Valid sub-table names are exactly the per-host option keys:
ssh_options, telnet_options, sftp_options, scp_options,
ftp_options, nc_options. Unknown keys raise at startup so typos
fail loudly instead of silently no-opping.
Precedence (lowest to highest):
The hardcoded dataclass defaults in
otto.host.options.[host_defaults]from each repo, applied inOTTO_SUT_DIRSorder. When the same field appears in two repos, the later repo wins.The host’s own
*_optionstable inhosts.json.
Merging happens per key at every layer. Setting only port on a host
still inherits connect_timeout from the repo default; setting only
connect_timeout in the repo default still inherits port from the
dataclass default.
The merge is performed at host construction time, so the resulting host
carries the fully-resolved *_options instances — nothing has to be
re-resolved at use time.
Merging labs¶
Pass multiple lab names to combine them:
otto --lab lab_a,lab_b test TestDevice
Hosts from all labs are merged into a single lab. If two labs define the same host ID, the later lab’s definition wins.
Exploring labs¶
otto --lab my_lab --list-labs # list all available lab names
otto --lab my_lab --list-hosts # list host IDs in the loaded lab
otto --lab my_lab --show-lab # full lab details (use -v for expanded output)