From 7413043e778cf3fcd34de777e9246a041d844eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oksana=20Sa=C5=82yk?= Date: Tue, 4 Nov 2025 12:35:56 +0100 Subject: [PATCH 01/13] common: split the pmem_tests workflow + update execution times (#21) Signed-off-by: Oksana Salyk --- .github/workflows/pmem_tests_1.yml | 4 ++-- .github/workflows/pmem_tests_2.yml | 19 ++++--------------- .github/workflows/pmem_tests_3.yml | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/pmem_tests_3.yml diff --git a/.github/workflows/pmem_tests_1.yml b/.github/workflows/pmem_tests_1.yml index aeb3db545..96ca60e47 100644 --- a/.github/workflows/pmem_tests_1.yml +++ b/.github/workflows/pmem_tests_1.yml @@ -6,8 +6,8 @@ name: PMEM tests part 1 on: workflow_dispatch: schedule: - # run this job at 18:00 UTC every other day (even-numbered) - - cron: '0 18 2-31/2 * *' + # run this job at 18:00 UTC every Friday + - cron: '0 18 * * 5' permissions: {} diff --git a/.github/workflows/pmem_tests_2.yml b/.github/workflows/pmem_tests_2.yml index 5f6f217b4..42d04e70f 100644 --- a/.github/workflows/pmem_tests_2.yml +++ b/.github/workflows/pmem_tests_2.yml @@ -6,8 +6,8 @@ name: PMEM tests part 2 on: workflow_dispatch: schedule: - # run this job at 18:00 UTC every other day (odd-numbered) - - cron: '0 18 */2 * *' + # run this job at 6:00 UTC every Saturday + - cron: '0 6 * * 6' permissions: {} @@ -19,16 +19,5 @@ jobs: with: force_enable: '["pmemcheck", "memcheck"]' valgrind: 1 - # 12h = 720m (arbitrarily picked in hope it will be enough). - timeout_minutes: 720 - - - # Test the default build with force-enabled Valgrind tooling for thread error - # detection. - Thread: - uses: ./.github/workflows/pmem_test_matrix.yml - with: - force_enable: '["drd", "helgrind"]' - valgrind: 1 - # 12h = 720m (arbitrarily picked in hope it will be enough). - timeout_minutes: 720 + # 24h = 1440m (arbitrarily picked in hope it will be enough). + timeout_minutes: 1440 diff --git a/.github/workflows/pmem_tests_3.yml b/.github/workflows/pmem_tests_3.yml new file mode 100644 index 000000000..f46ec4587 --- /dev/null +++ b/.github/workflows/pmem_tests_3.yml @@ -0,0 +1,23 @@ +# Run all tests on PMEM. +# +# This workflow is run on 'self-hosted' runners. +name: PMEM tests part 3 + +on: + workflow_dispatch: + schedule: + # run this job at 6:00 UTC every Sunday + - cron: '0 6 * * 0' + +permissions: {} + +jobs: + # Test the default build with force-enabled Valgrind tooling for thread error + # detection. + Thread: + uses: ./.github/workflows/pmem_test_matrix.yml + with: + force_enable: '["drd", "helgrind"]' + valgrind: 1 + # 24h = 1440m (arbitrarily picked in hope it will be enough). + timeout_minutes: 1440 From 002981b7e7f22de79257fed737a80e0b147d9967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oksana=20Sa=C5=82yk?= Date: Wed, 19 Nov 2025 15:52:50 +0100 Subject: [PATCH 02/13] Split pmem_test_3.yml and update README.md file (#23) Signed-off-by: Oksana Salyk --- .github/workflows/pmem_tests_3.yml | 2 +- .github/workflows/pmem_tests_4.yml | 23 +++++++++++++++++++++++ README.md | 13 ++++++------- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/pmem_tests_4.yml diff --git a/.github/workflows/pmem_tests_3.yml b/.github/workflows/pmem_tests_3.yml index f46ec4587..ae15cdd9a 100644 --- a/.github/workflows/pmem_tests_3.yml +++ b/.github/workflows/pmem_tests_3.yml @@ -17,7 +17,7 @@ jobs: Thread: uses: ./.github/workflows/pmem_test_matrix.yml with: - force_enable: '["drd", "helgrind"]' + force_enable: '["helgrind"]' valgrind: 1 # 24h = 1440m (arbitrarily picked in hope it will be enough). timeout_minutes: 1440 diff --git a/.github/workflows/pmem_tests_4.yml b/.github/workflows/pmem_tests_4.yml new file mode 100644 index 000000000..451a26e97 --- /dev/null +++ b/.github/workflows/pmem_tests_4.yml @@ -0,0 +1,23 @@ +# Run all tests on PMEM. +# +# This workflow is run on 'self-hosted' runners. +name: PMEM tests part 4 + +on: + workflow_dispatch: + schedule: + # run this job at 6:00 UTC every Monday + - cron: '0 6 * * 1' + +permissions: {} + +jobs: + # Test the default build with force-enabled Valgrind tooling for thread error + # detection. + Thread: + uses: ./.github/workflows/pmem_test_matrix.yml + with: + force_enable: '["drd"]' + valgrind: 1 + # 24h = 1440m (arbitrarily picked in hope it will be enough). + timeout_minutes: 1440 diff --git a/README.md b/README.md index af2ebb2bb..011f45aa1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ [![Scans](https://github.com/daos-stack/pmdk/actions/workflows/scans.yml/badge.svg?branch=master)](https://github.com/daos-stack/pmdk/actions/workflows/scans.yml) [![PMem test 1](https://github.com/daos-stack/pmdk/workflows/PMEM%20tests%20part%201/badge.svg)](https://github.com/daos-stack/pmdk/actions/workflows/pmem_tests_1.yml) [![PMem test 2](https://github.com/daos-stack/pmdk/workflows/PMEM%20tests%20part%202/badge.svg)](https://github.com/daos-stack/pmdk/actions/workflows/pmem_tests_2.yml) +[![PMem test 3](https://github.com/daos-stack/pmdk/workflows/PMEM%20tests%20part%203/badge.svg)](https://github.com/daos-stack/pmdk/actions/workflows/pmem_tests_3.yml) +[![PMem test 4](https://github.com/daos-stack/pmdk/workflows/PMEM%20tests%20part%204/badge.svg)](https://github.com/daos-stack/pmdk/actions/workflows/pmem_tests_4.yml) The **Persistent Memory Development Kit (PMDK)** is a collection of libraries and tools for System Administrators and Application Developers to simplify managing and accessing persistent memory devices. For more information, see https://pmem.io. @@ -107,10 +109,7 @@ information on this port, contact Rajalakshmi Srinivasaraghavan ## Contact Us -For more information on this library, contact -Tomasz Gromadzki (tomasz.gromadzki@intel.com), -Jan Michalski (jan.michalski@intel.com), -Oksana Sałyk (oksana.salyk@intel.com), -Piotr Balcer (piotr.balcer@intel.com), -Andy Rudoff (andy.rudoff@intel.com), or post to -the [Persistent Memory Programming Google group](https://groups.google.com/group/pmem). +For more information on this project, contact +Tomasz Gromadzki (tomasz.gromadzki@hpe.com), +Jan Michalski (jan-marian.michalski@hpe.com), or +Oksana Sałyk (oksana.salyk@hpe.com). From b28304d4ee3a270ae34f91b4032e91d430f3255a Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Mon, 27 Oct 2025 13:17:46 +0100 Subject: [PATCH 03/13] common: 2.1.2-rc1 release Signed-off-by: Oksana Salyk --- ChangeLog | 4 ++-- GIT_VERSION | 1 - VERSION | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 GIT_VERSION create mode 100644 VERSION diff --git a/ChangeLog b/ChangeLog index ce59cf04e..e830500a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ -XXX +Mon Oct 27 2025 Oksana Sałyk - * Version X.X.X + * Version 2.1.2 - Set up a new home for pmdk software (pmem/pmdk -> daos-stack/pmdk). - Reorganized PMem HW tests to accommodate changes in HW supplies (daos-stack/pmdk#9-12). diff --git a/GIT_VERSION b/GIT_VERSION deleted file mode 100644 index 6002f22fa..000000000 --- a/GIT_VERSION +++ /dev/null @@ -1 +0,0 @@ -$Format:%h$ \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..b4fa50362 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.2-rc1 From 1baf4207baec00f7f91d82dfbc93e59f7eeb9764 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Mon, 27 Oct 2025 13:19:22 +0100 Subject: [PATCH 04/13] common: git versions --- GIT_VERSION | 1 + VERSION | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 GIT_VERSION delete mode 100644 VERSION diff --git a/GIT_VERSION b/GIT_VERSION new file mode 100644 index 000000000..6002f22fa --- /dev/null +++ b/GIT_VERSION @@ -0,0 +1 @@ +$Format:%h$ \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index b4fa50362..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.1.2-rc1 From 7f2bd15333fb797f55cbf203523b0b851c956ea7 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Tue, 4 Nov 2025 14:54:33 +0100 Subject: [PATCH 05/13] common: 2.1.2 release Signed-off-by: Oksana Salyk --- ChangeLog | 2 +- GIT_VERSION | 1 - INSTALL.md | 2 +- VERSION | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 GIT_VERSION create mode 100644 VERSION diff --git a/ChangeLog b/ChangeLog index e830500a7..95ca8e718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Mon Oct 27 2025 Oksana Sałyk +Tue Nov 4 2025 Oksana Sałyk * Version 2.1.2 diff --git a/GIT_VERSION b/GIT_VERSION deleted file mode 100644 index 6002f22fa..000000000 --- a/GIT_VERSION +++ /dev/null @@ -1 +0,0 @@ -$Format:%h$ \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md index be172ae11..b081d0bc8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -39,7 +39,7 @@ cd pmdk For a stable version, checkout a [release tag](https://github.com/pmem/pmdk/releases) as follows. Otherwise skip this step to build the latest development release. ```sh -git checkout tags/2.1.1 +git checkout tags/2.1.2 ``` Once all required [dependencies](#dependencies) are installed, PMDK is built using the diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..eca07e4c1 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.2 From e25cd3e4bba30cb3fd6bb996ebbc4a77fba3778a Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Tue, 4 Nov 2025 14:56:39 +0100 Subject: [PATCH 06/13] common: git versions Signed-off-by: Oksana Salyk --- GIT_VERSION | 1 + VERSION | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 GIT_VERSION delete mode 100644 VERSION diff --git a/GIT_VERSION b/GIT_VERSION new file mode 100644 index 000000000..6002f22fa --- /dev/null +++ b/GIT_VERSION @@ -0,0 +1 @@ +$Format:%h$ \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index eca07e4c1..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.1.2 From 6ae6b4c7d65231d8c2d95bac629911724a4ba7a9 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Thu, 20 Nov 2025 18:56:49 +0000 Subject: [PATCH 07/13] obj: make sure footers are written for all huge memory blocks on... ... chunk reinit Issue Huge memory blocks with the header chunk of type CHUNK_TYPE_FREE had not reinitialized their footer chunk. Context - Allocator divides the available space into zones and zones into smaller chunks. - All chunk headers belonging to a single zone are stored in an array. - Chunk header describes its: type, size_idx and flags. - Chunk can be of a few types. The types important for this patch are: CHUNK_TYPE_FOOTER, CHUNK_TYPE_FREE, and CHUNK_TYPE_USED. - CHUNK_TYPE_FREE and _USED are chunk types marking the beginning of so called huge memory block. This means this chunk and a number of chunks following it (size_idx) constitues a single allocation or a free memory. - The last chunk belonging to a huge memory block ought to be of type CHUNK_TYPE_FOOTER. Its size_idx allows to easily find the first chunk belonging to this huge memory block and determine the huge memory block type. - Huge memory blocks' footers are written immediately but persited lazily. It is not a problem at runtime since the footers are there at runtime. But in case of a crash the footers may be not persisted properly and missing on open. So, when the allocator is booted up it recreates footers just in case any of them is missing. Note: The huge memory block's first chunk header and the last chunk header (footer) are not written nor persisted in any way transactionally. The first chunk header occupies only 8 bytes so it is written and persisted atomically. But its footer is written independently and not explicitly persisted. Note: The first chunk header contains all the required info to recreate footer. The last chunk header is there only to make huge memory blocks coalescing easier to compute. Reading the footer allows to immediately find the memory block leaving just before the memory block which neighbours one might want to find. This patch makes sure the huge memory block's footer is recreated no matter whather its type is CHUNK_TYPE_FREE or CHUNK_TYPE_USED. The patch is inspired by work done for DAOS' DAV allocator (DAOS-18195) which is heavily based on the PMEMOBJ allocator. Signed-off-by: Jan Michalski Inspired-by: Sherin T George --- ChangeLog | 6 ++++++ src/libpmemobj/memblock.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95ca8e718..910911bce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +XXX + + * Version X.X.X + + - Fix an issue in the PMEMOBJ allocator with a potential to corrupt the allocator's metadata (daos-stack/pmdk#24, DAOS-18195). + Tue Nov 4 2025 Oksana Sałyk * Version 2.1.2 diff --git a/src/libpmemobj/memblock.c b/src/libpmemobj/memblock.c index 0276ad80b..17c08f3d2 100644 --- a/src/libpmemobj/memblock.c +++ b/src/libpmemobj/memblock.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause /* Copyright 2016-2024, Intel Corporation */ +/* Copyright 2025, Hewlett Packard Enterprise Development LP */ /* * memblock.c -- implementation of memory block @@ -1185,8 +1186,8 @@ static void huge_reinit_chunk(const struct memory_block *m) { struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m); - if (hdr->type == CHUNK_TYPE_USED) - huge_write_footer(hdr, hdr->size_idx); + ASSERT(hdr->type == CHUNK_TYPE_USED || hdr->type == CHUNK_TYPE_FREE); + huge_write_footer(hdr, hdr->size_idx); } /* From 07895fd0c14b32f1e041d909b87c5d61db748fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oksana=20Sa=C5=82yk?= Date: Tue, 16 Dec 2025 11:53:53 +0100 Subject: [PATCH 08/13] obj: add footer ignoring for valgrind (#27) Signed-off-by: Oksana Salyk --- src/libpmemobj/memblock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libpmemobj/memblock.c b/src/libpmemobj/memblock.c index 17c08f3d2..339f8c909 100644 --- a/src/libpmemobj/memblock.c +++ b/src/libpmemobj/memblock.c @@ -1174,8 +1174,13 @@ huge_write_footer(struct chunk_header *hdr, uint32_t size_idx) struct chunk_header f = *hdr; f.type = CHUNK_TYPE_FOOTER; f.size_idx = size_idx; + + /* + * no need to transact and persist, + * footers are recreated in heap_populate_buckets + */ + VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(hdr + size_idx - 1, sizeof(f)); *(hdr + size_idx - 1) = f; - /* no need to persist, footers are recreated in heap_populate_buckets */ VALGRIND_SET_CLEAN(hdr + size_idx - 1, sizeof(f)); } From 6c2b382c89ac9056e10d2ac52e782172fd3407d9 Mon Sep 17 00:00:00 2001 From: liuxiang Date: Fri, 5 Jan 2024 15:25:33 +0800 Subject: [PATCH 09/13] common: fix compilation error on LoongArch Signed-off-by: liuxiang --- ChangeLog | 1 + src/libpmem2/loongarch64/init.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 910911bce..d3b83eee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ XXX * Version X.X.X - Fix an issue in the PMEMOBJ allocator with a potential to corrupt the allocator's metadata (daos-stack/pmdk#24, DAOS-18195). + - Fix compilation error on LoongArch. Thank you @liuxiang88 and @bgermann for your persistence in making it happen! (daos-stack/pmdk#29, pmem/pmdk#5957). Tue Nov 4 2025 Oksana Sałyk diff --git a/src/libpmem2/loongarch64/init.c b/src/libpmem2/loongarch64/init.c index f8b531be3..6b5572ae1 100644 --- a/src/libpmem2/loongarch64/init.c +++ b/src/libpmem2/loongarch64/init.c @@ -36,6 +36,6 @@ pmem2_arch_init(struct pmem2_arch_info *info) { LOG(3, NULL); - info->fence = loongarch_fence; + info->fence = loongarch_memory_fence; info->flush = loongarch_flush; } From 88b87a00412bd273f2a837b96368584b4038f6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oksana=20Sa=C5=82yk?= Date: Wed, 7 Jan 2026 16:53:13 +0100 Subject: [PATCH 10/13] obj: control POOL_FEAT_CHECK_BAD_BLOCKS via sds.at_create CTL (#28) Signed-off-by: Oksana Salyk Co-authored-by: Jan Michalski --- ChangeLog | 2 ++ src/common/set.c | 4 ++++ src/libpmemobj/obj.c | 1 + src/test/obj_pool/TEST32 | 4 ++++ src/test/obj_pool/TEST33 | 4 ++++ src/test/pmempool_sync/TEST32 | 5 ++--- src/test/pmempool_sync/TEST33 | 3 ++- src/test/pmempool_sync/TEST34 | 3 ++- src/test/pmempool_sync/TEST35 | 3 ++- src/test/pmempool_sync/TEST36 | 3 ++- src/test/pmempool_sync/TEST37 | 3 ++- src/test/pmempool_sync/TEST43 | 2 ++ src/test/pmempool_sync/TEST44 | 2 ++ src/test/pmempool_sync/TEST45 | 2 ++ src/test/pmempool_sync/TEST46 | 2 ++ src/test/pmempool_sync/TEST47 | 2 ++ src/test/pmempool_sync/TEST48 | 2 ++ src/test/pmempool_sync/TEST49 | 2 ++ src/test/pmempool_sync/TEST50 | 2 ++ src/test/pmempool_sync/TEST51 | 2 ++ src/test/pmempool_sync/TEST52 | 2 ++ src/test/pmempool_sync/TEST53 | 2 ++ src/test/unittest/unittest.sh | 22 ++++++++++++++++++++++ src/test/util_sds_check/TEST0 | 4 +++- src/test/util_sds_check/TEST1 | 4 +++- src/test/util_sds_check/TEST2 | 4 +++- src/test/util_sds_check/TEST3 | 4 +++- src/test/util_sds_check/TEST4 | 4 +++- src/test/util_sds_check/TEST5 | 4 +++- src/test/util_sds_check/TEST6 | 4 +++- src/test/util_sds_check/TEST7 | 4 +++- 31 files changed, 95 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3b83eee0..a0c5f31b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ XXX * Version X.X.X + - Expand the sds.at_create CTL to also cover the POOL_FEAT_CHECK_BAD_BLOCKS feature (daos-stack/pmdk#28, DAOS-18296). + - Until now, it controlled only the POOL_FEAT_SDS feature, but both may use NDCTL calls and increase stack usage. - Fix an issue in the PMEMOBJ allocator with a potential to corrupt the allocator's metadata (daos-stack/pmdk#24, DAOS-18195). - Fix compilation error on LoongArch. Thank you @liuxiang88 and @bgermann for your persistence in making it happen! (daos-stack/pmdk#29, pmem/pmdk#5957). diff --git a/src/common/set.c b/src/common/set.c index f82e9fd51..a3e9b80be 100644 --- a/src/common/set.c +++ b/src/common/set.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause /* Copyright 2015-2024, Intel Corporation */ +/* Copyright 2025, Hewlett Packard Enterprise Development LP */ /* * Copyright (c) 2016, Microsoft Corporation. All rights reserved. * @@ -3042,6 +3043,9 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, goto err_poolset_free; } + /* filter out unsupported or turned off features */ + compat_features &= attr->features.compat; + if (compat_features & POOL_FEAT_CHECK_BAD_BLOCKS) { /* check if any bad block recovery file exists */ int bfe = badblocks_recovery_file_exists(set); diff --git a/src/libpmemobj/obj.c b/src/libpmemobj/obj.c index bf2ffc8a6..b5f4f924f 100644 --- a/src/libpmemobj/obj.c +++ b/src/libpmemobj/obj.c @@ -1059,6 +1059,7 @@ pool_attr_adjust(struct pool_attr *attr) } } else { attr->features.incompat &= ~POOL_FEAT_SDS; /* off */ + attr->features.compat &= ~POOL_FEAT_CHECK_BAD_BLOCKS; /* off */ } return 0; diff --git a/src/test/obj_pool/TEST32 b/src/test/obj_pool/TEST32 index 2d463de02..024f22cd1 100755 --- a/src/test/obj_pool/TEST32 +++ b/src/test/obj_pool/TEST32 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2019, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/obj_pool/TEST32 -- unit test for pmemobj_open @@ -10,6 +11,9 @@ . ../unittest/unittest.sh require_test_type medium +# For non-pmem POOL_FEAT_CHECK_BAD_BLOCKS is turned off via PMEMOBJ_CONF="sds.at_create=0" +require_real_pmem +require_sds ./obj_pool setup diff --git a/src/test/obj_pool/TEST33 b/src/test/obj_pool/TEST33 index b76fb41a0..299291164 100755 --- a/src/test/obj_pool/TEST33 +++ b/src/test/obj_pool/TEST33 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2019, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/obj_pool/TEST33 -- unit test for pmemobj_open @@ -10,6 +11,9 @@ . ../unittest/unittest.sh require_test_type medium +# For non-pmem POOL_FEAT_CHECK_BAD_BLOCKS is turned off via PMEMOBJ_CONF="sds.at_create=0" +require_real_pmem +require_sds ./obj_pool setup diff --git a/src/test/pmempool_sync/TEST32 b/src/test/pmempool_sync/TEST32 index 3f00abade..670ed31da 100755 --- a/src/test/pmempool_sync/TEST32 +++ b/src/test/pmempool_sync/TEST32 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST32 -- test for sync command @@ -12,8 +13,8 @@ . ../unittest/unittest.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX @@ -35,8 +36,6 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOL expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG" -turn_on_checking_bad_blocks $POOLSET - # zero blocks: offset: 2 length: 250 zero_blocks $DIR/testfile0 2 250 diff --git a/src/test/pmempool_sync/TEST33 b/src/test/pmempool_sync/TEST33 index d6ec59271..9a5ca2b9f 100755 --- a/src/test/pmempool_sync/TEST33 +++ b/src/test/pmempool_sync/TEST33 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST33 -- test for sync command @@ -12,8 +13,8 @@ . ../unittest/unittest.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX diff --git a/src/test/pmempool_sync/TEST34 b/src/test/pmempool_sync/TEST34 index 72e18b4aa..0d0e0ce6c 100755 --- a/src/test/pmempool_sync/TEST34 +++ b/src/test/pmempool_sync/TEST34 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST34 -- test for sync command @@ -14,8 +15,8 @@ . setup.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX diff --git a/src/test/pmempool_sync/TEST35 b/src/test/pmempool_sync/TEST35 index 5a4368fea..055415611 100755 --- a/src/test/pmempool_sync/TEST35 +++ b/src/test/pmempool_sync/TEST35 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST35 -- test for sync command @@ -14,8 +15,8 @@ . setup.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX diff --git a/src/test/pmempool_sync/TEST36 b/src/test/pmempool_sync/TEST36 index 3eac293e5..19739f767 100755 --- a/src/test/pmempool_sync/TEST36 +++ b/src/test/pmempool_sync/TEST36 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST36 -- test for sync command @@ -15,8 +16,8 @@ . setup.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX diff --git a/src/test/pmempool_sync/TEST37 b/src/test/pmempool_sync/TEST37 index 9f8798218..bc9879e5c 100755 --- a/src/test/pmempool_sync/TEST37 +++ b/src/test/pmempool_sync/TEST37 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST37 -- test for sync command @@ -15,8 +16,8 @@ . setup.sh +require_real_pmem require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX diff --git a/src/test/pmempool_sync/TEST43 b/src/test/pmempool_sync/TEST43 index d46eeda96..86ab559d0 100755 --- a/src/test/pmempool_sync/TEST43 +++ b/src/test/pmempool_sync/TEST43 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST43 -- test for sync command with badblocks @@ -11,6 +12,7 @@ . ../unittest/unittest.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST44 b/src/test/pmempool_sync/TEST44 index da8b2a07f..74ce57caf 100755 --- a/src/test/pmempool_sync/TEST44 +++ b/src/test/pmempool_sync/TEST44 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST44 -- test for sync command with badblocks @@ -16,6 +17,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST45 b/src/test/pmempool_sync/TEST45 index b28b086a7..67b79532a 100755 --- a/src/test/pmempool_sync/TEST45 +++ b/src/test/pmempool_sync/TEST45 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST45 -- test for sync command with badblocks @@ -14,6 +15,7 @@ . ../unittest/unittest.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST46 b/src/test/pmempool_sync/TEST46 index 6758b2e95..b78d19b9e 100755 --- a/src/test/pmempool_sync/TEST46 +++ b/src/test/pmempool_sync/TEST46 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST46 -- test for sync command with badblocks @@ -14,6 +15,7 @@ . ../unittest/unittest.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST47 b/src/test/pmempool_sync/TEST47 index 19f769567..7beb00895 100755 --- a/src/test/pmempool_sync/TEST47 +++ b/src/test/pmempool_sync/TEST47 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST47 -- test for sync command with badblocks @@ -15,6 +16,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST48 b/src/test/pmempool_sync/TEST48 index 27d85005b..2015ee763 100755 --- a/src/test/pmempool_sync/TEST48 +++ b/src/test/pmempool_sync/TEST48 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST48 -- test for sync command with badblocks @@ -18,6 +19,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST49 b/src/test/pmempool_sync/TEST49 index 4db82bf4c..e9279dbca 100755 --- a/src/test/pmempool_sync/TEST49 +++ b/src/test/pmempool_sync/TEST49 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2011-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST49 -- test for sync command with badblocks @@ -19,6 +20,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST50 b/src/test/pmempool_sync/TEST50 index 963cf1cf2..0ab62e01c 100755 --- a/src/test/pmempool_sync/TEST50 +++ b/src/test/pmempool_sync/TEST50 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST50 -- test for sync command with badblocks @@ -19,6 +20,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST51 b/src/test/pmempool_sync/TEST51 index 5902a6863..e35b1bb1a 100755 --- a/src/test/pmempool_sync/TEST51 +++ b/src/test/pmempool_sync/TEST51 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST51 -- test for sync command with badblocks @@ -20,6 +21,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST52 b/src/test/pmempool_sync/TEST52 index 721eeb534..ebf20e556 100755 --- a/src/test/pmempool_sync/TEST52 +++ b/src/test/pmempool_sync/TEST52 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST52 -- test for sync command with badblocks @@ -15,6 +16,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/pmempool_sync/TEST53 b/src/test/pmempool_sync/TEST53 index abd2e08eb..441055510 100755 --- a/src/test/pmempool_sync/TEST53 +++ b/src/test/pmempool_sync/TEST53 @@ -1,6 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2011-2024, Intel Corporation +# Copyright 2025, Hewlett Packard Enterprise Development LP # # # pmempool_sync/TEST53 -- test for sync command with badblocks @@ -17,6 +18,7 @@ . setup.sh +require_real_pmem require_test_type medium require_fs_type non-pmem require_build_type debug nondebug diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index 00ad1ba27..0b297d5f6 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -2610,3 +2610,25 @@ function set_test_labels() { verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) test-labels: $* ($TEST_LABEL required)" exit 0 } + +# +# require_real_pmem -- run tests only on real pmem +# +function require_real_pmem() { + local path="$1" + if [ -z "$path" ]; then + path="$DIR" + fi + if [ "$PMEM_IS_PMEM_FORCE" == "1" ]; then + verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) PMEM is forced (PMEM_IS_PMEM_FORCE=$PMEM_IS_PMEM_FORCE), real PMEM required" + exit 0 + fi + case "$REAL_FS" in + pmem) + ;; + *) + verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) REAL_FS $REAL_FS (pmem required)" + exit 0 + ;; + esac +} diff --git a/src/test/util_sds_check/TEST0 b/src/test/util_sds_check/TEST0 index 14ff63eb3..86cbacc32 100755 --- a/src/test/util_sds_check/TEST0 +++ b/src/test/util_sds_check/TEST0 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST0 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_dirty_clear diff --git a/src/test/util_sds_check/TEST1 b/src/test/util_sds_check/TEST1 index f2417575a..dee535927 100755 --- a/src/test/util_sds_check/TEST1 +++ b/src/test/util_sds_check/TEST1 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST1 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_invalid_checksum diff --git a/src/test/util_sds_check/TEST2 b/src/test/util_sds_check/TEST2 index 54cc7aece..0b9dc9ed7 100755 --- a/src/test/util_sds_check/TEST2 +++ b/src/test/util_sds_check/TEST2 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST2 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_dirty_set diff --git a/src/test/util_sds_check/TEST3 b/src/test/util_sds_check/TEST3 index 958df6eb8..d3ccc46cd 100755 --- a/src/test/util_sds_check/TEST3 +++ b/src/test/util_sds_check/TEST3 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST3 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_invalid_uuid diff --git a/src/test/util_sds_check/TEST4 b/src/test/util_sds_check/TEST4 index 79d1e9acc..6026bf7be 100755 --- a/src/test/util_sds_check/TEST4 +++ b/src/test/util_sds_check/TEST4 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST4 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_invalid_uuid_set_dirty diff --git a/src/test/util_sds_check/TEST5 b/src/test/util_sds_check/TEST5 index ccf7de34d..a15d99599 100755 --- a/src/test/util_sds_check/TEST5 +++ b/src/test/util_sds_check/TEST5 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST5 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_invalid_usc diff --git a/src/test/util_sds_check/TEST6 b/src/test/util_sds_check/TEST6 index aa9038ec3..e138f6a93 100755 --- a/src/test/util_sds_check/TEST6 +++ b/src/test/util_sds_check/TEST6 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST6 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_invalid_usc_set_dirty diff --git a/src/test/util_sds_check/TEST7 b/src/test/util_sds_check/TEST7 index beed80e62..2b5142c91 100755 --- a/src/test/util_sds_check/TEST7 +++ b/src/test/util_sds_check/TEST7 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # src/test/util_sds_check/TEST7 -- unittest for shutdown_state_check @@ -14,6 +14,8 @@ require_fs_type none require_build_type debug +require_sds ./util_sds_check + setup expect_normal_exit ./util_sds_check test_happy_day From 7be9edd02a75572496d1444ee79a370a58d029ba Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Thu, 8 Jan 2026 13:00:28 +0000 Subject: [PATCH 11/13] test: check if no NDCTL-related code is in use without PMem (#30) DAOS-18296 Signed-off-by: Jan Michalski --- src/test/Makefile | 2 + src/test/obj_ndctl_bb/.gitignore | 1 + src/test/obj_ndctl_bb/Makefile | 10 ++++ src/test/obj_ndctl_bb/TEST0 | 30 +++++++++++ src/test/obj_ndctl_bb/TEST1 | 39 +++++++++++++++ src/test/obj_ndctl_bb/err1.log.match | 2 + src/test/obj_ndctl_bb/obj_ndctl_bb.c | 60 ++++++++++++++++++++++ src/test/obj_ndctl_sds/.gitignore | 1 + src/test/obj_ndctl_sds/Makefile | 10 ++++ src/test/obj_ndctl_sds/TEST0 | 30 +++++++++++ src/test/obj_ndctl_sds/TEST1 | 41 +++++++++++++++ src/test/obj_ndctl_sds/err1.log.match | 2 + src/test/obj_ndctl_sds/obj_ndctl_sds.c | 69 ++++++++++++++++++++++++++ 13 files changed, 297 insertions(+) create mode 100644 src/test/obj_ndctl_bb/.gitignore create mode 100644 src/test/obj_ndctl_bb/Makefile create mode 100755 src/test/obj_ndctl_bb/TEST0 create mode 100755 src/test/obj_ndctl_bb/TEST1 create mode 100644 src/test/obj_ndctl_bb/err1.log.match create mode 100644 src/test/obj_ndctl_bb/obj_ndctl_bb.c create mode 100644 src/test/obj_ndctl_sds/.gitignore create mode 100644 src/test/obj_ndctl_sds/Makefile create mode 100755 src/test/obj_ndctl_sds/TEST0 create mode 100755 src/test/obj_ndctl_sds/TEST1 create mode 100644 src/test/obj_ndctl_sds/err1.log.match create mode 100644 src/test/obj_ndctl_sds/obj_ndctl_sds.c diff --git a/src/test/Makefile b/src/test/Makefile index c3bd32990..c223ccae6 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -70,6 +70,8 @@ OBJ_TESTS = \ obj_memcheck\ obj_memcheck_register\ obj_memops\ + obj_ndctl_bb\ + obj_ndctl_sds\ obj_oid_thread\ obj_out_of_memory\ obj_persist_count\ diff --git a/src/test/obj_ndctl_bb/.gitignore b/src/test/obj_ndctl_bb/.gitignore new file mode 100644 index 000000000..1f5fdc3a5 --- /dev/null +++ b/src/test/obj_ndctl_bb/.gitignore @@ -0,0 +1 @@ +obj_ndctl_bb diff --git a/src/test/obj_ndctl_bb/Makefile b/src/test/obj_ndctl_bb/Makefile new file mode 100644 index 000000000..0c9ede86c --- /dev/null +++ b/src/test/obj_ndctl_bb/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP + +TARGET = obj_ndctl_bb +OBJS = obj_ndctl_bb.o + +LIBPMEMOBJ=internal-debug + +include ../Makefile.inc +LDFLAGS += $(call extract_funcs, obj_ndctl_bb.c) diff --git a/src/test/obj_ndctl_bb/TEST0 b/src/test/obj_ndctl_bb/TEST0 new file mode 100755 index 000000000..d4e670de3 --- /dev/null +++ b/src/test/obj_ndctl_bb/TEST0 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP +# +# +# obj_ndctl_bb/TEST0 -- check if the badblocks-related code is not run when no PMem is in use. +# DAOS-18296 +# + +. ../unittest/unittest.sh + +require_fs_type non-pmem +require_ndctl_enable +require_test_type short + +setup + +FILE=$DIR/testfile + +# obj_ndctl_bb commands +CREATE=c +OPEN=o + +expect_normal_exit obj_ndctl_bb $FILE $CREATE + +expect_normal_exit obj_ndctl_bb $FILE $OPEN + +check + +pass diff --git a/src/test/obj_ndctl_bb/TEST1 b/src/test/obj_ndctl_bb/TEST1 new file mode 100755 index 000000000..b01d40746 --- /dev/null +++ b/src/test/obj_ndctl_bb/TEST1 @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP +# +# +# obj_ndctl_bb/TEST1 -- check if the executable works as intended. Sanity check. +# + +. ../unittest/unittest.sh + +require_real_pmem +require_ndctl_enable +require_test_type short + +setup + +TMP=tmp${UNITTEST_NUM}.log +rm -f $TMP + +FILE=$DIR/testfile + +# obj_ndctl_bb commands +CREATE=c +OPEN=o + +expect_abnormal_exit obj_ndctl_bb $FILE $CREATE +cat $ERR_LOG_FILE >> $TMP + +expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $FILE + +expect_abnormal_exit obj_ndctl_bb $FILE $OPEN +cat $ERR_LOG_FILE >> $TMP + +# move combined error log in place +mv $TMP $ERR_LOG_FILE + +check + +pass diff --git a/src/test/obj_ndctl_bb/err1.log.match b/src/test/obj_ndctl_bb/err1.log.match new file mode 100644 index 000000000..2f43dc7dc --- /dev/null +++ b/src/test/obj_ndctl_bb/err1.log.match @@ -0,0 +1,2 @@ +{obj_ndctl_bb.c:$(N) __wrap_badblocks_check_poolset} obj_ndctl_bb/TEST1: Error: assertion failure: 0 +{obj_ndctl_bb.c:$(N) __wrap_badblocks_recovery_file_exists} obj_ndctl_bb/TEST1: Error: assertion failure: 0 diff --git a/src/test/obj_ndctl_bb/obj_ndctl_bb.c b/src/test/obj_ndctl_bb/obj_ndctl_bb.c new file mode 100644 index 000000000..993930e89 --- /dev/null +++ b/src/test/obj_ndctl_bb/obj_ndctl_bb.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* Copyright 2026, Hewlett Packard Enterprise Development LP */ + +/* + * obj_ndctl_bb.c -- crashes whenever badblocks-related code is run + */ + +#include + +#include "set.h" + +#include "unittest.h" + +FUNC_MOCK(badblocks_recovery_file_exists, int, struct pool_set *set) + FUNC_MOCK_RUN_DEFAULT { + UT_ASSERT(0); + } +FUNC_MOCK_END + +FUNC_MOCK(badblocks_check_poolset, int, struct pool_set *set, int create) + FUNC_MOCK_RUN_DEFAULT { + UT_ASSERT(0); + } +FUNC_MOCK_END + +int +main(int argc, char *argv[]) +{ + START(argc, argv, "obj_ndctl_bb"); + if (argc < 3) { + UT_FATAL("usage: %s \nc - create\no - open", + argv[0]); + } + + const char *path = argv[1]; + const char *cmd = argv[2]; + PMEMobjpool *pop; + + if (strlen(cmd) != 1) { + UT_FATAL("unknown command: %s", cmd); + } + + switch (cmd[0]) { + case 'c': + pop = pmemobj_create(path, NULL, PMEMOBJ_MIN_POOL, + 0600); + break; + case 'o': + pop = pmemobj_open(path, NULL); + break; + default: + UT_FATAL("unknown command: %s", cmd); + } + + UT_ASSERTne(pop, NULL); + + pmemobj_close(pop); + + DONE(NULL); +} diff --git a/src/test/obj_ndctl_sds/.gitignore b/src/test/obj_ndctl_sds/.gitignore new file mode 100644 index 000000000..61c6a097a --- /dev/null +++ b/src/test/obj_ndctl_sds/.gitignore @@ -0,0 +1 @@ +obj_ndctl_sds diff --git a/src/test/obj_ndctl_sds/Makefile b/src/test/obj_ndctl_sds/Makefile new file mode 100644 index 000000000..35442695a --- /dev/null +++ b/src/test/obj_ndctl_sds/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP + +TARGET = obj_ndctl_sds +OBJS = obj_ndctl_sds.o + +LIBPMEMOBJ=internal-debug + +include ../Makefile.inc +LDFLAGS += $(call extract_funcs, obj_ndctl_sds.c) diff --git a/src/test/obj_ndctl_sds/TEST0 b/src/test/obj_ndctl_sds/TEST0 new file mode 100755 index 000000000..ccc519896 --- /dev/null +++ b/src/test/obj_ndctl_sds/TEST0 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP +# +# +# obj_ndctl_sds/TEST0 -- check if the shutdown-state-related code is not run when no PMem is in use. +# DAOS-18296 +# + +. ../unittest/unittest.sh + +require_fs_type non-pmem +require_ndctl_enable +require_test_type short + +setup + +FILE=$DIR/testfile + +# obj_ndctl_sds commands +CREATE=c +OPEN=o + +expect_normal_exit obj_ndctl_sds $FILE $CREATE + +expect_normal_exit obj_ndctl_sds $FILE $OPEN + +check + +pass diff --git a/src/test/obj_ndctl_sds/TEST1 b/src/test/obj_ndctl_sds/TEST1 new file mode 100755 index 000000000..44d9b37eb --- /dev/null +++ b/src/test/obj_ndctl_sds/TEST1 @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2026, Hewlett Packard Enterprise Development LP +# +# +# obj_ndctl_sds/TEST1 -- check if the executable works as intended. Sanity check. +# + +. ../unittest/unittest.sh + +require_real_pmem +require_ndctl_enable +require_test_type short + +setup + +TMP=tmp${UNITTEST_NUM}.log +rm -f $TMP + +FILE=$DIR/testfile + +# obj_ndctl_sds commands +CREATE=c +OPEN=o + +expect_abnormal_exit obj_ndctl_sds $FILE $CREATE +cat $ERR_LOG_FILE >> $TMP + +# The crashed process leaves $FILE in a half-baked state. Let's do it right. +rm -f $FILE +expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $FILE + +expect_abnormal_exit obj_ndctl_sds $FILE $OPEN +cat $ERR_LOG_FILE >> $TMP + +# move combined error log in place +mv $TMP $ERR_LOG_FILE + +check + +pass diff --git a/src/test/obj_ndctl_sds/err1.log.match b/src/test/obj_ndctl_sds/err1.log.match new file mode 100644 index 000000000..7f0e7cab5 --- /dev/null +++ b/src/test/obj_ndctl_sds/err1.log.match @@ -0,0 +1,2 @@ +{obj_ndctl_sds.c:$(N) __wrap_shutdown_state_init} obj_ndctl_sds/TEST1: Error: assertion failure: 0 +{obj_ndctl_sds.c:$(N) __wrap_shutdown_state_init} obj_ndctl_sds/TEST1: Error: assertion failure: 0 diff --git a/src/test/obj_ndctl_sds/obj_ndctl_sds.c b/src/test/obj_ndctl_sds/obj_ndctl_sds.c new file mode 100644 index 000000000..ab3b75e45 --- /dev/null +++ b/src/test/obj_ndctl_sds/obj_ndctl_sds.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* Copyright 2026, Hewlett Packard Enterprise Development LP */ + +/* + * obj_ndctl_sds.c -- crashes whenever shutdown-state-related code is run + */ + +#include + +#include "set.h" + +#include "unittest.h" + +FUNC_MOCK(shutdown_state_init, int, struct shutdown_state *sds, + struct pool_replica *rep) + FUNC_MOCK_RUN_DEFAULT { + UT_ASSERT(0); + } +FUNC_MOCK_END + +FUNC_MOCK(shutdown_state_set_dirty, void, struct shutdown_state *sds, + struct pool_replica *rep) + FUNC_MOCK_RUN_DEFAULT { + UT_ASSERT(0); + } +FUNC_MOCK_END + +FUNC_MOCK(shutdown_state_check, int, struct shutdown_state *curr_sds, + struct shutdown_state *pool_sds, struct pool_replica *rep) + FUNC_MOCK_RUN_DEFAULT { + UT_ASSERT(0); + } +FUNC_MOCK_END + +int +main(int argc, char *argv[]) +{ + START(argc, argv, "obj_ndctl_sds"); + if (argc < 3) { + UT_FATAL("usage: %s \nc - create\no - open", + argv[0]); + } + + const char *path = argv[1]; + const char *cmd = argv[2]; + PMEMobjpool *pop; + + if (strlen(cmd) != 1) { + UT_FATAL("unknown command: %s", cmd); + } + + switch (cmd[0]) { + case 'c': + pop = pmemobj_create(path, NULL, PMEMOBJ_MIN_POOL, + 0600); + break; + case 'o': + pop = pmemobj_open(path, NULL); + break; + default: + UT_FATAL("unknown command: %s", cmd); + } + + UT_ASSERTne(pop, NULL); + + pmemobj_close(pop); + + DONE(NULL); +} From c1d0d201a1d4a42b81349e10c7297b5e0fcfe84b Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Tue, 13 Jan 2026 12:10:31 +0100 Subject: [PATCH 12/13] common: 2.1.3-rc1 release Signed-off-by: Oksana Salyk --- ChangeLog | 6 +++--- GIT_VERSION | 1 - VERSION | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 GIT_VERSION create mode 100644 VERSION diff --git a/ChangeLog b/ChangeLog index a0c5f31b2..567c4f20a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,9 @@ -XXX +Tue Jan 13 2026 Oksana Sałyk - * Version X.X.X + * Version 2.1.3-rc1 - Expand the sds.at_create CTL to also cover the POOL_FEAT_CHECK_BAD_BLOCKS feature (daos-stack/pmdk#28, DAOS-18296). - - Until now, it controlled only the POOL_FEAT_SDS feature, but both may use NDCTL calls and increase stack usage. + - Until now, it controlled only the POOL_FEAT_SDS feature, but both may use NDCTL calls and increase stack usage. - Fix an issue in the PMEMOBJ allocator with a potential to corrupt the allocator's metadata (daos-stack/pmdk#24, DAOS-18195). - Fix compilation error on LoongArch. Thank you @liuxiang88 and @bgermann for your persistence in making it happen! (daos-stack/pmdk#29, pmem/pmdk#5957). diff --git a/GIT_VERSION b/GIT_VERSION deleted file mode 100644 index 6002f22fa..000000000 --- a/GIT_VERSION +++ /dev/null @@ -1 +0,0 @@ -$Format:%h$ \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..dbbfccb6e --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.3-rc1 From 95148f35f264fcb4465412b346a18233c15a6eb4 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Tue, 13 Jan 2026 12:20:27 +0100 Subject: [PATCH 13/13] common: git versions Signed-off-by: Oksana Salyk --- GIT_VERSION | 1 + VERSION | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 GIT_VERSION delete mode 100644 VERSION diff --git a/GIT_VERSION b/GIT_VERSION new file mode 100644 index 000000000..6002f22fa --- /dev/null +++ b/GIT_VERSION @@ -0,0 +1 @@ +$Format:%h$ \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index dbbfccb6e..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.1.3-rc1