RFC selftests: forwarding: Introduce deferred commands
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | selftests: forwarding: Introduce deferred commandstools/ | +83 | 10 replies | |
| 2/5 | selftests: mlxsw: sch_red_core: Use defer for test cleanuptools/ | +37 | 1 reply | |
| 3/5 | selftests: mlxsw: sch_red_core: Use defer for stopping traffictools/ | +14 | 1 reply | |
| 4/5 | selftests: mlxsw: sch_red_*: Use defer for qdisc managementtools/ tools/ | +34 | 1 reply | |
| 5/5 | selftests: sch_tbf_core: Use defer for stopping traffictools/ | +2 | 2 replies |
Reviews trailers per patch
3 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Ido Schimmel |
|---|---|
| 1/5 | |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | R-b |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH net-next 0/5] selftests: forwarding: Introduce deferred commands
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(-)
Signature · 1 line
2.45.0