diff --git a/src/flush.c b/src/flush.c index 1ea9b29fd9..15fd0c7c5c 100644 --- a/src/flush.c +++ b/src/flush.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * flush.c -- librpma flush-related implementations @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef TEST_MOCK_ALLOC #include "cmocka_alloc.h" @@ -40,6 +41,7 @@ struct rpma_flush_internal { struct flush_apm { void *raw; /* buffer for read-after-write memory region */ + size_t mmap_size; /* size of the mmap()'ed memory */ struct rpma_mr_local *raw_mr; /* read-after-write memory region */ }; @@ -51,6 +53,8 @@ struct flush_apm { static int rpma_flush_apm_new(struct rpma_peer *peer, struct rpma_flush *flush) { + int ret; + /* a memory registration has to be page-aligned */ long pagesize = sysconf(_SC_PAGESIZE); if (pagesize < 0) { @@ -59,29 +63,32 @@ rpma_flush_apm_new(struct rpma_peer *peer, struct rpma_flush *flush) return RPMA_E_PROVIDER; } + size_t mmap_size = (size_t)pagesize; + /* allocate memory for the read-after-write buffer (RAW) */ - void *raw = NULL; - int ret = posix_memalign(&raw, (size_t)pagesize, RAW_SIZE); - if (ret) + void *raw = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (raw == MAP_FAILED) return RPMA_E_NOMEM; /* register the RAW buffer */ struct rpma_mr_local *raw_mr = NULL; ret = rpma_mr_reg(peer, raw, RAW_SIZE, RPMA_MR_USAGE_READ_DST, &raw_mr); if (ret) { - free(raw); + (void) munmap(raw, mmap_size); return ret; } struct flush_apm *flush_apm = malloc(sizeof(struct flush_apm)); if (flush_apm == NULL) { (void) rpma_mr_dereg(&raw_mr); - free(raw); + (void) munmap(raw, mmap_size); return RPMA_E_NOMEM; } flush_apm->raw = raw; flush_apm->raw_mr = raw_mr; + flush_apm->mmap_size = mmap_size; struct rpma_flush_internal *flush_internal = (struct rpma_flush_internal *)flush; @@ -102,12 +109,18 @@ rpma_flush_apm_delete(struct rpma_flush *flush) (struct rpma_flush_internal *)flush; struct flush_apm *flush_apm = (struct flush_apm *)flush_internal->context; - int ret = rpma_mr_dereg(&flush_apm->raw_mr); - free(flush_apm->raw); + int ret_dereg = rpma_mr_dereg(&flush_apm->raw_mr); + int ret_unmap = munmap(flush_apm->raw, flush_apm->mmap_size); free(flush_apm); - return ret; + if (ret_dereg) + return ret_dereg; + + if (ret_unmap) + return RPMA_E_INVAL; + + return 0; } /* diff --git a/src/flush.h b/src/flush.h index 6053e9b733..b1e8715572 100644 --- a/src/flush.h +++ b/src/flush.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * flush.h -- librpma flush-related internal definitions @@ -24,7 +24,7 @@ struct rpma_flush { * ERRORS * rpma_flush_new() can fail with the following errors: * - * - RPMA_E_NOMEM - out of memory + * - RPMA_E_NOMEM - out of memory (mmap() failed) * - RPMA_E_PROVIDER - sysconf() or ibv_reg_mr() failed */ int rpma_flush_new(struct rpma_peer *peer, struct rpma_flush **flush_ptr); @@ -33,7 +33,8 @@ int rpma_flush_new(struct rpma_peer *peer, struct rpma_flush **flush_ptr); * ERRORS * rpma_flush_delete() can fail with the following error: * - * - RPMA_E_PROVIDER ibv_dereg_mr() failed + * - RPMA_E_PROVIDER - ibv_dereg_mr() failed + * - RPMA_E_INVAL - munmap() failed */ int rpma_flush_delete(struct rpma_flush **flush_ptr); diff --git a/tests/integration/common/mocks.c b/tests/integration/common/mocks.c index 7c4b9a68c2..283028a8fe 100644 --- a/tests/integration/common/mocks.c +++ b/tests/integration/common/mocks.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * mocks.c -- common mocks for integration tests @@ -7,6 +7,8 @@ #include #include +#include +#include #include "cmocka_headers.h" #include "conn_cfg.h" @@ -758,3 +760,37 @@ create_descriptor(void *desc, return 0; } + +/* + * __wrap_mmap -- mmap() mock + */ +void * +__wrap_mmap(void *__addr, size_t __len, int __prot, + int __flags, int __fd, off_t __offset) +{ + void *err = mock_type(void *); + if (err == MAP_FAILED) + return MAP_FAILED; + + struct mmap_args *args = mock_type(struct mmap_args *); + + void *memptr = __real__test_malloc(__len); + + /* save the address of the allocated memory to verify it later */ + args->ptr = memptr; + + return memptr; +} + +/* + * __wrap_munmap -- munmap() mock + */ +int +__wrap_munmap(void *__addr, size_t __len) +{ + (void) __len; /* unsused */ + + test_free(__addr); + + return 0; +} diff --git a/tests/integration/common/mocks.h b/tests/integration/common/mocks.h index 7d71ac52a0..a188d1dd2d 100644 --- a/tests/integration/common/mocks.h +++ b/tests/integration/common/mocks.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * mocks.h -- common mocks for integration tests @@ -62,6 +62,10 @@ struct posix_memalign_args { void *ptr; }; +struct mmap_args { + void *ptr; +}; + #ifdef ON_DEMAND_PAGING_SUPPORTED int ibv_query_device_ex_mock(struct ibv_context *context, const struct ibv_query_device_ex_input *input, diff --git a/tests/integration/example-01-connection/CMakeLists.txt b/tests/integration/example-01-connection/CMakeLists.txt index 6dc472f6dc..4748610604 100644 --- a/tests/integration/example-01-connection/CMakeLists.txt +++ b/tests/integration/example-01-connection/CMakeLists.txt @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020, Intel Corporation +# Copyright 2020-2021, Intel Corporation # include(../../cmake/ctest_helpers.cmake) @@ -34,7 +34,7 @@ target_include_directories(${TARGET} PRIVATE set_target_properties(${TARGET} PROPERTIES - LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=fprintf") + LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=mmap,--wrap=munmap,--wrap=fprintf") target_compile_definitions(${TARGET} PUBLIC TEST_MOCK_MAIN diff --git a/tests/integration/example-01-connection/example-01-connection.c b/tests/integration/example-01-connection/example-01-connection.c index ec1c663364..e966a9dfb9 100644 --- a/tests/integration/example-01-connection/example-01-connection.c +++ b/tests/integration/example-01-connection/example-01-connection.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * example-01-connection.c -- connection integration tests @@ -92,8 +92,9 @@ test_client__success(void **unused) expect_value(rdma_migrate_id, channel, MOCK_EVCH); will_return(rdma_migrate_id, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); + will_return(__wrap_mmap, &allocated_raw); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); @@ -244,8 +245,9 @@ test_server__success(void **unused) expect_value(rdma_migrate_id, channel, MOCK_EVCH); will_return(rdma_migrate_id, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); + will_return(__wrap_mmap, &allocated_raw); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); diff --git a/tests/integration/example-02-read-to-volatile/CMakeLists.txt b/tests/integration/example-02-read-to-volatile/CMakeLists.txt index 412724aca8..54b4ffb909 100644 --- a/tests/integration/example-02-read-to-volatile/CMakeLists.txt +++ b/tests/integration/example-02-read-to-volatile/CMakeLists.txt @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020, Intel Corporation +# Copyright 2020-2021, Intel Corporation # include(../../cmake/ctest_helpers.cmake) @@ -35,7 +35,7 @@ target_include_directories(${TARGET} PRIVATE set_target_properties(${TARGET} PROPERTIES - LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=fprintf") + LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=fprintf,--wrap=mmap,--wrap=munmap") target_compile_definitions(${TARGET} PUBLIC TEST_MOCK_MAIN diff --git a/tests/integration/example-02-read-to-volatile/example-02-read-to-volatile.c b/tests/integration/example-02-read-to-volatile/example-02-read-to-volatile.c index aef113be35..9608a30f26 100644 --- a/tests/integration/example-02-read-to-volatile/example-02-read-to-volatile.c +++ b/tests/integration/example-02-read-to-volatile/example-02-read-to-volatile.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * example-02-read-to-volatile.c -- 'read to volatile' integration tests @@ -107,8 +107,9 @@ test_client__success(void **unused) expect_value(rdma_migrate_id, channel, MOCK_EVCH); will_return(rdma_migrate_id, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); + will_return(__wrap_mmap, &allocated_raw); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); @@ -304,8 +305,9 @@ test_server__success(void **unused) expect_value(rdma_migrate_id, channel, MOCK_EVCH); will_return(rdma_migrate_id, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); + will_return(__wrap_mmap, &allocated_raw); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); diff --git a/tests/integration/example-04-write-to-persistent/CMakeLists.txt b/tests/integration/example-04-write-to-persistent/CMakeLists.txt index 4865f48183..7c3ccf5b15 100644 --- a/tests/integration/example-04-write-to-persistent/CMakeLists.txt +++ b/tests/integration/example-04-write-to-persistent/CMakeLists.txt @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020, Intel Corporation +# Copyright 2020-2021, Intel Corporation # include(../../cmake/ctest_helpers.cmake) @@ -35,7 +35,7 @@ target_include_directories(${TARGET} PRIVATE set_target_properties(${TARGET} PROPERTIES - LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=fprintf") + LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=fprintf,--wrap=mmap,--wrap=munmap") target_compile_definitions(${TARGET} PUBLIC TEST_MOCK_MAIN diff --git a/tests/integration/example-04-write-to-persistent/example-04-write-to-persistent.c b/tests/integration/example-04-write-to-persistent/example-04-write-to-persistent.c index 7bbd9f9f7b..e537b3897f 100644 --- a/tests/integration/example-04-write-to-persistent/example-04-write-to-persistent.c +++ b/tests/integration/example-04-write-to-persistent/example-04-write-to-persistent.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * example-04-write-to-persistent.c -- 'write to persistent' integration tests @@ -111,8 +111,9 @@ test_client__success(void **unused) will_return(rdma_migrate_id, MOCK_OK); /* allocate memory for the rpma_flush_apm_new */ - struct posix_memalign_args flush = {0}; - will_return(__wrap_posix_memalign, &flush); + struct mmap_args flush = {0}; + will_return(__wrap_mmap, &flush); + will_return(__wrap_mmap, &flush); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); @@ -341,8 +342,9 @@ test_server__success(void **unused) expect_value(rdma_migrate_id, channel, MOCK_EVCH); will_return(rdma_migrate_id, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); + will_return(__wrap_mmap, &allocated_raw); expect_value(ibv_reg_mr, pd, MOCK_IBV_PD); expect_value(ibv_reg_mr, length, MOCK_RAW_SIZE); diff --git a/tests/unit/common/mocks-stdlib.c b/tests/unit/common/mocks-stdlib.c index 51944d711b..b17a5cb44d 100644 --- a/tests/unit/common/mocks-stdlib.c +++ b/tests/unit/common/mocks-stdlib.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * mocks-stdlib.c -- stdlib mocks @@ -7,6 +7,8 @@ #include #include +#include +#include #include "cmocka_headers.h" #include "mocks-stdlib.h" @@ -47,3 +49,37 @@ __wrap_posix_memalign(void **memptr, size_t alignment, size_t size) return 0; } + +/* + * __wrap_mmap -- mmap() mock + */ +void * +__wrap_mmap(void *__addr, size_t __len, int __prot, + int __flags, int __fd, off_t __offset) +{ + void *err = mock_type(void *); + if (err == MAP_FAILED) + return MAP_FAILED; + + struct mmap_args *args = mock_type(struct mmap_args *); + + void *memptr = __real__test_malloc(__len); + + /* save the address of the allocated memory to verify it later */ + args->ptr = memptr; + + return memptr; +} + +/* + * __wrap_munmap -- munmap() mock + */ +int +__wrap_munmap(void *__addr, size_t __len) +{ + (void) __len; /* unsused */ + + test_free(__addr); + + return 0; +} diff --git a/tests/unit/common/mocks-stdlib.h b/tests/unit/common/mocks-stdlib.h index 5840969a4e..c25002dd68 100644 --- a/tests/unit/common/mocks-stdlib.h +++ b/tests/unit/common/mocks-stdlib.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * mocks-stdlib.h -- the stdlib mocks' header @@ -12,4 +12,8 @@ struct posix_memalign_args { void *ptr; }; +struct mmap_args { + void *ptr; +}; + #endif /* MOCKS_STDLIB_H */ diff --git a/tests/unit/conn/conn-new.c b/tests/unit/conn/conn-new.c index 3ac1cc515a..a72b53a89c 100644 --- a/tests/unit/conn/conn-new.c +++ b/tests/unit/conn/conn-new.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * conn-new.c -- the connection new/delete unit tests @@ -255,6 +255,38 @@ delete__flush_delete_E_PROVIDER(void **unused) assert_null(cstate->conn); } +/* + * delete__flush_delete_E_INVAL - rpma_flush_delete() + * fails with RPMA_E_INVAL + */ +static void +delete__flush_delete_E_INVAL(void **unused) +{ + /* + * Cmocka does not allow freeing an object in a test if the object was + * created in the setup step whereas even failing rpma_conn_delete() + * will deallocate the rpma_conn object. + */ + struct conn_test_state *cstate; + int ret = setup__conn_new((void **)&cstate); + assert_int_equal(ret, 0); + assert_non_null(cstate->conn); + + /* configure mocks: */ + will_return(rpma_flush_delete, RPMA_E_INVAL); + will_return_maybe(ibv_destroy_cq, EAGAIN); + will_return_maybe(ibv_destroy_comp_channel, MOCK_OK); + expect_value(rdma_destroy_id, id, MOCK_CM_ID); + will_return_maybe(rdma_destroy_id, MOCK_OK); + + /* run test */ + ret = rpma_conn_delete(&cstate->conn); + + /* verify the results */ + assert_int_equal(ret, RPMA_E_INVAL); + assert_null(cstate->conn); +} + /* * delete__destroy_cq_EAGAIN - ibv_destroy_cq() fails with EAGAIN */ @@ -439,6 +471,7 @@ static const struct CMUnitTest tests_new[] = { cmocka_unit_test(delete__conn_ptr_NULL), cmocka_unit_test(delete__conn_NULL), cmocka_unit_test(delete__flush_delete_E_PROVIDER), + cmocka_unit_test(delete__flush_delete_E_INVAL), cmocka_unit_test(delete__destroy_cq_EAGAIN), cmocka_unit_test(delete__destroy_cq_EAGAIN_subsequent_EIO), cmocka_unit_test(delete__destroy_comp_channel_EAGAIN), diff --git a/tests/unit/flush/CMakeLists.txt b/tests/unit/flush/CMakeLists.txt index e2f668266e..283cd580ab 100644 --- a/tests/unit/flush/CMakeLists.txt +++ b/tests/unit/flush/CMakeLists.txt @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020, Intel Corporation +# Copyright 2020-2021, Intel Corporation # include(../../cmake/ctest_helpers.cmake) @@ -22,7 +22,7 @@ function(add_test_flush name) set_target_properties(${name} PROPERTIES - LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=posix_memalign,--wrap=sysconf") + LINK_FLAGS "-Wl,--wrap=_test_malloc,--wrap=mmap,--wrap=munmap,--wrap=sysconf") add_test_generic(NAME ${name} TRACERS none) endfunction() diff --git a/tests/unit/flush/flush-common.c b/tests/unit/flush/flush-common.c index 1820284e93..83d2245fc3 100644 --- a/tests/unit/flush/flush-common.c +++ b/tests/unit/flush/flush-common.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * flush-common.c -- common part of unit tests of the flush module @@ -21,9 +21,9 @@ setup__flush_new(void **fstate_ptr) /* configure mocks */ will_return_always(__wrap__test_malloc, MOCK_OK); will_return(__wrap_sysconf, MOCK_OK); - will_return(__wrap_posix_memalign, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + will_return(__wrap_mmap, MOCK_OK); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); expect_value(rpma_mr_reg, peer, MOCK_PEER); expect_value(rpma_mr_reg, size, 8); expect_value(rpma_mr_reg, usage, RPMA_MR_USAGE_READ_DST); diff --git a/tests/unit/flush/flush-new.c b/tests/unit/flush/flush-new.c index 6ca6e60170..c6ae5c8ee9 100644 --- a/tests/unit/flush/flush-new.c +++ b/tests/unit/flush/flush-new.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2020, Intel Corporation */ +/* Copyright 2020-2021, Intel Corporation */ /* * flush-new.c -- unit tests of the flush module @@ -14,6 +14,7 @@ #include "flush-common.h" #include "mocks-stdlib.h" #include "test-common.h" +#include /* * new__malloc_ENOMEM -- malloc() fail with ENOMEM @@ -53,15 +54,15 @@ new__apm_sysconf_EINVAL(void **unused) } /* - * new__apm_posix_memalign_ENOMEM -- malloc() fail with ENOMEM + * new__apm_mmap_ENOMEM -- malloc() fail with ENOMEM */ static void -new__apm_posix_memalign_ENOMEM(void **unused) +new__apm_mmap_ENOMEM(void **unused) { /* configure mocks */ will_return_always(__wrap__test_malloc, MOCK_OK); will_return(__wrap_sysconf, MOCK_OK); - will_return(__wrap_posix_memalign, ENOMEM); + will_return(__wrap_mmap, MAP_FAILED); /* run test */ struct rpma_flush *flush = NULL; @@ -82,9 +83,9 @@ new__apm_mr_reg_RPMA_E_NOMEM(void **unused) will_return_always(__wrap__test_malloc, MOCK_OK); will_return(__wrap_sysconf, MOCK_OK); - will_return(__wrap_posix_memalign, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + will_return(__wrap_mmap, MOCK_OK); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); expect_value(rpma_mr_reg, peer, MOCK_PEER); expect_value(rpma_mr_reg, size, 8); expect_value(rpma_mr_reg, usage, RPMA_MR_USAGE_READ_DST); @@ -111,9 +112,9 @@ new__apm_malloc_ENOMEM(void **unused) will_return(__wrap__test_malloc, MOCK_OK); will_return(__wrap_sysconf, MOCK_OK); - will_return(__wrap_posix_memalign, MOCK_OK); - struct posix_memalign_args allocated_raw = {0}; - will_return(__wrap_posix_memalign, &allocated_raw); + will_return(__wrap_mmap, MOCK_OK); + struct mmap_args allocated_raw = {0}; + will_return(__wrap_mmap, &allocated_raw); expect_value(rpma_mr_reg, peer, MOCK_PEER); expect_value(rpma_mr_reg, size, 8); expect_value(rpma_mr_reg, usage, RPMA_MR_USAGE_READ_DST); @@ -150,7 +151,7 @@ main(int argc, char *argv[]) /* rpma__new() unit tests */ cmocka_unit_test(new__malloc_ENOMEM), cmocka_unit_test(new__apm_sysconf_EINVAL), - cmocka_unit_test(new__apm_posix_memalign_ENOMEM), + cmocka_unit_test(new__apm_mmap_ENOMEM), cmocka_unit_test(new__apm_mr_reg_RPMA_E_NOMEM), cmocka_unit_test(new__apm_malloc_ENOMEM), cmocka_unit_test_setup_teardown(new__apm_success,