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
This commit is contained in:
Thomas Haller 2016-02-16 12:52:58 +01:00
parent 3ac6769e60
commit dec682f6d1

View file

@ -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);