SSH authentication
Labgrid drives boards over SSH through the exporter hosts. In CI, OIDC
generates short-lived opkssh certificates to SSH to the Labgrid exporters.
Those methods are managed by LabgridClient.
OPKSSH
SSH authentication with opkssh.
- class hw_tests.opkssh.OPKSSH(client=None)
Set up SSH access to the hosts of a labgrid client.
Installs opkssh if missing and runs
authenticate().- Parameters:
client –
LabgridClientwhose hosts to check. IfNone, the SSH check is skipped.
- authenticate(client=None)
Get an SSH certificate and check access to the client hosts.
In GitHub Actions, runs
opkssh login github, which writes~/.ssh/id_ecdsaand its certificate. The job needs theid-token: writepermission. Elsewhere, the user’s SSH keys are used.
SSHConfig
Manage the SSH config file used by tests.
- class hw_tests.ssh_config.SSHConfig(path: Path = PosixPath('/home/runner/work/hw-test/hw-test/docs/_ssh_config'))
SSH config file with per-host options.
A new file includes
~/.ssh/config.- Parameters:
path – Config file. Defaults to
_ssh_configin the current directory.