Improve CRC test robustness with stop-on-fail and cleanup helpers
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 3 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH i-g-t v1 00/17] Improve CRC test robustness with stop-on-fail and cleanup helpers
This patch series introduces two new helper functions to improve the robustness and maintainability of CRC-based tests throughout the IGT test suite.
CRC-based tests are critical for verifying display functionality, but improper handling of CRC failures can lead to:
- CRC buffer overflows when CRC collection continues after assertion failures
- Resource leaks from incomplete cleanup of pipe_crc objects
- Test hangs when pipe CRC remains active after failures
- Inconsistent cleanup patterns across different tests
Two new helper functions address these issues:
1. igt_assert_crc_equal_stop_on_fail(): Automatically stops CRC collection before assertion on mismatch, preventing buffer overflow and ensuring clean test termination when CRC values don't match.
2. igt_pipe_crc_cleanup(): Safely cleans up pipe_crc objects by:
- Checking if CRC collection is active before stopping
- Properly freeing allocated resources
- Clearing the caller's pointer to prevent use-after-free bugs
- Handling NULL/uninitialized pointers gracefully
These functions are designed to be used consistently across all CRC tests and in fixture teardown paths, ensuring reliable resource management and preventing cascading failures when CRC mismatches occur.
Sowmiya S (17):
lib/igt_pipe_crc: Add CRC stop-on-fail assertion and cleanup helper tests/intel/kms_big_fb: Use CRC stop-on-fail assertion and cleanup
helper
tests/intel/kms_fbc_dirty_rect: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_flip_scaled_crc: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_flip_tiling: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_pipe_stress: Use CRC stop-on-fail assertion and
cleanup helper
tests/kms_async_flips: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_atomic: Use CRC stop-on-fail assertion and cleanup helper tests/kms_cursor_crc: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_cursor_edge_walk: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_cursor_legacy: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_pipe_crc_basic: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_plane: Use CRC stop-on-fail assertion and cleanup helper tests/kms_plane_alpha_blend: Use CRC stop-on-fail assertion and
cleanup helper
tests/kms_plane_cursor: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_plane_multiple: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_rotation_crc: Use CRC stop-on-fail assertion and cleanup
helper
lib/igt_pipe_crc.c | 50 +++++++++++++++++++++++++++++++ lib/igt_pipe_crc.h | 4 +++ tests/intel/kms_big_fb.c | 5 ++-- tests/intel/kms_fbc_dirty_rect.c | 16 +++++----- tests/intel/kms_flip_scaled_crc.c | 17 +++-------- tests/intel/kms_flip_tiling.c | 17 +++-------- tests/intel/kms_pipe_stress.c | 8 +++-- tests/kms_async_flips.c | 6 ++-- tests/kms_atomic.c | 16 +++++----- tests/kms_cursor_crc.c | 30 +++++++++---------- tests/kms_cursor_edge_walk.c | 6 ++-- tests/kms_cursor_legacy.c | 11 ++++--- tests/kms_pipe_crc_basic.c | 15 ++++------ tests/kms_plane.c | 19 +++++------- tests/kms_plane_alpha_blend.c | 31 +++++++++---------- tests/kms_plane_cursor.c | 6 ++-- tests/kms_plane_multiple.c | 20 +++++-------- tests/kms_rotation_crc.c | 25 ++++++++-------- 18 files changed, 165 insertions(+), 137 deletions(-)
Signature · 1 line
2.43.0