summary refs log tree commit diff
path: root/libnm-core/tests/test-keyfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/tests/test-keyfile.c')
-rw-r--r--libnm-core/tests/test-keyfile.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/libnm-core/tests/test-keyfile.c b/libnm-core/tests/test-keyfile.c
index b9b211b6..9944eb5e 100644
--- a/libnm-core/tests/test-keyfile.c
+++ b/libnm-core/tests/test-keyfile.c
@@ -28,6 +28,7 @@
 #include "nm-setting-wired.h"
 #include "nm-setting-8021x.h"
 #include "nm-setting-team.h"
+#include "nm-setting-proxy.h"
 
 #include "nm-utils/nm-test-utils.h"
 
@@ -36,7 +37,7 @@
 #define TEST_WIRED_TLS_PRIVKEY     TEST_CERT_DIR"/test-key-and-cert.pem"
 
 
-/******************************************************************************/
+/*****************************************************************************/
 
 #define CLEAR(con, keyfile) \
 	G_STMT_START { \
@@ -115,8 +116,21 @@ _nm_keyfile_read (GKeyFile *keyfile,
 	if (needs_normalization) {
 		nmtst_assert_connection_verifies_after_normalization (con, 0, 0);
 		nmtst_connection_normalize (con);
-	} else
+	} else {
+		{
+			NMSettingConnection *s_con;
+
+			/* a non-slave connection must have a proxy setting, but
+			 * keyfile reader does not add that (unless a [proxy] section
+			 * is present. */
+			s_con = nm_connection_get_setting_connection (con);
+			if (   s_con
+			    && !nm_setting_connection_get_master (s_con)
+			    && !nm_connection_get_setting_proxy (con))
+				nm_connection_add_setting (con, nm_setting_proxy_new ());
+		}
 		nmtst_assert_connection_verifies_without_normalization (con);
+	}
 	return con;
 }
 
@@ -219,7 +233,7 @@ _keyfile_convert (NMConnection **con,
 	}
 }
 
-/******************************************************************************/
+/*****************************************************************************/
 
 static void
 _test_8021x_cert_check (NMConnection *con,
@@ -359,7 +373,7 @@ test_8021x_cert (void)
 
 }
 
-/******************************************************************************/
+/*****************************************************************************/
 
 static void
 test_8021x_cert_read (void)
@@ -567,7 +581,7 @@ test_team_conf_read_invalid (void)
 #endif
 }
 
-/******************************************************************************/
+/*****************************************************************************/
 
 NMTST_DEFINE ();