Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions labgrid/remote/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ def main():
'--crossbar',
metavar='URL',
type=str,
default="ws://127.0.0.1:20408/ws",
default=os.environ.get("LG_CROSSBAR", "ws://127.0.0.1:20408/ws"),
help="crossbar websocket URL"
)
parser.add_argument(
Expand Down Expand Up @@ -1004,7 +1004,8 @@ def main():
}

if args.command and args.command != 'help':
session = start_session(args.crossbar, "realm1", extra)
session = start_session(args.crossbar,
os.environ.get("LG_CROSSBAR_REALM", "realm1"), extra)
exitcode = 0
try:
if asyncio.iscoroutinefunction(args.func):
Expand Down
5 changes: 3 additions & 2 deletions labgrid/remote/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import asyncio
import logging
import sys
import os
import traceback
import subprocess
from socket import gethostname, socket, AF_INET, SOCK_STREAM
Expand Down Expand Up @@ -381,7 +382,7 @@ def main():
'--crossbar',
metavar='URL',
type=str,
default="ws://127.0.0.1:20408/ws",
default=os.environ.get("LG_CROSSBAR", "ws://127.0.0.1:20408/ws"),
help="crossbar websocket URL"
)
parser.add_argument(
Expand Down Expand Up @@ -417,7 +418,7 @@ def main():

extra['loop'] = loop = asyncio.get_event_loop()
#loop.set_debug(True)
runner = ApplicationRunner(url=args.crossbar, realm="realm1", extra=extra)
runner = ApplicationRunner(url=args.crossbar, realm=os.environ.get("LG_CROSSBAR_REALM", "realm1"), extra=extra)
runner.run(ExporterSession, log_level=level)
if reexec:
exit(100)
Expand Down
7 changes: 5 additions & 2 deletions labgrid/resource/remote.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import attr
import os

from ..factory import target_factory
from .common import Resource, NetworkResource, ManagedResource, ResourceManager
Expand Down Expand Up @@ -35,8 +36,10 @@ def on_resource_added(self, resource):
if not self.session:
self.env = remote_place.target.env
config = self.env.config
self.url = config.get_option('crossbar_url', "ws://127.0.0.1:20408/ws")
self.realm = config.get_option('crossbar_realm', "realm1")
self.url = config.get_option('crossbar_url',
os.environ.get("LG_CROSSBAR", "ws://127.0.0.1:20408/ws"))
self.realm = config.get_option('crossbar_realm',
os.environ.get("LG_CROSSBAR_REALM", "realm1"))
self._start()
place = self.session.get_place(remote_place.name)
resource_entries = self.session.get_target_resources(place)
Expand Down
3 changes: 2 additions & 1 deletion man/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ PAGES := labgrid-client.1 labgrid-exporter.1 labgrid-device-config.1 labgrid-pyt
COMPRESSED := labgrid-client.1.gz labgrid-exporter.1.gz labgrid-device-config.1.gz labgrid-pytest.1.gz

%.1: %.rst
rst2man.py $< > $@
rst2man.py $< >$@.tmp
mv -f $@.tmp $@

%.1.gz : %.1
gzip $<
Expand Down
8 changes: 8 additions & 0 deletions man/labgrid-client.1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ This variable can be used to specify a place without using the \fB\-p\fP option,
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.
.SS LG_CROSSBAR
.sp
This variable can be used to set the default crossbar URL (instead of using the
\fB\-x\fP option).
.SS LG_CROSSBAR_REALM
.sp
This variable can be used to set the default crossbar realm to use instead of
\fBrealm1\fP\&.
.SH MATCHES
.sp
Match patterns are used to assign a resource to a specific place. The format is:
Expand Down
10 changes: 10 additions & 0 deletions man/labgrid-client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ 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_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``.

MATCHES
-------
Match patterns are used to assign a resource to a specific place. The format is:
Expand Down
13 changes: 12 additions & 1 deletion man/labgrid-exporter.1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems.
.sp
This is the man page for the exporter, supporting the export of serial ports,
usb tools and various other controllers.
USB devices and various other controllers.
.SH OPTIONS
.INDENT 0.0
.TP
Expand All @@ -59,6 +59,17 @@ The exporter uses a YAML configuration file which defines groups of releated
resources.
Furthermore the exporter can start helper binaries such as \fBser2net\fP to
export local serial ports over the network.
.SH ENVIRONMENT VARIABLES
.sp
The following environment variable can be used to configure labgrid\-exporter.
.SS LG_CROSSBAR
.sp
This variable can be used to set the default crossbar URL (instead of using the
\fB\-x\fP option).
.SS LG_CROSSBAR_REALM
.sp
This variable can be used to set the default crossbar realm to use instead of
\fBrealm1\fP\&.
.SH EXAMPLES
.sp
Start the exporter with the configuration file \fImy\-config.yaml\fP:
Expand Down
16 changes: 15 additions & 1 deletion man/labgrid-exporter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DESCRIPTION
Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems.

This is the man page for the exporter, supporting the export of serial ports,
usb tools and various other controllers.
USB devices and various other controllers.

OPTIONS
-------
Expand All @@ -50,6 +50,20 @@ resources.
Furthermore the exporter can start helper binaries such as ``ser2net`` to
export local serial ports over the network.

ENVIRONMENT VARIABLES
---------------------
The following environment variable can be used to configure labgrid-exporter.

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``.

EXAMPLES
--------

Expand Down