From dec682f6d13ceabb94521dcc4cf513f6348abfba Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 16 Feb 2016 12:52:58 +0100 Subject: [PATCH] platform/tests: workaround test failure for kernel bug Unenslaving from a bridge can cause a spurious RTM_DELLINK signal. NMPlatform does raise those signals, but fixes the state of the cache afterwards. Workaround the test failure. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1285719 --- src/platform/tests/test-link.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 8b4962620b..6e6e4418ad 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -290,9 +290,17 @@ test_slave (int master, int type, SignalData *master_changed) ensure_no_signal (link_removed); g_assert (nm_platform_link_release (NM_PLATFORM_GET, master, ifindex)); g_assert_cmpint (nm_platform_link_get_master (NM_PLATFORM_GET, ifindex), ==, 0); - accept_signals (link_added, 0, 1); - accept_signals (link_changed, 1, 3); - accept_signals (link_removed, 0, 1); + if (link_changed->received_count > 0) { + accept_signals (link_added, 0, 1); + accept_signals (link_changed, 1, 3); + accept_signals (link_removed, 0, 1); + } else { + /* Due to https://bugzilla.redhat.com/show_bug.cgi?id=1285719 , kernel might send a + * wrong RTM_DELLINK message so that we instead see an removed+added signal. */ + accept_signal (link_added); + ensure_no_signal (link_changed); + accept_signal (link_removed); + } accept_signals (master_changed, 1, 2); ensure_no_signal (master_changed);