File: labgrid-client.rst

package info (click to toggle)
labgrid 0.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,232 kB
  • sloc: python: 17,045; makefile: 30; sh: 12
file content (231 lines) | stat: -rw-r--r-- 7,169 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
================
 labgrid-client
================

labgrid-client interface to control boards
==========================================

:Author: Rouven Czerwinski <r.czerwinski@pengutronix.de>
:organization: Labgrid-Project
:Date:   2017-04-15
:Copyright: Copyright (C) 2016-2017 Pengutronix. This library is free software;
	    you can redistribute it and/or modify it under the terms of the GNU
	    Lesser General Public License as published by the Free Software
	    Foundation; either version 2.1 of the License, or (at your option)
	    any later version.
:Version: 0.0.1
:Manual section: 1
:Manual group: embedded testing

SYNOPSIS
--------

``labgrid-client`` ``--help``

``labgrid-client`` -p <place> <command>

``labgrid-client`` ``places|resources``

DESCRIPTION
-----------
Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems.

This is the client to control a boards status and interface with it on remote machines.

OPTIONS
-------
-h, --help
    display command line help
-p PLACE, --place PLACE
    specify the place to operate on
-x, --crossbar-url
    the crossbar url of the coordinator, defaults to ``ws://127.0.0.1:20408/ws``
-c CONFIG, --config CONFIG
    set the configuration file
-s STATE, --state STATE
    set an initial state before executing a command, requires a configuration
    file and strategy
-d, --debug
    enable debugging
-v, --verbose
    increase verbosity
-P PROXY, --proxy PROXY
    proxy connections over ssh

CONFIGURATION FILE
------------------
The configuration file follows the description in ``labgrid-device-config``\(5).

ENVIRONMENT VARIABLES
---------------------
Various labgrid-client commands use the following environment variable:

LG_PLACE
~~~~~~~~
This variable can be used to specify a place without using the ``-p`` option, the ``-p`` option overrides it.

LG_TOKEN
~~~~~~~~
This variable can be used to specify a reservation for the ``wait`` command and
for the ``+`` place expansion.

LG_STATE
~~~~~~~~
This variable can be used to specify a state which the device transitions into
before executing a command. Requires a configuration file and a Strategy
specified for the device.

LG_ENV
~~~~~~
This variable can be used to specify the configuration file to use without
using the ``--config`` option, the ``--config`` option overrides it.

LG_CROSSBAR
~~~~~~~~~~~
This variable can be used to set the default crossbar URL (instead of using the
``-x`` option).

LG_CROSSBAR_REALM
~~~~~~~~~~~~~~~~~
This variable can be used to set the default crossbar realm to use instead of
``realm1``.

LG_PROXY
~~~~~~~~
This variable can be used to specify a SSH proxy hostname which should be used
to connect to the coordinator and any resources which are normally accessed
directly.

LG_HOSTNAME
~~~~~~~~~~~
Override the hostname used when accessing a resource. Typically only useful for
CI pipelines where the hostname may not be consistent between pipeline stages.

LG_USERNAME
~~~~~~~~~~~
Override the username used when accessing a resource. Typically only useful for
CI pipelines where the username may not be consistent between pipeline stages.

MATCHES
-------
Match patterns are used to assign a resource to a specific place. The format is:
exporter/group/cls/name, exporter is the name of the exporting machine, group is
a name defined within the exporter, cls is the class of the exported resource
and name is its name. Wild cards in match patterns are explicitly allowed, *
matches anything.

LABGRID-CLIENT COMMANDS
-----------------------
``monitor``                     Monitor events from the coordinator

``resources (r)``               List available resources

``places (p)``                  List available places

``who``                         List acquired places by user

``show``                        Show a place and related resources

``create``                      Add a new place (name supplied by -p parameter)

``delete``                      Delete an existing place

``add-alias`` alias             Add an alias to a place

``del-alias`` alias             Delete an alias from a place

``set-comment`` comment         Update or set the place comment

``set-tags`` comment            Set place tags (key=value)

``add-match`` match             Add one (or multiple) match pattern(s) to a place, see MATCHES

``del-match`` match             Delete one (or multiple) match pattern(s) from a place, see MATCHES

``add-named-match`` match name  Add one match pattern with a name to a place

``acquire (lock)``              Acquire a place

``allow`` user                  Allow another user to access a place

``release (unlock)``            Release a place

``env``                         Generate a labgrid environment file for a place

``power (pw)`` action           Change (or get) a place's power status, where action is one of get, on, off, status

``io`` action                   Interact with GPIO (OneWire, relays, ...) devices, where action is one of high, low, get

``console (con)``               Connect to the console

``fastboot`` arg                Run fastboot with argument

``bootstrap`` filename          Start a bootloader

``sd-mux`` action               Switch USB SD Muxer, where action is one of dut (device-under-test), host, off

``ssh``                         Connect via SSH

``scp``                         Transfer file via scp (use ':dir/file' for the remote side)

``rsync``                       Transfer files via rsync (use ':dir/file' for the remote side)

``sshfs``                       Mount a remote path via sshfs

``telnet``                      Connect via telnet

``video``                       Start a video stream

``tmc`` command                 Control a USB TMC device

``write-image``                 Write images onto block devices (USBSDMux, USB Sticks, …)

``reserve`` filter              Create a reservation

``cancel-reservation`` token    Cancel a pending reservation

``wait`` token                  Wait for a reservation to be allocated

``reservations``                List current reservations

ADDING NAMED RESOURCES
----------------------
If a target contains multiple Resources of the same type, named matches need to
be used to address the individual resources. In addition to the `match` taken by
`add-match`, `add-named-match` also takes a name for the resource. The other
client commands support the name as an optional parameter and will inform the
user that a name is required if multiple resources are found, but no name is
given.

EXAMPLES
--------

To retrieve a list of places run:

.. code-block:: bash

   $ labgrid-client places

To access a place, it needs to be acquired first, this can be done by running
the ``acquire command`` and passing the placename as a -p parameter:

.. code-block:: bash

   $ labgrid-client -p <placename> acquire

Open a console to the acquired place:

.. code-block:: bash

   $ labgrid-client -p <placename> console

Add all resources with the group "example-group" to the place example-place:

.. code-block:: bash

   $ labgrid-client -p example-place add-match */example-group/*/*

SEE ALSO
--------

``labgrid-exporter``\(1)