summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-06-30 14:22:49 +0200
committerThomas Haller <thaller@redhat.com>2021-07-08 17:20:14 +0200
commitf9dc0252db1620b049c5f98e7fe7d249e491cea2 (patch)
tree283cdcd5cbd13aae93607d169a3b03b30bdc7545
parentf929bc9945e334ff89cee6598ecffcd749f52c93 (diff)
downloadNetworkManager-f9dc0252db1620b049c5f98e7fe7d249e491cea2.tar.gz
libnm/tests: add test for normalizing "dummy" connection
-rw-r--r--src/libnm-core-impl/tests/test-setting.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c
index 6b65e98d26..ca56e57e90 100644
--- a/src/libnm-core-impl/tests/test-setting.c
+++ b/src/libnm-core-impl/tests/test-setting.c
@@ -874,6 +874,34 @@ test_bond_normalize(void)
/*****************************************************************************/
+static void
+test_dummy_normalize(void)
+{
+ gs_unref_object NMConnection *connection = NULL;
+ NMSettingConnection * s_con;
+
+ connection = nm_simple_connection_new();
+ s_con = NM_SETTING_CONNECTION(nm_setting_connection_new());
+ nm_connection_add_setting(connection, NM_SETTING(s_con));
+
+ g_object_set(s_con,
+ NM_SETTING_CONNECTION_ID,
+ "dummy-test",
+ NM_SETTING_CONNECTION_UUID,
+ nm_uuid_generate_random_str_a(),
+ NM_SETTING_CONNECTION_TYPE,
+ NM_SETTING_DUMMY_SETTING_NAME,
+ NULL);
+
+ nmtst_assert_connection_unnormalizable(connection, 0, 0);
+
+ g_object_set(s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, "dummy1", NULL);
+
+ nmtst_connection_normalize(connection);
+}
+
+/*****************************************************************************/
+
#define DCB_FLAGS_ALL \
(NM_SETTING_DCB_FLAG_ENABLE | NM_SETTING_DCB_FLAG_ADVERTISE | NM_SETTING_DCB_FLAG_WILLING)
@@ -4741,6 +4769,8 @@ main(int argc, char **argv)
g_test_add_func("/libnm/settings/bond/compare", test_bond_compare);
g_test_add_func("/libnm/settings/bond/normalize", test_bond_normalize);
+ g_test_add_func("/libnm/settings/dummy/normalize", test_dummy_normalize);
+
g_test_add_func("/libnm/settings/dcb/flags-valid", test_dcb_flags_valid);
g_test_add_func("/libnm/settings/dcb/flags-invalid", test_dcb_flags_invalid);
g_test_add_func("/libnm/settings/dcb/app-priorities", test_dcb_app_priorities);