Re: [PATCH net-next v2 1/2] selftests: drv-net: add path helper for net/lib

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

 



Jakub Kicinski wrote:
> On Thu, 6 Mar 2025 17:22:47 -0500 Willem de Bruijn wrote:
> > > +    def lpath(self, path):
> > > +        """
> > > +        Similar to rpath, but for files in net/lib TARGET.
> > > +        """
> > > +        lib_dir = (Path(__file__).parent / "../../../../net/lib").resolve()
> > > +        return (lib_dir / path).as_posix()
> > > +  
> > 
> > small nit that one letter acronyms are not the most self describing ;)
> > I would initially read this as local path
> 
> The other option that came to mind was to have one helper called path()
> and pass rel=CONST to it. For example:
> 
> 	prog = cfg.path("xdp_dummy.bpf.o", rel=cfg.NET_LIB)
> 
> Thinking about it now we could also store dir directly, which is
> probably most "Pythonic"?
> 
> 	prog = cfg.net_lib_dir / "xdp_dummy.bpf.o"
> 
> Thoughts?

The pythonic approach is nice. No function indirection, so self explanatory.
But they all are reasonable, of course.




[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