Remote Access from pytest with tags #1244
-
With the labgrid-client I have added tags to a place like this:
On the command line I can aquire the place based on the tags, I assume in case multipüle places provide the same tags I get a free one.
With the token I can aquire the place
But how can this be achieved from a pytest environment. From the Environment Configuration docs I have figured out there is the possibility to use environment variables: targets:
main:
resources:
RemotePlace:
name: !template $LG_PLACE
tools:
qemu_bin: !template "$BASE/bin/qemu-bin" But how can I get the place to be put into |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With your configuration, this should be possible via $ eval `labgrid-client reserve --shell board=imx6`
$ labgrid-client wait $LG_TOKEN
owner: erbse/bst
token: L7KN0X2UUG
state: allocated
filters:
main: board=imx6
allocations:
main: example
created: 2023-07-21 12:44:02.284611
timeout: 2023-07-21 12:45:04.489250
$ export LG_PLACE=+
$ labgrid-client lock
acquired place example
$ pytest --lg-env=conf.yaml test_barebox.py See also https://labgrid.readthedocs.io/en/latest/usage.html#place-scheduling |
Beta Was this translation helpful? Give feedback.
With your configuration, this should be possible via
export LG_PLACE=+
:See also https://labgrid.readthedocs.io/en/latest/usage.html#place-scheduling