summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-07-11 11:01:52 +0200
committerThomas Haller <thaller@redhat.com>2014-07-28 00:10:06 +0200
commitbd693b88f416808efb500e2115c9e88b58dc340f (patch)
treeea142378229b9853ddd58ed3b84d6e662be46184
parent727cba5cd7caf6d84d9142e1b6339c9694bb4cab (diff)
downloadNetworkManager-bd693b88f416808efb500e2115c9e88b58dc340f.tar.gz
keyfile/tests: add read_connection_from_file() utility function
-rw-r--r--src/settings/plugins/keyfile/tests/test-keyfile.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/settings/plugins/keyfile/tests/test-keyfile.c b/src/settings/plugins/keyfile/tests/test-keyfile.c
index 634d98c106..d9de86ec46 100644
--- a/src/settings/plugins/keyfile/tests/test-keyfile.c
+++ b/src/settings/plugins/keyfile/tests/test-keyfile.c
@@ -116,6 +116,27 @@ check_ip6_route (NMSettingIP6Config *config, int idx, const char *destination_st
g_assert (nm_ip6_route_get_metric (route) == metric);
}
+static NMConnection *
+keyfile_read_connection_from_file (const char *filename)
+{
+ GError *error = NULL;
+ NMConnection *connection;
+ gboolean success;
+
+ g_assert (filename);
+
+ connection = nm_keyfile_plugin_connection_from_file (filename, &error);
+
+ g_assert_no_error (error);
+ g_assert (NM_IS_CONNECTION (connection));
+
+ success = nm_connection_verify (connection, &error);
+ g_assert_no_error (error);
+ g_assert (success);
+
+ return connection;
+}
+
static void
test_read_valid_wired_connection (void)
{