|
1 | 1 | .. _labgrid-client:
|
2 |
| -.. include:: ../../man/labgrid-client.rst |
| 2 | + |
| 3 | +labgrid-client |
| 4 | +============== |
| 5 | + |
| 6 | +Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems. |
| 7 | + |
| 8 | +This is the client to control a boards status and interface with it on remote machines. |
| 9 | + |
| 10 | +.. argparse:: |
| 11 | + :module: labgrid.remote.client |
| 12 | + :func: get_parser |
| 13 | + :prog: labgrid-client |
| 14 | + :noepilog: |
| 15 | + :nodescription: |
| 16 | + |
| 17 | + help : @skip |
| 18 | + skip help |
| 19 | + |
| 20 | +Configuration File |
| 21 | +------------------ |
| 22 | +The configuration file follows the description in ``labgrid-device-config``\(5). |
| 23 | + |
| 24 | +Environment Variables |
| 25 | +--------------------- |
| 26 | +Various labgrid-client commands use the following environment variable: |
| 27 | + |
| 28 | +LG_PLACE |
| 29 | +~~~~~~~~ |
| 30 | +This variable can be used to specify a place without using the ``-p`` option, the ``-p`` option overrides it. |
| 31 | + |
| 32 | +LG_TOKEN |
| 33 | +~~~~~~~~ |
| 34 | +This variable can be used to specify a reservation for the ``wait`` command and |
| 35 | +for the ``+`` place expansion. |
| 36 | + |
| 37 | +LG_STATE |
| 38 | +~~~~~~~~ |
| 39 | +This variable can be used to specify a state which the device transitions into |
| 40 | +before executing a command. Requires a configuration file and a Strategy |
| 41 | +specified for the device. |
| 42 | + |
| 43 | +LG_INITIAL_STATE |
| 44 | +~~~~~~~~~~~~~~~~ |
| 45 | +This variable can be used to specify an initial state the device is known to |
| 46 | +be in. |
| 47 | +This is useful during development. The Strategy used must implement the |
| 48 | +``force()`` method. |
| 49 | +A desired state must be set using ``LG_STATE`` or ``-s``/``--state``. |
| 50 | + |
| 51 | +LG_ENV |
| 52 | +~~~~~~ |
| 53 | +This variable can be used to specify the configuration file to use without |
| 54 | +using the ``--config`` option, the ``--config`` option overrides it. |
| 55 | + |
| 56 | +LG_COORDINATOR |
| 57 | +~~~~~~~~~~~~~~ |
| 58 | +This variable can be used to set the default coordinator in the format |
| 59 | +``HOST[:PORT]`` (instead of using the ``-x`` option). |
| 60 | + |
| 61 | +LG_PROXY |
| 62 | +~~~~~~~~ |
| 63 | +This variable can be used to specify a SSH proxy hostname which should be used |
| 64 | +to connect to the coordinator and any resources which are normally accessed |
| 65 | +directly. |
| 66 | + |
| 67 | +LG_HOSTNAME |
| 68 | +~~~~~~~~~~~ |
| 69 | +Override the hostname used when accessing a resource. Typically only useful for |
| 70 | +CI pipelines where the hostname may not be consistent between pipeline stages. |
| 71 | + |
| 72 | +LG_USERNAME |
| 73 | +~~~~~~~~~~~ |
| 74 | +Override the username used when accessing a resource. Typically only useful for |
| 75 | +CI pipelines where the username may not be consistent between pipeline stages. |
| 76 | + |
| 77 | +LG_SSH_CONNECT_TIMEOUT |
| 78 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 79 | +Set the connection timeout when using SSH (The ``ConnectTimeout`` option). If |
| 80 | +unspecified, defaults to 30 seconds. |
| 81 | + |
| 82 | +LG_AGENT_PREFIX |
| 83 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 84 | +Add a prefix to ``.labgrid_agent_{agent_hash}.py`` allowing specification for |
| 85 | +where on the exporter it should be uploaded to. |
| 86 | + |
| 87 | +Matches |
| 88 | +------- |
| 89 | +Match patterns are used to assign a resource to a specific place. The format is: |
| 90 | +exporter/group/cls/name, exporter is the name of the exporting machine, group is |
| 91 | +a name defined within the exporter, cls is the class of the exported resource |
| 92 | +and name is its name. Wild cards in match patterns are explicitly allowed, * |
| 93 | +matches anything. |
| 94 | + |
| 95 | +Adding Named Resources |
| 96 | +---------------------- |
| 97 | +If a target contains multiple Resources of the same type, named matches need to |
| 98 | +be used to address the individual resources. In addition to the `match` taken by |
| 99 | +`add-match`, `add-named-match` also takes a name for the resource. The other |
| 100 | +client commands support the name as an optional parameter and will inform the |
| 101 | +user that a name is required if multiple resources are found, but no name is |
| 102 | +given. |
| 103 | + |
| 104 | +If one of the resources should be used by default when no resource name is |
| 105 | +explicitly specified, it can be named ``default``. |
| 106 | + |
| 107 | +Examples |
| 108 | +-------- |
| 109 | + |
| 110 | +To retrieve a list of places run: |
| 111 | + |
| 112 | +.. code-block:: bash |
| 113 | +
|
| 114 | + $ labgrid-client places |
| 115 | +
|
| 116 | +To access a place, it needs to be acquired first, this can be done by running |
| 117 | +the ``acquire command`` and passing the placename as a -p parameter: |
| 118 | + |
| 119 | +.. code-block:: bash |
| 120 | +
|
| 121 | + $ labgrid-client -p <placename> acquire |
| 122 | +
|
| 123 | +Open a console to the acquired place: |
| 124 | + |
| 125 | +.. code-block:: bash |
| 126 | +
|
| 127 | + $ labgrid-client -p <placename> console |
| 128 | +
|
| 129 | +Add all resources with the group "example-group" to the place example-place: |
| 130 | + |
| 131 | +.. code-block:: bash |
| 132 | +
|
| 133 | + $ labgrid-client -p example-place add-match */example-group/*/* |
| 134 | +
|
| 135 | +See Also |
| 136 | +-------- |
| 137 | + |
| 138 | +``labgrid-exporter``\(1) |
0 commit comments