Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux