selftests: tc-testing: cleanup on Ctrl-C
authorPedro Tammela <pctammela@mojatatu.com>
Fri, 24 Nov 2023 15:42:47 +0000 (12:42 -0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Nov 2023 02:15:43 +0000 (18:15 -0800)
commit501679f5d4a433144ae755dd2e5f757b1ce5a152
tree73191fd874c2c606b381fcd6fe879115a8e20417
parent56e16bc69bb7d36a931111d8abdcd44b939751c4
selftests: tc-testing: cleanup on Ctrl-C

Cleanup net namespaces and other resources if we get a SIGINT (Ctrl-C).
As user visible resources are allocated on a per test basis, it's only
required to catch this condition when (possibly) running tests.

So far calling post_suite is enough to free up anything that might
linger.

A missing keyword replacement for nsPlugin is also included.

Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20231124154248.315470-5-pctammela@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py
tools/testing/selftests/tc-testing/tdc.py