/*****************************************************************************/
+static NMConnection *
+_connection_new_from_dbus (GVariant *dict, GError **error)
+{
+ return _nm_simple_connection_new_from_dbus (dict, NM_SETTING_PARSE_FLAGS_NORMALIZE, error);
+}
+
static void
vpn_check_func (const char *key, const char *value, gpointer user_data)
{
NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
"address-data");
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_no_error (error);
g_variant_unref (dict);
NMTST_VARIANT_DROP_PROPERTY (NM_SETTING_IP4_CONFIG_SETTING_NAME,
"address-labels");
);
- conn = nm_simple_connection_new_from_dbus (dict2, &error);
+ conn = _connection_new_from_dbus (dict2, &error);
g_assert_no_error (error);
g_variant_unref (dict2);
g_object_unref (conn);
/* When we reserialize that dictionary as a client, 'address-data' will be preferred. */
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_no_error (error);
s_ip4 = nm_connection_get_setting_ip4_config (conn);
/* But on the server side, 'addresses' will have precedence. */
_nm_utils_is_manager_process = TRUE;
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
_nm_utils_is_manager_process = FALSE;
g_assert_no_error (error);
g_variant_unref (dict);
g_object_unref (conn);
/* sanity-check */
- conn = nm_simple_connection_new_from_dbus (orig_dict, &error);
+ conn = _connection_new_from_dbus (orig_dict, &error);
g_assert_no_error (error);
g_assert (conn);
g_object_unref (conn);
NM_SETTING_WIRELESS_RATE,
"i", 10);
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert (conn);
g_assert_no_error (error);
setting = nm_connection_get_setting (conn, NM_TYPE_SETTING_WIRELESS);
NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
"i", NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR);
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert (conn);
g_assert_no_error (error);
setting = nm_connection_get_setting (conn, NM_TYPE_SETTING_IP6_CONFIG);
NM_SETTING_WIRELESS_RATE,
"s", "ten");
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "802-11-wireless.rate:"));
g_clear_error (&error);
NM_SETTING_WIRELESS_MODE,
"b", FALSE);
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "802-11-wireless.mode:"));
g_clear_error (&error);
NM_SETTING_WIRELESS_SSID,
"s", "fred");
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "802-11-wireless.ssid:"));
g_clear_error (&error);
NM_SETTING_WIRELESS_BSSID,
"i", 42);
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "802-11-wireless.bssid:"));
g_clear_error (&error);
NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
"s", "private");
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "ipv6.ip6-privacy:"));
g_clear_error (&error);
NM_SETTING_IP_CONFIG_ADDRESSES,
"s", "1234::5678");
);
- conn = nm_simple_connection_new_from_dbus (dict, &error);
+ conn = _connection_new_from_dbus (dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_assert (g_str_has_prefix (error->message, "ipv6.addresses:"));
g_clear_error (&error);
g_assert (new_settings);
/* Replace settings and test */
- connection = nm_simple_connection_new_from_dbus (new_settings, &error);
+ connection = _connection_new_from_dbus (new_settings, &error);
g_assert_no_error (error);
g_assert (connection);
":::this-is-not-a-valid-interface-name:::");
);
- con = nm_simple_connection_new_from_dbus (connection_dict, &error);
+ con = _connection_new_from_dbus (connection_dict, &error);
g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY);
g_clear_error (&error);
IFACE_VIRT);
);
- con = nm_simple_connection_new_from_dbus (connection_dict, &error);
+ con = _connection_new_from_dbus (connection_dict, &error);
g_assert_no_error (error);
g_assert_cmpstr (nm_connection_get_interface_name (con), ==, IFACE_NAME);
NM_SETTING_CONNECTION_INTERFACE_NAME);
);
- con = nm_simple_connection_new_from_dbus (connection_dict, &error);
+ con = _connection_new_from_dbus (connection_dict, &error);
g_assert_no_error (error);
g_assert_cmpstr (nm_connection_get_interface_name (con), ==, IFACE_VIRT);
"address-data");
);
- conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ conn = _connection_new_from_dbus (conn_dict, &error);
g_assert_no_error (error);
s_ip4 = (NMSettingIPConfig *) nm_connection_get_setting_ip4_config (conn);
"addresses", "aau", &addrs_builder);
);
- conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ conn = _connection_new_from_dbus (conn_dict, &error);
g_assert_no_error (error);
g_variant_unref (conn_dict);
"address-data");
);
- conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ conn = _connection_new_from_dbus (conn_dict, &error);
g_assert_no_error (error);
s_ip6 = (NMSettingIPConfig *) nm_connection_get_setting_ip6_config (conn);
"addresses", "a(ayuay)", &addrs_builder);
);
- conn = nm_simple_connection_new_from_dbus (conn_dict, &error);
+ conn = _connection_new_from_dbus (conn_dict, &error);
g_assert_no_error (error);
g_variant_unref (conn_dict);