diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-16 12:52:58 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-16 13:01:47 +0100 |
commit | dec682f6d13ceabb94521dcc4cf513f6348abfba (patch) | |
tree | 891c6604938be2bb95a185deac7c6bd865a37d34 | |
parent | 3ac6769e60d2c0fb88421cea199292e6279e40e0 (diff) | |
download | NetworkManager-dec682f6d13ceabb94521dcc4cf513f6348abfba.tar.gz |
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
-rw-r--r-- | src/platform/tests/test-link.c | 14 |
1 files 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); |