Execute arbitrary shell commands on exporter machine #1301
Replies: 2 comments 6 replies
-
Using a driver on something else than the DUT is not the designated way. If the IP/hostname of the board is (somewhat) static, you could export a NetworkService resource on your exporter. Then you could use the SSHManager to run your command: from labgrid.util import sshmanager
exporter = networkservice.extra.get("proxy") # exporter host name
ssh = sshmanager.get(exporter)
ssh.run_check(f"ping {networkservice.address}")
ssh.run_check(f"curl http://{networkservice.address}") Instead of using the NetworkService to retrieve the exporter hostname and the DUT's IP/hostname, you could use hard-coded values alternatively, but this would be less flexible. If this solution is meant to be reusable, you could even export the NetworkService in isolated mode and check for that ( |
Beta Was this translation helpful? Give feedback.
-
Hi, I played with the concepts of labgrid drivers in order to be able to execute When using the exporter as a proxy to execute python code, the module used ( Here are some more details:
Note that if the certificate is signed for I have two option to fix this issue:
As you can imagine, solution 2 is clearly on the roadmap but I would like to be able to implement solution 1, at least in order to be able to control the python environment of the exporter. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use labgrid to test micro-controller based boards. The board under test is connected through a serial interface and network interface directly to the exporter machine.
The exporter machine has two network interfaces, one towards the board(s), the other towards the LAN + internet, the network connection is shared (board can access the LAN + internet, hosts on LAN cannot access board behind the exporter).
I wish to execute some arbitrary commands on the exporter to communicate with the board (
ping <board-ip>
,curl http://<board-ip>
, ...)I wish to understand what is the best way to do this. I was thinking of defining on the exporter an
SSHDriver
to localhost in order to be able to send command but somehow I think I am missing something and believe there is another alternative (which I have not found).Has someone an idea for this ?
Thanks in advance 🙂
Beta Was this translation helpful? Give feedback.
All reactions