[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a80414c647940747c37a8c750bad4290ec81bd66.camel@redhat.com>
Date: Mon, 15 Apr 2024 10:57:31 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, shuah@...nel.org,
petrm@...dia.com, linux-kselftest@...r.kernel.org, willemb@...gle.com
Subject: Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint
structures
On Fri, 2024-04-12 at 16:37 -0700, Jakub Kicinski wrote:
> +class Endpoint:
> + def __init__(self, name):
> + self.name = name
> + self._tmpdir = None
> +
> + def __del__(self):
> + if self._tmpdir:
> + self.cmd("rm -rf " + self._tmpdir)
> + self._tmpdir = None
> +
> + def cmd(self, comm, *args):
> + c = cmd("ssh " + self.name + " " + shlex.quote(comm), *args)
> + return c.stdout, c.stderr, c.ret
If I read correctly the above will do a full ssh handshake for each
command. If the test script/setup is complex, I think/fear the overhead
could become a bit cumbersome.
Would using something alike Fabric to create a single connection at
endpoint instantiation time and re-using it for all the command be too
much?
Thanks,
Paolo
Powered by blists - more mailing lists