Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: Unified pmem tests #5740

Merged
merged 4 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/pmem_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [[self-hosted, rhel],[self-hosted, opensuse]]
config: ['check TEST_BUILD=debug',
'check TEST_BUILD=nondebug',
'check TEST_BUILD=static-debug',
'check TEST_BUILD=static-nondebug',
'pycheck TEST_BUILD=debug',
'pycheck TEST_BUILD=release',
'pycheck TEST_BUILD=static_debug',
'pycheck TEST_BUILD=static_release']
config: ['debug', 'nondebug', 'static_debug', 'static_nondebug']
env:
WORKDIR: utils/gha-runners

Expand All @@ -42,5 +35,8 @@ jobs:
- name: Create testconfig files
run: ./$WORKDIR/create-testconfig.sh

- name: Run tests
run: make ${{ matrix.config }}
- name: Run tests check
run: make check TEST_BUILD=${{ matrix.config }}

- name: Run tests pycheck
run: make pycheck TEST_BUILD=${{ matrix.config }}
12 changes: 3 additions & 9 deletions .github/workflows/pmem_long.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ jobs:
fail-fast: false
matrix:
os: [[self-hosted, rhel],[self-hosted, opensuse]]
config: ['RUNTESTS.sh -t long -b debug',
'RUNTESTS.sh -t long -b nondebug',
'RUNTESTS.sh -t long -b static-debug',
'RUNTESTS.sh -t long -b static-nondebug',
'RUNTESTS.py -t long -b debug',
'RUNTESTS.py -t long -b release',
'RUNTESTS.py -t long -b static_debug',
'RUNTESTS.py -t long -b static_release']
script: ['sh', 'py']
build: [ 'debug', 'nondebug', 'static_debug', 'static_nondebug']

env:
WORKDIR: utils/gha-runners
Expand All @@ -44,4 +38,4 @@ jobs:
run: ./$WORKDIR/create-testconfig.sh

- name: Run tests
run: cd src/test/ && ./${{ matrix.config }}
run: cd src/test/ && ./RUNTESTS.${{ matrix.script }} -t long -b ${{ matrix.build }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run all tests (in python test framework) with 'force-enabled' valgrind.
# Run all tests with 'force-enabled' valgrind.
#
# This workflow is run on 'self-hosted' runners.
name: PMEM Valgrind python
name: PMEM Valgrind

on:
workflow_dispatch:
Expand All @@ -10,15 +10,16 @@ on:

jobs:
linux:
name: PMEM_valgrind_py
name: PMEM_valgrind
if: github.repository == 'pmem/pmdk'
runs-on: ${{ matrix.os }}
timeout-minutes: 4320 # wait max 3 days
strategy:
fail-fast: false
matrix:
script: ['sh', 'py']
config: ['drd', 'pmemcheck', 'memcheck', 'helgrind']
build: ['debug', 'release', 'static_debug', 'static_release']
build: ['debug', 'nondebug', 'static_debug', 'static_nondebug']
os: [[self-hosted, rhel],[self-hosted, opensuse]]

env:
Expand All @@ -38,4 +39,4 @@ jobs:
run: ./$WORKDIR/create-testconfig.sh

- name: Run tests
run: cd src/test/ && ./RUNTESTS.py --force-enable ${{ matrix.config }} -b ${{ matrix.build }}
run: cd src/test/ && ./RUNTESTS.${{ matrix.script }} --force-enable ${{ matrix.config }} -b ${{ matrix.build }}
41 changes: 0 additions & 41 deletions .github/workflows/pmem_valgrind_sh.yml

This file was deleted.

2 changes: 1 addition & 1 deletion doc/pmempool/pmempool.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ In order to get more information about specific *command* you can use **pmempool

The debug logs are available only in the debug version of the tool,
which is not provided by binary packages, but can be built from sources.
The **pmempool.static-debug** binary blob can be found
The **pmempool.static_debug** binary blob can be found
in the 'src/tools/pmempool/' subdirectory.

+ **PMEMPOOL_TOOL_LOG_LEVEL**
Expand Down
4 changes: 2 additions & 2 deletions src/test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ testconfig.py
*.log
testfile*
# ignore static binaries generated for testing
*.static-debug
*.static-nondebug
*.static_debug
*.static_nondebug
libs.tar
*.synced
.sync-dir
Expand Down
6 changes: 3 additions & 3 deletions src/test/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ ifeq ($(COMPILE_LANG), cpp)
LINKER=$(CXX)
endif

SUFFIX_STATIC_DEBUG=static-debug
SUFFIX_STATIC_NONDEBUG=static-nondebug
SUFFIX_STATIC_DEBUG=static_debug
SUFFIX_STATIC_NONDEBUG=static_nondebug

ifneq ($(TARGET),)
#
Expand Down Expand Up @@ -610,7 +610,7 @@ TSTCHECKS=$(shell ls -1 TEST* 2> /dev/null | grep '^TEST[0-9]\+$$' | sort -V)
TSTCHECKSPY=$(shell test -f TESTS.py && cd .. && ./RUNTESTS.py --list-testcases $(TST) | while read name; do echo py/$$name; done)

$(TSTCHECKSPY):
@cd .. && ./RUNTESTS.py $(subst nondebug,release,$(RUNTEST_OPTIONS)) -u $(shell echo $@ | sed 's/^py\/[^0-9]*\([0-9]*\)$$/\1/') -- ${TST}
@cd .. && ./RUNTESTS.py $(RUNTEST_OPTIONS) -u $(shell echo $@ | sed 's/^py\/[^0-9]*\([0-9]*\)$$/\1/') -- ${TST}

$(TSTCHECKS): sync-test
@cd .. && ./RUNTESTS.sh ${TST} $(RUNTEST_OPTIONS) -s $@
Expand Down
18 changes: 9 additions & 9 deletions src/test/README
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ how RUNTESTS.sh will run a test, use the -n option. For example:
$ RUNTESTS.sh -n blk_nblock -s TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=debug ./TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=static-debug ./TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=static-nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=static_debug ./TEST0
(in ./blk_nblock) TEST=check FS=none BUILD=static_nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=debug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=static-debug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=static-nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=static_debug ./TEST0
(in ./blk_nblock) TEST=check FS=pmem BUILD=static_nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=debug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=static-debug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=static-nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=static_debug ./TEST0
(in ./blk_nblock) TEST=check FS=non-pmem BUILD=static_nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=debug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=static-debug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=static-nondebug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=static_debug ./TEST0
(in ./blk_nblock) TEST=check FS=any BUILD=static_nondebug ./TEST0

Notice how the TEST0 script is run repeatedly with different settings for
the three environment variables TEST, FS, and BUILD, providing the test type,
Expand All @@ -68,7 +68,7 @@ RUNTESTS.sh takes options to limit what it runs. The usage is:
[ --force-enable memcheck|pmemcheck|helgrind|drd ]] [ -c ]
[tests...]

Build types are: debug, nondebug, static-debug, static-nondebug, all (default)
Build types are: debug, nondebug, static_debug, static_nondebug, all (default)
Test types are: check (default), short, medium, long, all
where: check = short + medium; all = short + medium + long
File system types are: none, pmem, non-pmem, any, all (default)
Expand Down
8 changes: 4 additions & 4 deletions src/test/RUNTESTS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Usage: $0 [ -hnv ] [ -b build-type ] [ -t test-type ] [ -f fs-type ]
-n dry run
-v be verbose
-b build-type run only specified build type
build-type: debug, nondebug, static-debug, static-nondebug, all (default)
build-type: debug, nondebug, static_debug, static_nondebug, all (default)
-t test-type run only specified test type
test-type: check (default), short, medium, long, all
where: check = short + medium; all = short + medium + long
Expand Down Expand Up @@ -291,7 +291,7 @@ runtest() {
}

fss=$(intersection "$fstype" "$req_fstype" "none pmem non-pmem any")
builds=$(intersection "$buildtype" "$req_buildtype" "debug nondebug static-debug static-nondebug")
builds=$(intersection "$buildtype" "$req_buildtype" "debug nondebug static_debug static_nondebug")

# for each fs-type being tested...
for fs in $fss
Expand Down Expand Up @@ -384,7 +384,7 @@ verbose_tests=
[ -n "$KEEP_GOING" ] && keep_going=$KEEP_GOING
[ -n "$VERBOSE_TESTS" ] && verbose_tests="$VERBOSE_TESTS"

PMEMDETECT="tools/pmemdetect/pmemdetect.static-nondebug"
PMEMDETECT="tools/pmemdetect/pmemdetect.static_nondebug"
pmemdetect() {
LD_LIBRARY_PATH=$LIBNDCTL_LD_LIBRARY_PATHS:$LD_LIBRARY_PATH $PMEMDETECT "$@"
}
Expand Down Expand Up @@ -475,7 +475,7 @@ do
buildtype="$buildtype $2"
case "$2"
in
debug|nondebug|static-debug|static-nondebug|all)
debug|nondebug|static_debug|static_nondebug|all)
;;
*)
usage "bad build-type: $buildtype"
Expand Down
2 changes: 1 addition & 1 deletion src/test/ex_libpmem2/TESTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from testframework import granularity as g


@t.require_build(['debug', 'release'])
@t.require_build(['debug', 'nondebug'])
class EX_LIBPMEM2(t.Test):
test_type = t.Medium
file_size = 1 * t.MiB
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_debug/TEST0 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

setup
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_debug/TEST1 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

setup
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_debug/TEST2 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

# test causes 5 pmemcheck errors by design
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_debug/TEST3 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

setup
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation
# Copyright 2015-2023, Intel Corporation

#
# src/test/obj_debug/TEST4 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

setup
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_debug/TEST5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2019, Intel Corporation
# Copyright 2016-2023, Intel Corporation

#
# src/test/obj_debug/TEST5 -- unit test for debug features
Expand All @@ -9,7 +9,7 @@
. ../unittest/unittest.sh

require_test_type medium
require_build_type debug static-debug
require_build_type debug static_debug
require_fs_type any

FUNCS=17
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_fragmentation2/TESTS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!../env.py
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2019-2020, Intel Corporation
# Copyright 2019-2023, Intel Corporation
#

from os import path
Expand All @@ -10,7 +10,7 @@


@g.require_granularity(g.CACHELINE)
@t.require_build('release')
@t.require_build('nondebug')
class Base(t.Test):
test_type = t.Long
seed = '12345'
Expand Down
4 changes: 2 additions & 2 deletions src/test/obj_ulog_size/TESTS.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!../env.py
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2019-2020, Intel Corporation
# Copyright 2019-2023, Intel Corporation


import testframework as t


@t.require_build(['debug', 'release'])
@t.require_build(['debug', 'nondebug'])
class BASE(t.Test):
test_type = t.Medium

Expand Down
Loading
Loading