netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/5] selftests: forwarding: Introduce deferred commands
@ 2024-08-22 13:49 Petr Machata
  2024-08-22 13:49 ` [RFC PATCH net-next 1/5] " Petr Machata
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Petr Machata @ 2024-08-22 13:49 UTC (permalink / raw)
  To: Shuah Khan, linux-kselftest, netdev
  Cc: Jakub Kicinski, Ido Schimmel, Petr Machata, Amit Cohen,
	Benjamin Poirier, Hangbin Liu, Vladimir Oltean, mlxsw

Recently, a defer helper was added to Python selftests. The idea is to keep
cleanup commands close to their dirtying counterparts, thereby making it
more transparent what is cleaning up what, making it harder to miss a
cleanup, and make the whole cleanup business exception safe. All these
benefits are applicable to bash as well, exception safety can be
interpreted in terms of safety vs. a SIGINT.

This patchset therefore introduces a framework of several helpers that
serve to schedule cleanups in bash selftests.


As a personal remark. More than once was I bit by stop_traffic not getting
invoked because I C-c'd a traffic scheduler selftest at the wrong time.
This would leave behind a running mausezahn that would break follow-up runs
of the script that I was just debugging, making me question my sanity.
("How did this one extra debug print break the full script? And when I
remove it again, _why is it still broken_?") This is an attempt at
squashing this whole class of problems.


Patch #1 has more details about the primitives being introduced.

Patches #2 to #5 the convert several selftests to give an idea of how it
looks in practice.

Petr Machata (5):
  selftests: forwarding: Introduce deferred commands
  selftests: mlxsw: sch_red_core: Use defer for test cleanup
  selftests: mlxsw: sch_red_core: Use defer for stopping traffic
  selftests: mlxsw: sch_red_*: Use defer for qdisc management
  selftests: sch_tbf_core: Use defer for stopping traffic

 .../drivers/net/mlxsw/sch_red_core.sh         | 131 +++++++-----------
 .../drivers/net/mlxsw/sch_red_ets.sh          |  32 ++---
 .../drivers/net/mlxsw/sch_red_root.sh         |  24 +++-
 tools/testing/selftests/net/forwarding/lib.sh |  83 +++++++++++
 .../selftests/net/forwarding/sch_tbf_core.sh  |   3 +-
 5 files changed, 170 insertions(+), 103 deletions(-)

-- 
2.45.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-08-27 15:41 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 13:49 [RFC PATCH net-next 0/5] selftests: forwarding: Introduce deferred commands Petr Machata
2024-08-22 13:49 ` [RFC PATCH net-next 1/5] " Petr Machata
2024-08-26 10:35   ` Ido Schimmel
2024-08-26 14:25     ` Petr Machata
2024-08-26 20:03       ` Jakub Kicinski
2024-08-26 20:04         ` Jakub Kicinski
2024-08-26 13:09   ` Przemek Kitszel
2024-08-26 15:20     ` Petr Machata
2024-08-27  6:21       ` Przemek Kitszel
2024-08-27  8:53         ` Petr Machata
2024-08-27 14:17           ` Jakub Kicinski
2024-08-27 15:37             ` Petr Machata
2024-08-22 13:49 ` [RFC PATCH net-next 2/5] selftests: mlxsw: sch_red_core: Use defer for test cleanup Petr Machata
2024-08-26 11:37   ` Ido Schimmel
2024-08-22 13:49 ` [RFC PATCH net-next 3/5] selftests: mlxsw: sch_red_core: Use defer for stopping traffic Petr Machata
2024-08-26 12:01   ` Ido Schimmel
2024-08-22 13:49 ` [RFC PATCH net-next 4/5] selftests: mlxsw: sch_red_*: Use defer for qdisc management Petr Machata
2024-08-26 12:03   ` Ido Schimmel
2024-08-22 13:49 ` [RFC PATCH net-next 5/5] selftests: sch_tbf_core: Use defer for stopping traffic Petr Machata
2024-08-26 12:07   ` Ido Schimmel
2024-08-26 14:31     ` Petr Machata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).