Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-07 Thread David Ahern
On 12/7/23 3:34 AM, Petr Machata wrote: > But what I object against is that the library uses trap without having a > way for user scripts to schedule at-exit work, because that's used > literally everywhere in forwarding tests. +1

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-07 Thread Petr Machata
Paolo Abeni writes: > On Wed, 2023-12-06 at 13:32 +0100, Petr Machata wrote: >> Paolo Abeni writes: >> >> > Side note for a possible follow-up: if you maintain $ns_list as global >> > variable, and remove from such list the ns deleted by cleanup_ns, you >> > could remove the cleanup trap

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-06 Thread Paolo Abeni
On Wed, 2023-12-06 at 13:32 +0100, Petr Machata wrote: > Paolo Abeni writes: > > > Side note for a possible follow-up: if you maintain $ns_list as global > > variable, and remove from such list the ns deleted by cleanup_ns, you > > could remove the cleanup trap from the individual test with

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-06 Thread Petr Machata
Paolo Abeni writes: > Side note for a possible follow-up: if you maintain $ns_list as global > variable, and remove from such list the ns deleted by cleanup_ns, you > could remove the cleanup trap from the individual test with something > alike: > > final_cleanup_ns() > { > cleanup_ns

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-05 Thread Hangbin Liu
On Tue, Dec 05, 2023 at 01:00:29PM +0100, Paolo Abeni wrote: > > +cleanup_ns() > > +{ > > + local ns="" > > + local errexit=0 > > + local ret=0 > > + > > + # disable errexit temporary > > + if [[ $- =~ "e" ]]; then > > + errexit=1 > > + set +e > > + fi > > + > > +

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-05 Thread Paolo Abeni
On Sat, 2023-12-02 at 10:00 +0800, Hangbin Liu wrote: > Add a lib.sh for net selftests. This file can be used to define commonly > used variables and functions. Some commonly used functions can be moved > from forwarding/lib.sh to this lib file. e.g. busywait(). > > Add function setup_ns() for

[PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-01 Thread Hangbin Liu
Add a lib.sh for net selftests. This file can be used to define commonly used variables and functions. Some commonly used functions can be moved from forwarding/lib.sh to this lib file. e.g. busywait(). Add function setup_ns() for user to create unique namespaces with given prefix name.