diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-06-26 17:32:50 +0200 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-06-27 17:49:52 +0200 |
commit | b0b31548d9e517a6ea070eb4e7cfdd656661bd66 (patch) | |
tree | adb91f1ab19afc972620d2e1972b4e6d560da2bc | |
parent | a705975a9e6d976de284a1ad1690fab2c4e369c1 (diff) |
tests: fix linux bridge port option test
When configuring the bridge port options the code was checking on port
link type instead of controller link type. In addition, the test is now
being skipped for nm-fake-platform.
-rw-r--r-- | src/core/platform/tests/test-link.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index 41a3afb3c3..153fb62997 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -303,6 +303,15 @@ test_slave(int master, int type, SignalData *master_changed) g_assert(link); g_assert_cmpint(link->port_data.bond.queue_id, ==, 5); g_assert(link->port_data.bond.prio_has || link->port_data.bond.prio == 0); + } else if (link_type == NM_LINK_TYPE_BRIDGE) { + /* Skip this part for nm-fake-platform */ + if (nmtstp_is_root_test() && nmtstp_is_sysfs_writable()) { + g_assert( + nm_platform_sysctl_slave_set_option(NM_PLATFORM_GET, ifindex, "priority", "614")); + value = nm_platform_sysctl_slave_get_option(NM_PLATFORM_GET, ifindex, "priority"); + g_assert_cmpstr(value, ==, "614"); + g_free(value); + } } test_link_changed_signal_arg1 = FALSE; @@ -387,21 +396,6 @@ test_slave(int master, int type, SignalData *master_changed) accept_signals(link_changed, 0, 2); accept_signals(master_changed, 0, 2); - /* Set slave option */ - switch (type) { - case NM_LINK_TYPE_BRIDGE: - if (nmtstp_is_sysfs_writable()) { - g_assert( - nm_platform_sysctl_slave_set_option(NM_PLATFORM_GET, ifindex, "priority", "614")); - value = nm_platform_sysctl_slave_get_option(NM_PLATFORM_GET, ifindex, "priority"); - g_assert_cmpstr(value, ==, "614"); - g_free(value); - } - break; - default: - break; - } - /* Release */ ensure_no_signal(link_added); ensure_no_signal(link_changed); |