From 536fbba627b541b33cfc9c2663fa7ee98fcca6d8 Mon Sep 17 00:00:00 2001 From: "Welton, Benjamin" Date: Wed, 15 Jan 2025 23:51:06 -0800 Subject: [PATCH] [SWDEV-509659] Skip rocprof device counting tests if lacking permissions (#125) * [SWDEV-509659] Skip rocprof device counting tests if lacking permissions Skips non-intercept test if proper permissions are not obtained (SYS_PERFMON). This should be the only test that fails due to permission issues (others do not require the IOCTL to pass). Regex match sample: https://regexr.com/8b29s * Update source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt Co-authored-by: Madsen, Jonathan * fix * Update source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt --------- Co-authored-by: Benjamin Welton Co-authored-by: Madsen, Jonathan --- .../lib/rocprofiler-sdk/counters/tests/CMakeLists.txt | 11 ++++++++++- .../counters/tests/device_counting.cpp | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt index b9057f9e54..7583c753c1 100644 --- a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt +++ b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt @@ -83,7 +83,16 @@ gtest_add_tests( TEST_LIST counter-tests_TESTS WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -set_tests_properties(${counter-tests_TESTS} PROPERTIES TIMEOUT 45 LABELS "unittests") +set_tests_properties( + ${counter-tests_TESTS} + PROPERTIES + TIMEOUT + 45 + LABELS + "unittests" + SKIP_REGULAR_EXPRESSION + "Running non-intercept test(.*)could not be locked for profiling due to lack of permissions.*" + ) set(ROCPROFILER_LIB_CONSUMER_TEST_SOURCES consumer_test.cpp) diff --git a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp index 332e8adbc1..65dde525e1 100644 --- a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp +++ b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp @@ -705,6 +705,7 @@ TEST_F(device_counting_service_test, sync_sq_waves_verify_non_intercept) GTEST_SKIP(); } + ROCP_WARNING << "Running non-intercept test"; test_run(ROCPROFILER_COUNTER_FLAG_NONE, {"SQ_WAVES_sum"}, 50000, true); auto local_recs = global_recs().rlock([](const auto& data) { return data; }); ROCP_WARNING << local_recs.size();