labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
334 stars 174 forks source link

Option for acquiring coordinator / exporter consoles for labgrid-client #889

Closed vishwa-mke closed 1 year ago

vishwa-mke commented 2 years ago

Is there a way to acquire exporters / coordinator's console from the labgrid-client ?

If yes how and if not can you give me hints on how to implement it, for e.g. as a strategy where each of the coordinator, exporters and targets are treated as levels or states

This option might be valuable in some situations for example to run nmap tests against the target during the various modes of operation of the target device.

Bastian-Krause commented 2 years ago

Hi,

you could do something like this, assuming you want to nmap your target from the machine exporting your NetworkSerialPort and your environment configuration contains a NetworkService.

from labgrid.util.helper import processwrapper

def test_nmap(target):
    serial_resource = target.get_resource("NetworkSerialPort")
    network_resource = target.get_resource("NetworkService")

    cmd = ["nmap", network_resource.address]
    out = processwrapper.check_output(serial_resource.command_prefix + cmd)

Maybe @Emantor or @jluebbe have a better idea?

Bastian-Krause commented 1 year ago

@vishwa-mke Did you test my suggestion?

vishwa-mke commented 1 year ago

Hello Bastian,

Thank you for informing me, I will ask my colleague to test it in the next week's and let you know.

Best regards, Vishwavardhan

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Bastian Krause @.> Sent: Sunday, July 23, 2023 12:34:00 PM To: labgrid-project/labgrid @.> Cc: vishwa-mke @.>; Mention @.> Subject: Re: [labgrid-project/labgrid] Option for acquiring coordinator / exporter consoles for labgrid-client (Issue #889)

@vishwa-mkehttps://github.com/vishwa-mke Did you test my suggestion?

— Reply to this email directly, view it on GitHubhttps://github.com/labgrid-project/labgrid/issues/889#issuecomment-1646804962, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOXEPLUSVF5BK2OSOOK5DRDXRT4ZRANCNFSM5NSHUKUQ. You are receiving this because you were mentioned.Message ID: @.***>

Bastian-Krause commented 1 year ago

We haven't heard back. I'll assume that the suggestion worked and close the issue. Feel free to comment if it does not work.