From d68fa9119929b31654199885c8bf207befbb9292 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 25 Sep 2021 10:06:16 +0200 Subject: [PATCH] platform/tests: fix assertion failure in NMTstpAcdDefender Seems we can get a DOWN event during unit tests. I don't really understand why, but let's ignore it. [...] #4 0x000055e365777786 in _l3_acd_nacd_event (fd=, condition=, user_data=0x55e367566270) at src/core/platform/tests/test-common.c:2703 #5 0x00007f4399c224cf in g_main_dispatch (context=0x55e36755fce0) at ../glib/gmain.c:3337 #6 g_main_context_dispatch (context=0x55e36755fce0) at ../glib/gmain.c:4055 #7 0x00007f4399c764f8 in g_main_context_iterate.constprop.0 (context=context@entry=0x55e36755fce0, block=block@entry=1, dispatch=dispatch@entry=1, self=) at ../glib/gmain.c:4131 #8 0x00007f4399c1fc03 in g_main_context_iteration (context=0x55e36755fce0, context@entry=0x0, may_block=may_block@entry=1) at ../glib/gmain.c:4196 #9 0x000055e365770719 in test_l3_ipv6ll (test_data=) at src/core/tests/test-l3cfg.c:1024 --- src/core/platform/tests/test-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/platform/tests/test-common.c b/src/core/platform/tests/test-common.c index ad6bc114bc..4f56a3a776 100644 --- a/src/core/platform/tests/test-common.c +++ b/src/core/platform/tests/test-common.c @@ -2696,9 +2696,13 @@ _l3_acd_nacd_event(int fd, GIOCondition condition, gpointer user_data) NM_HASH_OBFUSCATE_PTR(defender), NM_ETHER_ADDR_FORMAT_VAL((const NMEtherAddr *) event->defended.sender)); break; + case N_ACD_EVENT_DOWN: + /* Not sure why this sometimes happens. But this is only the test stub, ignore it. */ + _LOGT("acd-defender[" NM_HASH_OBFUSCATE_PTR_FMT "]: link down event received", + NM_HASH_OBFUSCATE_PTR(defender)); + break; case N_ACD_EVENT_USED: case N_ACD_EVENT_CONFLICT: - case N_ACD_EVENT_DOWN: default: g_assert_not_reached(); break;