summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clients/common/nm-meta-setting-desc.c1
-rw-r--r--libnm-core/nm-setting-team.c1
-rw-r--r--libnm-core/nm-setting-team.h1
-rw-r--r--libnm-core/tests/test-setting.c14
4 files changed, 17 insertions, 0 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index a9dfb1018..a47b8f7b5 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -6596,6 +6596,7 @@ static const NMMetaPropertyInfo *const property_infos_TEAM[] = {
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = VALUES_STATIC (NM_SETTING_TEAM_RUNNER_BROADCAST,
NM_SETTING_TEAM_RUNNER_ROUNDROBIN,
+ NM_SETTING_TEAM_RUNNER_RANDOM,
NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP,
NM_SETTING_TEAM_RUNNER_LOADBALANCE,
NM_SETTING_TEAM_RUNNER_LACP),
diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c
index b49627c57..65e263477 100644
--- a/libnm-core/nm-setting-team.c
+++ b/libnm-core/nm-setting-team.c
@@ -1171,6 +1171,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
if ( priv->runner
&& g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_BROADCAST)
&& g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_ROUNDROBIN)
+ && g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_RANDOM)
&& g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP)
&& g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_LOADBALANCE)
&& g_ascii_strcasecmp (priv->runner, NM_SETTING_TEAM_RUNNER_LACP)) {
diff --git a/libnm-core/nm-setting-team.h b/libnm-core/nm-setting-team.h
index f5e1290cd..492b2a660 100644
--- a/libnm-core/nm-setting-team.h
+++ b/libnm-core/nm-setting-team.h
@@ -131,6 +131,7 @@ NMTeamLinkWatcherArpPingFlags nm_team_link_watcher_get_flags (NMTeamLinkWatcher
#define NM_SETTING_TEAM_RUNNER_BROADCAST "broadcast"
#define NM_SETTING_TEAM_RUNNER_ROUNDROBIN "roundrobin"
+#define NM_SETTING_TEAM_RUNNER_RANDOM "random"
#define NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP "activebackup"
#define NM_SETTING_TEAM_RUNNER_LOADBALANCE "loadbalance"
#define NM_SETTING_TEAM_RUNNER_LACP "lacp"
diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c
index 239cb876d..d0e0b3777 100644
--- a/libnm-core/tests/test-setting.c
+++ b/libnm-core/tests/test-setting.c
@@ -969,6 +969,18 @@ test_runner_broadcast_sync_from_config (void)
}
static void
+test_runner_random_sync_from_config (void)
+{
+ _test_team_config_sync ("{\"runner\": {\"name\": \"random\"}}",
+ 0, 0, 0, 0,
+ NM_SETTING_TEAM_RUNNER_RANDOM,
+ NULL,
+ NULL, NULL, -1,
+ FALSE, FALSE, -1, -1, NULL,
+ NULL);
+}
+
+static void
test_runner_activebackup_sync_from_config (void)
{
_test_team_config_sync ("{\"runner\": {\"name\": \"activebackup\"}}",
@@ -1605,6 +1617,8 @@ main (int argc, char **argv)
test_runner_roundrobin_sync_from_config);
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_broadcast",
test_runner_broadcast_sync_from_config);
+ g_test_add_func ("/libnm/settings/team/sync_runner_from_config_random",
+ test_runner_random_sync_from_config);
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_activebackup",
test_runner_activebackup_sync_from_config);
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_loadbalance",