summaryrefslogtreecommitdiff
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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libnm-core/tests/test-keyfile.c b/libnm-core/tests/test-keyfile.c
index 84dcffbb9f..9944eb5ef8 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"
@@ -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;
}