Skip to content

Commit

Permalink
Add IPC tests for FSDAX
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Dorau <[email protected]>
  • Loading branch information
ldorau committed Nov 7, 2024
1 parent 3a5d20c commit fa4f9b6
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/provider_file_memory_ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ umf_file_memory_provider_params_t get_file_params_shared(char *path) {
umf_file_memory_provider_params_t file_params_shared =
get_file_params_shared(FILE_PATH);

umf_file_memory_provider_params_t get_file_params_fsdax(char *path) {
umf_file_memory_provider_params_t file_params =
umfFileMemoryProviderParamsDefault(path);
file_params.visibility = UMF_MEM_MAP_SYNC;
file_params.is_fsdax = true;
return file_params;
}

umf_file_memory_provider_params_t file_params_fsdax =
get_file_params_fsdax(getenv("UMF_TESTS_FSDAX_PATH"));

HostMemoryAccessor hostAccessor;

static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = {
Expand All @@ -43,7 +54,36 @@ static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = {
#endif
};

static std::vector<ipcTestParams> getIpcFsDaxTestParamsList(void) {
std::vector<ipcTestParams> ipcFsDaxTestParamsList = {};

char *path = getenv("UMF_TESTS_FSDAX_PATH");
if (path == nullptr || path[0] == 0) {
// skipping the test, UMF_TESTS_FSDAX_PATH is not set
return ipcFsDaxTestParamsList;
}

ipcFsDaxTestParamsList = {
// TODO: enable it when sizes of allocations in ipcFixtures.hpp are fixed
// {umfProxyPoolOps(), nullptr, umfFileMemoryProviderOps(),
// &file_params_fsdax, &hostAccessor, true},
#ifdef UMF_POOL_JEMALLOC_ENABLED
{umfJemallocPoolOps(), nullptr, umfFileMemoryProviderOps(),
&file_params_fsdax, &hostAccessor, false},
#endif
#ifdef UMF_POOL_SCALABLE_ENABLED
{umfScalablePoolOps(), nullptr, umfFileMemoryProviderOps(),
&file_params_fsdax, &hostAccessor, false},
#endif
};

return ipcFsDaxTestParamsList;
}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(umfIpcTest);

INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsTest, umfIpcTest,
::testing::ValuesIn(ipcManyPoolsTestParamsList));

INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsFSDAXTest, umfIpcTest,
::testing::ValuesIn(getIpcFsDaxTestParamsList()));
16 changes: 16 additions & 0 deletions test/supp/helgrind-umf_test-ipc.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
False-positive race in critnib_insert (lack of instrumentation)
Helgrind:Race
fun:store
fun:critnib_insert
...
}

{
False-positive race in critnib_find (lack of instrumentation)
Helgrind:Race
fun:find_predecessor
fun:find_le
fun:critnib_find
...
}
16 changes: 16 additions & 0 deletions test/supp/helgrind-umf_test-provider_file_memory_ipc.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
False-positive race in critnib_insert (lack of instrumentation)
Helgrind:Race
fun:store
fun:critnib_insert
...
}

{
False-positive race in critnib_find (lack of instrumentation)
Helgrind:Race
fun:find_predecessor
fun:find_le
fun:critnib_find
...
}

0 comments on commit fa4f9b6

Please sign in to comment.