Skip to content

Commit 481bf98

Browse files
committed
Add IPC tests for FSDAX
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 0123fe2 commit 481bf98

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

test/provider_file_memory_ipc.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ umf_file_memory_provider_params_t get_file_params_shared(char *path) {
2727
umf_file_memory_provider_params_t file_params_shared =
2828
get_file_params_shared(FILE_PATH);
2929

30+
umf_file_memory_provider_params_t get_file_params_fsdax(char *path) {
31+
umf_file_memory_provider_params_t file_params =
32+
umfFileMemoryProviderParamsDefault(path);
33+
file_params.visibility = UMF_MEM_MAP_SYNC;
34+
return file_params;
35+
}
36+
37+
umf_file_memory_provider_params_t file_params_fsdax =
38+
get_file_params_fsdax(getenv("UMF_TESTS_FSDAX_PATH"));
39+
3040
HostMemoryAccessor hostAccessor;
3141

3242
static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = {
@@ -43,7 +53,36 @@ static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = {
4353
#endif
4454
};
4555

56+
static std::vector<ipcTestParams> getIpcFsDaxTestParamsList(void) {
57+
std::vector<ipcTestParams> ipcFsDaxTestParamsList = {};
58+
59+
char *path = getenv("UMF_TESTS_FSDAX_PATH");
60+
if (path == nullptr || path[0] == 0) {
61+
// skipping the test, UMF_TESTS_FSDAX_PATH is not set
62+
return ipcFsDaxTestParamsList;
63+
}
64+
65+
ipcFsDaxTestParamsList = {
66+
// TODO: enable it when sizes of allocations in ipcFixtures.hpp are fixed
67+
// {umfProxyPoolOps(), nullptr, umfFileMemoryProviderOps(),
68+
// &file_params_fsdax, &hostAccessor, true},
69+
#ifdef UMF_POOL_JEMALLOC_ENABLED
70+
{umfJemallocPoolOps(), nullptr, umfFileMemoryProviderOps(),
71+
&file_params_fsdax, &hostAccessor, false},
72+
#endif
73+
#ifdef UMF_POOL_SCALABLE_ENABLED
74+
{umfScalablePoolOps(), nullptr, umfFileMemoryProviderOps(),
75+
&file_params_fsdax, &hostAccessor, false},
76+
#endif
77+
};
78+
79+
return ipcFsDaxTestParamsList;
80+
}
81+
4682
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(umfIpcTest);
4783

4884
INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsTest, umfIpcTest,
4985
::testing::ValuesIn(ipcManyPoolsTestParamsList));
86+
87+
INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsFSDAXTest, umfIpcTest,
88+
::testing::ValuesIn(getIpcFsDaxTestParamsList()));

test/supp/helgrind-umf_test-ipc.supp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
False-positive race in critnib_insert (lack of instrumentation)
3+
Helgrind:Race
4+
fun:store
5+
fun:critnib_insert
6+
...
7+
}
8+
9+
{
10+
False-positive race in critnib_find (lack of instrumentation)
11+
Helgrind:Race
12+
fun:find_predecessor
13+
fun:find_le
14+
fun:critnib_find
15+
...
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
False-positive race in critnib_insert (lack of instrumentation)
3+
Helgrind:Race
4+
fun:store
5+
fun:critnib_insert
6+
...
7+
}
8+
9+
{
10+
False-positive race in critnib_find (lack of instrumentation)
11+
Helgrind:Race
12+
fun:find_predecessor
13+
fun:find_le
14+
fun:critnib_find
15+
...
16+
}

0 commit comments

Comments
 (0)