Skip to content

Commit ba6c91a

Browse files
committed
doc: add environment file for the distributed case in getting_started
In this commit, I tried to pick up concepts like "targets", "drivers" and "environment files" from the local example again in the distributed example. This should help the reader put the new concepts in the distributed case into context of what was explained before. This will hopefully make it easier to understand the distributed case in general. Signed-off-by: Leonardo Mörlein <[email protected]>
1 parent 2d686f6 commit ba6c91a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

doc/getting_started.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,42 @@ See :ref:`remote-usage` for some more advanced features.
324324
For a complete reference have a look at the :doc:`labgrid-client(1) <man/client>`
325325
man page.
326326

327+
Now, to connect drivers to the resources, you can configure an environment file,
328+
which we call ``remote.yaml`` in this case:
329+
330+
.. code-block:: yaml
331+
332+
targets:
333+
main:
334+
resources:
335+
RemotePlace:
336+
name: myplace
337+
drivers:
338+
SerialDriver: {}
339+
ShellDriver:
340+
prompt: 'root@[\w-]+:[^ ]+ '
341+
login_prompt: ' login: '
342+
username: 'root'
343+
344+
The ``RemotePlace`` resource makes all resources available that are assigned to
345+
to the place ``myplace`` on your coordinator.
346+
347+
Now, this environment file can be used interactively with the client:
348+
349+
.. code-block:: bash
350+
351+
labgrid-venv $ labgrid-client -c remote.yaml acquire
352+
labgrid-venv $ labgrid-client -c remote.yaml console
353+
labgrid-venv $ labgrid-client -c remote.yaml release
354+
355+
or directly with a test:
356+
357+
.. code-block:: bash
358+
359+
labgrid-venv $ labgrid-client -c remote.yaml acquire
360+
labgrid-venv $ pytest --lg-env remote.yaml test_shell.py
361+
labgrid-venv $ labgrid-client -c remote.yaml release
362+
327363
.. _remote-getting-started-systemd-files:
328364

329365
Systemd files

0 commit comments

Comments
 (0)