From 9544998f34c836436f4f0599be83e31c4de0b63a Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Wed, 18 Dec 2024 09:55:14 +0100 Subject: [PATCH 1/4] Run only given tests/examples under valgrind Signed-off-by: Lukasz Dorau --- test/test_valgrind.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/test_valgrind.sh b/test/test_valgrind.sh index be5f817dc3..1b1675bd13 100755 --- a/test/test_valgrind.sh +++ b/test/test_valgrind.sh @@ -8,11 +8,16 @@ set -e WORKSPACE=$1 BUILD_DIR=$2 TOOL=$3 +TESTS=$4 function print_usage() { - echo "$(basename $0) - run all UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)" - echo "This script looks for './test/umf_test-*' and './examples/umf_example_*' executables in the UMF build directory." - echo "Usage: $(basename $0) " + echo "$(basename $0) - run UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)" + echo "Usage: $(basename $0) [tests_examples]" + echo "Where:" + echo + echo "tests_examples - (optional) list of tests or examples to be run (paths relative to the build directory)." + echo " If it is empty, all tests (./test/umf_test-*) and examples (./examples/umf_example_*)" + echo " found in will be run." } if ! valgrind --version > /dev/null; then @@ -71,7 +76,14 @@ echo "Running: \"valgrind $OPTION\" for the following tests:" ANY_TEST_FAILED=0 rm -f umf_test-*.log umf_test-*.err -for test in $(ls -1 ./test/umf_test-* ./examples/umf_example_*); do +[ "$TESTS" = "" ] && TESTS=$(ls -1 ./test/umf_test-* ./examples/umf_example_*) + +for test in $TESTS; do + if [ ! -f $test ]; then + echo + echo "error: the $test (${BUILD_DIR}/$test) file does not exist" + exit 1 + fi [ ! -x $test ] && continue echo "$test - starting ..." echo -n "$test " From 083252af8090fae73eb6a0450fdcfe2cb16bc909 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Wed, 18 Dec 2024 10:58:26 +0100 Subject: [PATCH 2/4] Silence hwloc-gather-cpuid Signed-off-by: Lukasz Dorau --- test/test_valgrind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_valgrind.sh b/test/test_valgrind.sh index 1b1675bd13..46bfe7d1cc 100755 --- a/test/test_valgrind.sh +++ b/test/test_valgrind.sh @@ -67,7 +67,7 @@ cd ${BUILD_DIR} mkdir -p cpuid echo "Gathering data for hwloc so it can be run under valgrind:" -hwloc-gather-cpuid ./cpuid +hwloc-gather-cpuid ./cpuid >/dev/null echo echo "Working directory: $(pwd)" From 9f6f8ba08f1ccd248a81c8fdcdd55b0af56201c3 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Wed, 18 Dec 2024 10:12:18 +0100 Subject: [PATCH 3/4] Run DAX tests under valgrind Signed-off-by: Lukasz Dorau --- .github/workflows/reusable_dax.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/reusable_dax.yml b/.github/workflows/reusable_dax.yml index af15226d29..f7f4fbe508 100644 --- a/.github/workflows/reusable_dax.yml +++ b/.github/workflows/reusable_dax.yml @@ -31,6 +31,7 @@ env: INSTL_DIR : "${{github.workspace}}/../install-dir" COVERAGE_DIR : "${{github.workspace}}/coverage" COVERAGE_NAME : "exports-coverage-dax" + DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory" jobs: dax: @@ -126,6 +127,12 @@ jobs: UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}} ctest -C ${{matrix.build_type}} -V -R "file|fsdax" + - name: Run DAX tests under valgrind + run: | + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.DAX_TESTS}}" + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.DAX_TESTS}}" + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.DAX_TESTS}}" + - name: Check coverage if: ${{ matrix.build_type == 'Debug' }} working-directory: ${{env.BUILD_DIR}} From 96b00eef47eef0bd65d4df5e55a17e5794780361 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Thu, 19 Dec 2024 11:20:16 +0100 Subject: [PATCH 4/4] Run NUMA tests under valgrind Signed-off-by: Lukasz Dorau --- .github/workflows/reusable_multi_numa.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/reusable_multi_numa.yml b/.github/workflows/reusable_multi_numa.yml index f654789843..f546b05451 100644 --- a/.github/workflows/reusable_multi_numa.yml +++ b/.github/workflows/reusable_multi_numa.yml @@ -10,6 +10,7 @@ env: BUILD_DIR : "${{github.workspace}}/build" COVERAGE_DIR : "${{github.workspace}}/coverage" COVERAGE_NAME : "exports-coverage-multinuma" + NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes" jobs: multi_numa: @@ -68,6 +69,13 @@ jobs: ./test/umf_test-provider_os_memory_multiple_numa_nodes \ --gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave" + - name: Run NUMA tests under valgrind + if: matrix.os != 'rhel-9.1' + run: | + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.NUMA_TESTS}}" + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.NUMA_TESTS}}" + ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.NUMA_TESTS}}" + - name: Check coverage if: ${{ matrix.build_type == 'Debug' && matrix.os == 'ubuntu-22.04' }} working-directory: ${{env.BUILD_DIR}}