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:
Thomas Haller
2014-07-07 17:05:10 +02:00
parent 651daee516
commit 7279e7e150
10 changed files with 273 additions and 15 deletions

View File

@@ -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);
}