Skip to content
Merged
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
15 changes: 15 additions & 0 deletions tests/test_privcand.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
#include "np2_test.h"
#include "np2_test_config.h"

#if defined (__has_feature)
# if __has_feature(thread_sanitizer)
# define NP2_TSAN
# endif
#elif defined (__SANITIZE_THREAD__)
# define NP2_TSAN
#endif

#define UPDATE_RPC(RES_MODE) \
" <update xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-private-candidate\">\n" \
" <resolution-mode>"RES_MODE"</resolution-mode>\n" \
Expand Down Expand Up @@ -408,6 +416,9 @@ test_pc_basic_commit(void **state)
FREE_TEST_VARS(st);
}

#ifndef NP2_TSAN
// This test a path in netopeer2 which starts a timer via the C library, and that makes TSAN segfault:
// https://github.com/google/sanitizers/issues/1612
static void
test_pc_commit_timeout_runout(void **state)
{
Expand Down Expand Up @@ -478,6 +489,8 @@ test_pc_commit_timeout_runout(void **state)
ASSERT_NO_NOTIF(st);
}

#endif

static void
test_pc_timeout_confirm(void **state)
{
Expand Down Expand Up @@ -929,7 +942,9 @@ main(int argc, char **argv)
cmocka_unit_test(test_pc_lock_unlock),

cmocka_unit_test_setup_teardown(test_pc_basic_commit, setup_common, teardown_common),
#ifndef NP2_TSAN
cmocka_unit_test_setup_teardown(test_pc_commit_timeout_runout, setup_common, teardown_common),
#endif
cmocka_unit_test_setup_teardown(test_pc_timeout_confirm, setup_common, teardown_common),
cmocka_unit_test_setup_teardown(test_pc_timeout_confirm_modify, setup_common, teardown_common),

Expand Down