ifcfg-rh: fix reading team slave types of vlan type

https://bugzilla.redhat.com/show_bug.cgi?id=1427482
This commit is contained in:
Thomas Haller 2017-02-28 14:26:11 +01:00
parent 5a82494fa6
commit 53018b92e8
2 changed files with 17 additions and 4 deletions

View file

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

View file

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