summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-28 14:26:11 +0100
committerThomas Haller <thaller@redhat.com>2017-03-02 12:14:29 +0100
commit53018b92e8396ecca7aae0dfa1694a1e46209d35 (patch)
tree7b8eb1d1b79c268a0231701ca82b111b5a89ed79
parent5a82494fa6ad8a3a639c7d02b7ddfda1760040dd (diff)
downloadNetworkManager-53018b92e8396ecca7aae0dfa1694a1e46209d35.tar.gz
ifcfg-rh: fix reading team slave types of vlan type
https://bugzilla.redhat.com/show_bug.cgi?id=1427482
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c11
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c10
2 files changed, 17 insertions, 4 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
index bbe990336f..4a128024c7 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
@@ -5087,8 +5087,15 @@ connection_from_file_full (const char *filename,
if (devtype) {
if (!strcasecmp (devtype, TYPE_TEAM))
type = g_strdup (TYPE_TEAM);
- else if (!strcasecmp (devtype, TYPE_TEAM_PORT))
- type = g_strdup (TYPE_ETHERNET);
+ else if (!strcasecmp (devtype, TYPE_TEAM_PORT)) {
+ gs_free char *device = NULL;
+
+ device = svGetValueStr_cp (parsed, "DEVICE");
+ if (device && is_vlan_device (device, parsed))
+ type = g_strdup (TYPE_VLAN);
+ else
+ type = g_strdup (TYPE_ETHERNET);
+ }
g_free (devtype);
}
if (!type) {
diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index 1aeb24c89f..b98ac9dd88 100644
--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -8436,8 +8436,14 @@ test_team_reread_slave (void)
&testfile,
&reread,
&reread_same);
- _assert_reread_same_FIXME ((nmtst_get_rand_int () % 2) ? connection_1 : connection_2, reread);
- g_assert (!reread_same);
+ _assert_reread_same ((nmtst_get_rand_int () % 2) ? connection_1 : connection_2, reread);
+ g_assert (reread_same);
+ g_clear_object (&reread);
+
+ reread = _connection_from_file (testfile, NULL, TYPE_VLAN,
+ NULL);
+ nmtst_assert_connection_equals ((nmtst_get_rand_int () % 2) ? connection_1 : connection_2, FALSE,
+ reread, FALSE);
}
static void