Adding a Testing Module to OpenWISP – Is SSH via Paramiko Scalable and Recommended?

9 views
Skip to first unread message

Nikhil Vidhani

unread,
May 23, 2025, 9:47:48 AMMay 23
to OpenWISP

Hi everyone,

We’re a small company building networking solutions, and we’re currently extending OpenWISP to include a testing module.

The idea is:

  • The OpenWISP controller will be able to trigger various test cases that are already written and reside on OpenWRT devices.

  • The devices will expose a GET API to return available test case names and unique IDs. These will be fetched and saved into our OpenWISP-managed database.

  • From OpenWISP, an admin can create a test suite (a group of test cases) and execute these test cases remotely on the device.

In exploring how to remotely trigger execution of these scripts, I came across Paramiko and SSH as a possible method.

My main question is:
Is using SSH (via Paramiko in Django) to execute Python scripts on the device considered safe and scalable, especially when extended to many devices?

We are using OpenWISP’s VPN setup (WireGuard) for connectivity to the devices, so devices are reachable via IP internally.

Any guidance on:

  • Best practices for scalable command execution,

  • Whether OpenWISP supports a more native or event-driven way to handle this,

  • Or if any part of the architecture should be rethought for better maintainability,

would be greatly appreciated!

Thanks a lot in advance!

Oliver Kraitschy

unread,
May 23, 2025, 11:33:58 AMMay 23
to open...@googlegroups.com
Hi,

is this for testing in development or a production feature? What are the test cases?

The downside of using SSH to execute commands on the device is that it is
remote execution, meaning that there is some latency because of the need
to first connect to the devices, and that the remote process and results
are lost if the connection breaks.
Additionally, there is certainly a limit of connections at a time.

An alternative would be to deploy a script to execute the tests with
openwisp-config, and execute that script by one of the available hotplug
events:

https://openwisp.io/docs/stable/openwrt-config-agent/user/hotplug-events.html

The advantage is that such a script can be deployed to a specific set of
devices with an OpenWISP template.

Greetings,
Oliver

Am Fri, May 23, 2025 at 01:54:07AM -0700 schrieb Nikhil Vidhani:
>
>
> Hi everyone,
>
> We’re a small company building networking solutions, and we’re currently
> extending OpenWISP to include a *testing module*.
>
> The idea is:
>
> -
>
> The OpenWISP controller will be able to *trigger various test cases*
> that are already written and reside on OpenWRT devices.
> -
>
> The devices will expose a *GET API* to return available test case names
> and unique IDs. These will be fetched and saved into our OpenWISP-managed
> database.
> -
>
> From OpenWISP, an admin can *create a test suite* (a group of test
> cases) and execute these test cases remotely on the device.
>
> In exploring how to remotely trigger execution of these scripts, I came
> across *Paramiko and SSH* as a possible method.
>
> *My main question is:*
> Is using *SSH (via Paramiko in Django)* to execute Python scripts on the
> device considered *safe and scalable*, especially when extended to *many
> devices*?
>
> We are using OpenWISP’s VPN setup (WireGuard) for connectivity to the
> devices, so devices are reachable via IP internally.
>
> Any guidance on:
>
> -
>
> Best practices for scalable command execution,
> -
>
> Whether OpenWISP supports a more native or event-driven way to handle
> this,
> -
>
> Or if any part of the architecture should be rethought for better
> maintainability,
>
> would be greatly appreciated!
>
> Thanks a lot in advance!
>
> --
> You received this message because you are subscribed to the Google Groups "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
> To view this discussion, visit https://groups.google.com/d/msgid/openwisp/37c5f5b1-d968-4712-b498-b390da695e20n%40googlegroups.com.

Federico Capoano

unread,
May 23, 2025, 6:10:47 PMMay 23
to open...@googlegroups.com
Welcome Nikhil Vidhani,

OpenWISP has the possibility to execute SSH connections to devices, see:

SSH operations are not very fast, scalability depends on the amount of workers you can spawn to process the amount of requests you need.
As long as you have enough CPU and memory to execute this workload you're fine.
Alternative ways can be implemented if needed, for example, if your devices expose an HTTP API on the Wireguard IP, you could have OpenWISP call what you need via HTTP, but you'd have to implement this logic yourself.

I hope this helps.
Best regards
Federico Capoano
Reply all
Reply to author
Forward
0 new messages