libnm-core: normalize slave-type and slave-settings of connections
Some NMSettingConnection:slave-type types require a matching slave #NMSetting. Add normalization of either the 'slave-type' property or the slave-setting. Also be more strict in NMSettingConnection:verify() to enforce an existing slave-setting depending on the slave-type. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -14409,8 +14409,11 @@ test_read_team_port_empty_config (void)
|
||||
g_assert_cmpstr (nm_setting_connection_get_connection_type (s_con), ==, NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr (nm_setting_connection_get_master (s_con), ==, "team0");
|
||||
|
||||
/* Empty TEAM_PORT_CONFIG means no team-port setting */
|
||||
g_assert (nm_connection_get_setting_team_port (connection) == NULL);
|
||||
/* Normalization adds a team-port setting */
|
||||
g_assert (nm_connection_get_setting_team_port (connection));
|
||||
|
||||
/* empty/missing config */
|
||||
g_assert (!nm_setting_team_port_get_config (nm_connection_get_setting_team_port (connection)));
|
||||
|
||||
g_object_unref (connection);
|
||||
}
|
||||
|
Reference in New Issue
Block a user