diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-16 12:52:58 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-02-25 15:18:06 +0100 |
commit | cd6ee5786a4230b0f51952f5f350676b21961271 (patch) | |
tree | 1512cea4c63724c43c4bb810a67e831defcb3a8f | |
parent | 46819838e72b8e4a09f7d1b88d0ea93efac57764 (diff) | |
download | NetworkManager-cd6ee5786a4230b0f51952f5f350676b21961271.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
(cherry picked from commit dec682f6d13ceabb94521dcc4cf513f6348abfba)
-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 47cbcec153..08f8d5111c 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -279,9 +279,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); |