mbox series

[0/3] selftests/resctrl: Simplify test cleanup functions

Message ID cover.1708434017.git.maciej.wieczor-retman@intel.com (mailing list archive)
Headers show
Series selftests/resctrl: Simplify test cleanup functions | expand

Message

Maciej Wieczor-Retman Feb. 20, 2024, 1:14 p.m. UTC
Cleaning up after tests is implemented separately for individual tests
and called at the end of each test execution. Since these functions are
very similar and a more generalized test framework was introduced a
function pointer in the resctrl_test struct can be used to reduce the
amount of function calls.

These functions are also all called in the ctrl-c handler because the
handler isn't aware which test is currently running. Since the handler
is implemented with a sigaction no function parameters can be passed
there but information about what test is currently running can be passed
with a global variable.

Maciej Wieczor-Retman (3):
  selftests/resctrl: Add cleanup function to test framework
  selftests/resctrl: Simplify cleanup in ctrl-c handler
  selftests/resctrl: Move cleanups out of individual tests

 tools/testing/selftests/resctrl/cat_test.c    |  5 ++---
 tools/testing/selftests/resctrl/cmt_test.c    |  4 ++--
 tools/testing/selftests/resctrl/mba_test.c    |  5 ++---
 tools/testing/selftests/resctrl/mbm_test.c    |  5 ++---
 tools/testing/selftests/resctrl/resctrl.h     |  8 +++----
 .../testing/selftests/resctrl/resctrl_tests.c | 22 ++++++++++---------
 tools/testing/selftests/resctrl/resctrl_val.c |  2 +-
 7 files changed, 25 insertions(+), 26 deletions(-)

Comments

Maciej Wieczor-Retman Feb. 20, 2024, 1:18 p.m. UTC | #1
I forgot to add to the cover letter that this series applies cleanly on both
kselftests/next and on top of my other series [1] currently in review.

[1] https://lore.kernel.org/all/cover.1708072203.git.maciej.wieczor-retman@intel.com/