From 356849f70c72f920d1600ab98611f9f7ed10214c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 09:57:36 -0500 Subject: [PATCH 1/5] ifcfg-rh: split connection_from_file() / connection_from_file_test() Rather than having the "real" users of connection_from_file() have to pass a dozen NULL arguments, add a separate connection_from_file_test() for use by test-ifcfg-rh. (Likewise, since no test cases care about ignore_error, remove that argument from connection_from_file_test().) --- .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 15 +- src/settings/plugins/ifcfg-rh/reader.c | 54 +- src/settings/plugins/ifcfg-rh/reader.h | 15 +- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 1918 ++++++++--------- 4 files changed, 923 insertions(+), 1079 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 7596cbd5f1..caa1f4ba21 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -117,18 +117,10 @@ nm_ifcfg_connection_new (NMConnection *source, if (source) tmp = g_object_ref (source); else { - char *keyfile = NULL, *routefile = NULL, *route6file = NULL; - - tmp = connection_from_file (full_path, NULL, NULL, + tmp = connection_from_file (full_path, &unhandled_spec, - &keyfile, - &routefile, - &route6file, error, ignore_error); - g_free (keyfile); - g_free (routefile); - g_free (route6file); if (!tmp) return NULL; @@ -267,10 +259,7 @@ commit_changes (NMSettingsConnection *connection, * it if it's really changed. */ if (priv->path) { - reread = connection_from_file (priv->path, NULL, NULL, - NULL, NULL, NULL, NULL, - &error, NULL); - g_clear_error (&error); + reread = connection_from_file (priv->path, NULL, NULL, NULL); if (reread) { same = nm_connection_compare (NM_CONNECTION (connection), reread, diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 145a0a3915..1c2b566d1f 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4624,16 +4624,16 @@ check_dns_search_domains (shvarFile *ifcfg, NMSetting *s_ip4, NMSetting *s_ip6) } } -NMConnection * -connection_from_file (const char *filename, - const char *network_file, /* for unit tests only */ - const char *test_type, /* for unit tests only */ - char **out_unhandled, - char **out_keyfile, - char **out_routefile, - char **out_route6file, - GError **error, - gboolean *out_ignore_error) +static NMConnection * +connection_from_file_full (const char *filename, + const char *network_file, /* for unit tests only */ + const char *test_type, /* for unit tests only */ + char **out_unhandled, + char **out_keyfile, + char **out_routefile, + char **out_route6file, + GError **error, + gboolean *out_ignore_error) { NMConnection *connection = NULL; shvarFile *parsed; @@ -4839,3 +4839,37 @@ done: return connection; } +NMConnection * +connection_from_file (const char *filename, + char **out_unhandled, + GError **error, + gboolean *out_ignore_error) +{ + return connection_from_file_full (filename, NULL, NULL, + out_unhandled, + NULL, NULL, NULL, + error, + out_ignore_error); +} + +NMConnection * +connection_from_file_test (const char *filename, + const char *network_file, + const char *test_type, + char **out_unhandled, + char **out_keyfile, + char **out_routefile, + char **out_route6file, + GError **error) +{ + return connection_from_file_full (filename, + network_file, + test_type, + out_unhandled, + out_keyfile, + out_routefile, + out_route6file, + error, + NULL); +} + diff --git a/src/settings/plugins/ifcfg-rh/reader.h b/src/settings/plugins/ifcfg-rh/reader.h index c23e5870ef..7fafc56783 100644 --- a/src/settings/plugins/ifcfg-rh/reader.h +++ b/src/settings/plugins/ifcfg-rh/reader.h @@ -27,15 +27,20 @@ #include "shvar.h" NMConnection *connection_from_file (const char *filename, - const char *network_file, /* for unit tests only */ - const char *test_type, /* for unit tests only */ char **out_unhandled, - char **out_keyfile, - char **out_routefile, - char **out_route6file, GError **error, gboolean *out_ignore_error); char *uuid_from_file (const char *filename); +/* for test-ifcfg-rh */ +NMConnection *connection_from_file_test (const char *filename, + const char *network_file, + const char *test_type, + char **out_unhandled, + char **out_keyfile, + char **out_routefile, + char **out_route6file, + GError **error); + #endif /* __READER_H__ */ diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 4a6940d0d0..ce133c0df0 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -194,8 +194,8 @@ test_read_basic (void) guint64 expected_timestamp = 0; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-minimal", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-minimal", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -254,8 +254,8 @@ test_read_miscellaneous_variables (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid MAC in HWADDR_BLACKLIST 'XX:aa:invalid'*"); - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-misc-variables", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-misc-variables", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection); @@ -304,8 +304,8 @@ test_read_variables_corner_cases (void) guint64 expected_timestamp = 0; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-variables-corner-cases-1", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-variables-corner-cases-1", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -350,10 +350,10 @@ test_read_unmanaged (void) guint64 expected_timestamp = 0; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled", - NULL, TYPE_ETHERNET, - &unhandled_spec, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled", + NULL, TYPE_ETHERNET, + &unhandled_spec, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -383,10 +383,10 @@ test_read_unmanaged_unrecognized (void) guint64 expected_timestamp = 0; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled-unrecognized", - NULL, NULL, - &unhandled_spec, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled-unrecognized", + NULL, NULL, + &unhandled_spec, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -414,10 +414,10 @@ test_read_unrecognized (void) guint64 expected_timestamp = 0; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-unrecognized", - NULL, NULL, - &unhandled_spec, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-unrecognized", + NULL, NULL, + &unhandled_spec, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -452,8 +452,8 @@ test_read_wired_static (const char *file, NMIPAddress *ip6_addr; gboolean success; - connection = connection_from_file (file, NULL, TYPE_ETHERNET, - &unmanaged, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, + &unmanaged, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -547,8 +547,8 @@ test_read_wired_static_no_prefix (gconstpointer user_data) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*missing PREFIX, assuming*"); - connection = connection_from_file (file, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection); @@ -587,7 +587,6 @@ test_read_wired_dhcp (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *mac; char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee }; @@ -595,15 +594,14 @@ test_read_wired_dhcp (void) const char *expected_id = "System test-wired-dhcp"; const char *expected_dhcp_hostname = "foobar"; - connection = connection_from_file (TEST_IFCFG_WIRED_DHCP, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_DHCP, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); @@ -740,9 +738,9 @@ test_read_wired_dhcp_plus_ip (void) NMIPAddress *ip6_addr; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", - NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", + NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -817,9 +815,9 @@ test_read_wired_global_gateway (void) NMIPAddress *ip4_addr; char *unmanaged = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway", - TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway", - TYPE_ETHERNET, &unmanaged, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway", + TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway", + TYPE_ETHERNET, &unmanaged, NULL, NULL, NULL, &error); nmtst_assert_connection_verifies_without_normalization (connection); g_assert (unmanaged == NULL); @@ -857,9 +855,9 @@ test_read_wired_never_default (void) NMSettingIPConfig *s_ip6; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default", - TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default", - TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default", + TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default", + TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); nmtst_assert_connection_verifies_without_normalization (connection); /* ===== WIRED SETTING ===== */ @@ -895,20 +893,18 @@ test_read_wired_defroute_no (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no"; - connection = connection_from_file (TEST_IFCFG_WIRED_DEFROUTE_NO, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_DEFROUTE_NO, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); @@ -1013,20 +1009,18 @@ test_read_wired_defroute_no_gatewaydev_yes (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no-gatewaydev-yes"; - connection = connection_from_file (TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, - TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-defroute-no-gatewaydev-yes-read", "failed to read %s: %s", @@ -1134,8 +1128,8 @@ test_read_wired_static_routes (void) GError *error = NULL; NMIPRoute *ip4_route; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); nmtst_assert_connection_verifies_without_normalization (connection); /* ===== CONNECTION SETTING ===== */ @@ -1185,21 +1179,19 @@ test_read_wired_static_routes_legacy (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; NMIPRoute *ip4_route; const char *expected_id = "System test-wired-static-routes-legacy"; - connection = connection_from_file (TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-static-routes-legacy-read", @@ -1309,20 +1301,18 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; - connection = connection_from_file (file, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (file, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-ipv4-manual-read", "failed to read %s: %s", file, error->message); @@ -1423,7 +1413,6 @@ test_read_wired_ipv6_manual (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-manual"; @@ -1432,15 +1421,14 @@ test_read_wired_ipv6_manual (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring manual default route*"); - connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_MANUAL, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_IPV6_MANUAL, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, @@ -1656,22 +1644,20 @@ test_read_wired_ipv6_only (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-only"; NMIPAddress *ip6_addr; const char *method; - connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_ONLY, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_IPV6_ONLY, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); @@ -1794,21 +1780,19 @@ test_read_wired_dhcp6_only (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-dhcp6-only"; const char *method; - connection = connection_from_file (TEST_IFCFG_WIRED_DHCP6_ONLY, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_DHCP6_ONLY, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); @@ -1896,18 +1880,16 @@ test_read_onboot_no (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_ONBOOT_NO, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_ONBOOT_NO, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); @@ -1951,18 +1933,16 @@ test_read_noip (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_NOIP, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_NOIP, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); g_assert_no_error (error); @@ -1999,7 +1979,6 @@ test_read_wired_8021x_peap_mschapv2 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_identity = "David Smith"; @@ -2009,15 +1988,14 @@ test_read_wired_8021x_peap_mschapv2 (void) const char *expected_ca_cert_path; const char *read_ca_cert_path; - connection = connection_from_file (TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); @@ -2196,21 +2174,19 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *expected_identity = "David Smith"; gboolean success = FALSE; char *dirname, *tmp; - connection = connection_from_file (ifcfg, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (ifcfg, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection); @@ -2260,9 +2236,9 @@ test_read_write_802_1X_subj_matches (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*missing IEEE_8021X_CA_CERT*peap*"); - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1X-subj-matches", - NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1X-subj-matches", + NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection != NULL); @@ -2295,8 +2271,8 @@ test_read_write_802_1X_subj_matches (void) /* re-read the connection for comparison */ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*missing IEEE_8021X_CA_CERT*peap*"); - reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); unlink (written); g_free (written); @@ -2343,8 +2319,8 @@ test_read_802_1x_ttls_eapgtc (void) * NMSetting8021x::autheap property. */ - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1x-ttls-eapgtc", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1x-ttls-eapgtc", + NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -2378,7 +2354,6 @@ test_read_wired_aliases_good (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System aliasem0"; @@ -2388,15 +2363,14 @@ test_read_wired_aliases_good (void) const char *expected_gateway = "192.168.1.1"; int i, j; - connection = connection_from_file (TEST_IFCFG_ALIASES_GOOD, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_ALIASES_GOOD, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "aliases-good-read", "failed to read %s: %s", TEST_IFCFG_ALIASES_GOOD, error->message); @@ -2501,20 +2475,18 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; - connection = connection_from_file (base, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (base, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, "aliases-bad-read", "failed to read %s: %s", base, error->message); @@ -2615,7 +2587,6 @@ test_read_wifi_open (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2627,15 +2598,14 @@ test_read_wifi_open (void) const char *expected_mode = "infrastructure"; const guint32 expected_channel = 1; - connection = connection_from_file (TEST_IFCFG_WIFI_OPEN, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); @@ -2791,21 +2761,19 @@ test_read_wifi_open_auto (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-open-auto)"; const char *expected_mode = "infrastructure"; - connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_AUTO, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_AUTO, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); @@ -2872,22 +2840,20 @@ test_read_wifi_open_ssid_hex (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; const char *expected_id = "System blahblah (test-wifi-open-ssid-hex)"; const char *expected_ssid = "blahblah"; - connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_SSID_HEX, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); @@ -2956,18 +2922,16 @@ test_read_wifi_open_ssid_bad (const char *file, const char *test) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (file, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (file, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); g_clear_error (&error); @@ -2989,22 +2953,20 @@ test_read_wifi_open_ssid_quoted (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; const char *expected_id = "System foo\"bar\\ (test-wifi-open-ssid-quoted)"; const char *expected_ssid = "foo\"bar\\"; - connection = connection_from_file (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); @@ -3079,7 +3041,6 @@ test_read_wifi_wep (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3093,15 +3054,14 @@ test_read_wifi_wep (void) const char *expected_wep_key0 = "0123456789abcdef0123456789"; NMWepKeyType key_type; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message); @@ -3337,7 +3297,6 @@ test_read_wifi_wep_adhoc (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3346,15 +3305,14 @@ test_read_wifi_wep_adhoc (void) const char *expected_mode = "adhoc"; const char *expected_wep_key0 = "0123456789abcdef0123456789"; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_ADHOC, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_ADHOC, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); @@ -3576,21 +3534,19 @@ test_read_wifi_wep_passphrase (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "foobar222blahblah"; NMWepKeyType key_type; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_PASSPHRASE, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-passphrase-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message); @@ -3701,21 +3657,19 @@ test_read_wifi_wep_40_ascii (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "Lorem"; NMWepKeyType key_type; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_40_ASCII, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_40_ASCII, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); @@ -3824,21 +3778,19 @@ test_read_wifi_wep_104_ascii (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "LoremIpsumSit"; NMWepKeyType key_type; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_104_ASCII, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_104_ASCII, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); @@ -3947,22 +3899,20 @@ test_read_wifi_leap (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-leap)"; const char *expected_identity = "Bill Smith"; const char *expected_password = "foobarblah"; - connection = connection_from_file (TEST_IFCFG_WIFI_LEAP, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_LEAP, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); @@ -4072,20 +4022,18 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *expected_identity = "Bill Smith"; gboolean success; - connection = connection_from_file (file, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (file, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection); @@ -4129,7 +4077,6 @@ test_read_wifi_wpa_psk (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4152,15 +4099,14 @@ test_read_wifi_wpa_psk (void) gboolean found_proto_wpa = FALSE; gboolean found_proto_rsn = FALSE; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); @@ -4429,21 +4375,19 @@ test_read_wifi_wpa_psk_2 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System ipsum (test-wifi-wpa-psk-2)"; const char *expected_psk = "They're really saying I love you. >>`<< \\"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_2, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_2, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-psk-2-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_2, error->message); @@ -4520,21 +4464,19 @@ test_read_wifi_wpa_psk_unquoted (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-unquoted)"; const char *expected_psk = "54336845e2f3f321c4c7"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); @@ -4608,22 +4550,20 @@ test_read_wifi_wpa_psk_unquoted2 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; /* Ensure a quoted 64-character WPA passphrase will fail since passphrases * must be between 8 and 63 ASCII characters inclusive per the WPA spec. */ - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection == NULL, "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); g_clear_error (&error); @@ -4648,7 +4588,6 @@ test_read_wifi_wpa_psk_adhoc (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-adhoc)"; @@ -4658,15 +4597,14 @@ test_read_wifi_wpa_psk_adhoc (void) const char *expected_group = "ccmp"; const char *expected_proto = "wpa"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_ADHOC, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); @@ -4826,7 +4764,6 @@ test_read_wifi_wpa_psk_hex (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4835,15 +4772,14 @@ test_read_wifi_wpa_psk_hex (void) const char *expected_key_mgmt = "wpa-psk"; const char *expected_psk = "1da190379817bc360dda52e85c388c439a21ea5c7bf819c64e9da051807deae6"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_HEX, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_HEX, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); @@ -4970,21 +4906,19 @@ test_read_wifi_wpa_eap_tls (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Bill Smith"; const char *expected_privkey_password = "test1"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_EAP_TLS, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_EAP_TLS, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); @@ -5110,21 +5044,19 @@ test_read_wifi_wpa_eap_ttls_tls (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Chuck Shumer"; const char *expected_privkey_password = "test1"; - connection = connection_from_file (TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); @@ -5267,18 +5199,17 @@ test_read_wifi_dynamic_wep_leap (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE, success; + gboolean success; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection); @@ -5341,22 +5272,20 @@ test_read_wifi_wep_eap_ttls_chap (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_password = "foobar baz"; const char *expected_identity = "David Smith"; const char *expected_key_mgmt = "ieee8021x"; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); @@ -5496,8 +5425,8 @@ test_read_wifi_hidden (void) gboolean success; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-hidden", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-hidden", + NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5584,8 +5513,8 @@ test_write_wifi_hidden (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, + NULL, NULL, NULL, NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -5610,8 +5539,8 @@ test_read_wifi_band_a (void) gboolean success; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a", + NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5698,8 +5627,8 @@ test_write_wifi_band_a (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, + NULL, NULL, NULL, NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -5721,8 +5650,8 @@ test_read_wifi_band_a_channel_mismatch (void) NMConnection *connection; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a-channel-mismatch", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a-channel-mismatch", + NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); g_assert (connection == NULL); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); } @@ -5733,8 +5662,8 @@ test_read_wifi_band_bg_channel_mismatch (void) NMConnection *connection; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-bg-channel-mismatch", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-bg-channel-mismatch", + NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); g_assert (connection == NULL); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); } @@ -5752,7 +5681,6 @@ test_read_wired_qeth_static (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-qeth-static"; @@ -5762,15 +5690,14 @@ test_read_wired_qeth_static (void) const char *expected_channel2 = "0.0.0602"; const char * const *subchannels; - connection = connection_from_file (TEST_IFCFG_WIRED_QETH_STATIC, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_QETH_STATIC, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); @@ -5921,7 +5848,6 @@ test_read_wired_ctc_static (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ctc-static"; @@ -5930,15 +5856,14 @@ test_read_wired_ctc_static (void) const char * const *subchannels; gboolean success; - connection = connection_from_file (TEST_IFCFG_WIRED_CTC_STATIC, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIRED_CTC_STATIC, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection); @@ -5994,21 +5919,19 @@ test_read_wifi_wep_no_keys (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *tmp; const char *expected_id = "System foobar (test-wifi-wep-no-keys)"; NMWepKeyType key_type; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_NO_KEYS, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_NO_KEYS, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "wifi-wep-no-keys-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_NO_KEYS, error->message); @@ -6104,20 +6027,19 @@ test_read_permissions (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE, success; + gboolean success; GError *error = NULL; guint32 num; const char *tmp; - connection = connection_from_file (TEST_IFCFG_PERMISSIONS, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_PERMISSIONS, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "permissions-read", "failed to read %s: %s", TEST_IFCFG_PERMISSIONS, error->message); @@ -6178,21 +6100,19 @@ test_read_wifi_wep_agent_keys (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; NMWepKeyType key_type; gboolean success; NMSettingSecretFlags flags; - connection = connection_from_file (TEST_IFCFG_WIFI_WEP_AGENT_KEYS, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_AGENT_KEYS, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection != NULL); success = nm_connection_verify (connection, &error); @@ -6260,7 +6180,6 @@ test_write_wired_static (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -6378,15 +6297,14 @@ test_write_wired_static (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -6438,7 +6356,6 @@ test_write_wired_dhcp (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -6500,15 +6417,14 @@ test_write_wired_dhcp (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -6537,9 +6453,9 @@ test_write_wired_dhcp_plus_ip (void) GError *error = NULL; gboolean success = FALSE; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", - NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", + NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -6553,8 +6469,8 @@ test_write_wired_dhcp_plus_ip (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); unlink (written); g_free (written); @@ -6583,9 +6499,9 @@ test_read_write_wired_dhcp_send_hostname (void) GError *error = NULL; gboolean success = FALSE; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-send-hostname", - NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-send-hostname", + NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -6613,8 +6529,8 @@ test_read_write_wired_dhcp_send_hostname (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); unlink (written); g_free (written); @@ -6661,7 +6577,6 @@ test_write_wired_static_ip6_only (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -6729,15 +6644,14 @@ test_write_wired_static_ip6_only (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -6786,7 +6700,6 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data) GError *error = NULL; char *testfile = NULL; char *id = NULL; - gboolean ignore_error = FALSE; char *written_ifcfg_gateway; const char *gateway6 = user_data; @@ -6854,13 +6767,12 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + NULL, NULL, + NULL, NULL, + &error); g_assert_no_error (error); g_assert (reread); g_assert (nm_connection_verify (reread, &error)); @@ -6917,20 +6829,18 @@ test_read_write_static_routes_legacy (void) char *routefile2 = NULL; char *route6file = NULL; char *route6file2 = NULL; - gboolean ignore_error = FALSE; gboolean success; GError *error = NULL; const char *tmp; - connection = connection_from_file (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "read-write-static-routes-legacy-read", "failed to read %s: %s", TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, error->message); @@ -7011,15 +6921,14 @@ test_read_write_static_routes_legacy (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile2, - &routefile2, - &route6file2, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile2, + &routefile2, + &route6file2, + &error); unlink (testfile); unlink (routefile2); unlink (route6file2); @@ -7073,7 +6982,6 @@ test_write_wired_static_routes (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -7164,15 +7072,14 @@ test_write_wired_static_routes (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -7215,7 +7122,6 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -7295,15 +7201,14 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -7369,7 +7274,6 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; const char *pw; char *tmp; @@ -7479,15 +7383,14 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert (keyfile != NULL); unlink (keyfile); @@ -7585,7 +7488,6 @@ test_write_wired_aliases (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; shvarFile *ifcfg; int i, j; @@ -7679,15 +7581,14 @@ test_write_wired_aliases (void) "wired-aliases-write", "saving failed to delete unused ifcfg-alias0:5"); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); unlink (TEST_SCRATCH_ALIAS_BASE ":2"); unlink (TEST_SCRATCH_ALIAS_BASE ":3"); @@ -7861,8 +7762,8 @@ test_write_gateway (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, + NULL, NULL, NULL, NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -7896,7 +7797,6 @@ test_write_wifi_open (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; const char *bssid = "11:22:33:44:55:66"; @@ -7973,15 +7873,14 @@ test_write_wifi_open (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); /* Now make sure that the ESSID item isn't double-quoted (rh #606518) */ @@ -8036,7 +7935,6 @@ test_write_wifi_open_hex_ssid (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -8103,15 +8001,14 @@ test_write_wifi_open_hex_ssid (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -8150,7 +8047,6 @@ test_write_wifi_wep (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8232,15 +8128,14 @@ test_write_wifi_wep (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8291,7 +8186,6 @@ test_write_wifi_wep_adhoc (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8379,15 +8273,14 @@ test_write_wifi_wep_adhoc (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8438,7 +8331,6 @@ test_write_wifi_wep_passphrase (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8518,15 +8410,14 @@ test_write_wifi_wep_passphrase (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8577,7 +8468,6 @@ test_write_wifi_wep_40_ascii (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah40"; struct stat statbuf; @@ -8659,15 +8549,14 @@ test_write_wifi_wep_40_ascii (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8718,7 +8607,6 @@ test_write_wifi_wep_104_ascii (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah104"; struct stat statbuf; @@ -8800,15 +8688,14 @@ test_write_wifi_wep_104_ascii (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8859,7 +8746,6 @@ test_write_wifi_leap (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8938,15 +8824,14 @@ test_write_wifi_leap (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -8997,7 +8882,6 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9075,15 +8959,14 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert_no_error (error); @@ -9136,7 +9019,6 @@ test_write_wifi_wpa_psk (const char *name, char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9229,15 +9111,14 @@ test_write_wifi_wpa_psk (const char *name, nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); tmp = g_strdup_printf ("%s-reread", test_name); @@ -9282,7 +9163,6 @@ test_write_wifi_wpa_psk_adhoc (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; NMIPAddress *addr; @@ -9376,15 +9256,14 @@ test_write_wifi_wpa_psk_adhoc (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -9428,7 +9307,6 @@ test_write_wifi_wpa_eap_tls (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9540,15 +9418,14 @@ test_write_wifi_wpa_eap_tls (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (keyfile != NULL, @@ -9592,7 +9469,6 @@ test_write_wifi_wpa_eap_ttls_tls (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9722,15 +9598,14 @@ test_write_wifi_wpa_eap_ttls_tls (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -9774,7 +9649,6 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9876,15 +9750,14 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -9927,7 +9800,6 @@ test_write_wifi_wpa_then_open (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -10018,15 +9890,14 @@ test_write_wifi_wpa_then_open (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (reread); @@ -10064,15 +9935,14 @@ test_write_wifi_wpa_then_open (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read it for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert_no_error (error); @@ -10117,7 +9987,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; char **perms; const char *ssid_data = "SomeSSID"; @@ -10214,15 +10083,14 @@ test_write_wifi_wpa_then_wep_with_perms (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (reread); @@ -10266,15 +10134,14 @@ test_write_wifi_wpa_then_wep_with_perms (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read it for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (reread); @@ -10321,7 +10188,6 @@ test_write_wifi_dynamic_wep_leap (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GBytes *ssid; const char *ssid_data = "blahblah"; shvarFile *ifcfg; @@ -10409,15 +10275,14 @@ test_write_wifi_dynamic_wep_leap (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (reread); g_assert (keyfile); @@ -10475,7 +10340,6 @@ test_write_wired_qeth_dhcp (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -10546,15 +10410,14 @@ test_write_wired_qeth_dhcp (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -10596,7 +10459,6 @@ test_write_wired_ctc_dhcp (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; shvarFile *ifcfg; char *tmp; @@ -10680,15 +10542,14 @@ test_write_wired_ctc_dhcp (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert (reread); @@ -10728,7 +10589,6 @@ test_write_permissions (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -10791,15 +10651,14 @@ test_write_permissions (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -10843,7 +10702,6 @@ test_write_wifi_wep_agent_keys (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); g_assert (connection != NULL); @@ -10919,15 +10777,14 @@ test_write_wifi_wep_agent_keys (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_WIRELESS, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert_no_error (error); @@ -11190,18 +11047,16 @@ test_read_bridge_main (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_BRIDGE_MAIN, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_BRIDGE_MAIN, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); g_assert_no_error (error); @@ -11250,7 +11105,6 @@ test_write_bridge_main (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); g_assert (connection); @@ -11318,15 +11172,14 @@ test_write_bridge_main (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_BRIDGE, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert (reread); @@ -11355,19 +11208,17 @@ test_read_bridge_component (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; gboolean success; - connection = connection_from_file (TEST_IFCFG_BRIDGE_COMPONENT, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_BRIDGE_COMPONENT, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -11410,7 +11261,6 @@ test_write_bridge_component (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); g_assert (connection); @@ -11466,15 +11316,14 @@ test_write_bridge_component (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); g_assert (reread); @@ -11505,18 +11354,16 @@ test_read_bridge_missing_stp (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp", - NULL, - TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp", + NULL, + TYPE_BRIDGE, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); g_assert_no_error (error); @@ -11546,20 +11393,18 @@ test_read_vlan_interface (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; NMSettingVlan *s_vlan; guint32 from = 0, to = 0; - connection = connection_from_file (TEST_IFCFG_VLAN_INTERFACE, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -11617,19 +11462,17 @@ test_read_vlan_only_vlan_id (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; NMSettingVlan *s_vlan; - connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_VLANID, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -11659,19 +11502,17 @@ test_read_vlan_only_device (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; NMSettingVlan *s_vlan; - connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_DEVICE, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_DEVICE, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -11698,9 +11539,9 @@ test_read_vlan_physdev (void) GError *error = NULL; NMSettingVlan *s_vlan; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-physdev", - NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-physdev", + NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -11725,19 +11566,17 @@ test_write_vlan (void) char *routefile = NULL; char *route6file = NULL; char *written = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; gboolean success = FALSE; - connection = connection_from_file (TEST_IFCFG_VLAN_INTERFACE, - NULL, - TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, + NULL, + TYPE_VLAN, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert (connection != NULL); success = writer_new_connection (connection, @@ -11764,19 +11603,17 @@ test_write_vlan_only_vlanid (void) char *routefile = NULL; char *route6file = NULL; char *written = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; gboolean success = FALSE; - connection = connection_from_file (TEST_IFCFG_VLAN_ONLY_VLANID, - NULL, - TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, + NULL, + TYPE_VLAN, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -11799,15 +11636,14 @@ test_write_vlan_only_vlanid (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (written, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (written, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (written); g_free (written); g_free (unmanaged); @@ -11846,7 +11682,6 @@ test_write_ethernet_missing_ipv6 (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); g_assert (connection); @@ -11907,15 +11742,14 @@ test_write_ethernet_missing_ipv6 (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -11955,9 +11789,9 @@ test_read_ibft_ignored (void) NMConnection *connection; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft", - NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft", + NULL, TYPE_ETHERNET, + NULL, NULL, NULL, NULL, &error); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); g_assert (connection == NULL); } @@ -11973,18 +11807,16 @@ test_read_bond_main (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_BOND_MAIN, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_BOND_MAIN, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "bond-main-read", "unexpected failure reading %s", TEST_IFCFG_BOND_MAIN); @@ -12033,7 +11865,6 @@ test_write_bond_main (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -12100,15 +11931,14 @@ test_write_bond_main (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_BOND, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_BOND, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -12140,18 +11970,16 @@ test_read_bond_slave (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_BOND_SLAVE, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, @@ -12197,7 +12025,6 @@ test_write_bond_slave (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -12245,15 +12072,14 @@ test_write_bond_slave (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -12288,21 +12114,19 @@ test_read_infiniband (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; const char *mac; char expected_mac_address[INFINIBAND_ALEN] = { 0x80, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22 }; const char *transport_mode; - connection = connection_from_file (TEST_IFCFG_INFINIBAND, - NULL, - TYPE_INFINIBAND, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_INFINIBAND, + NULL, + TYPE_INFINIBAND, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); ASSERT (connection != NULL, "infiniband-read", "failed to read %s: %s", TEST_IFCFG_INFINIBAND, error->message); @@ -12373,7 +12197,6 @@ test_write_infiniband (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -12443,15 +12266,14 @@ test_write_infiniband (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_INFINIBAND, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_INFINIBAND, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -12483,18 +12305,16 @@ test_read_bond_slave_ib (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_BOND_SLAVE_IB, - NULL, - NULL, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE_IB, + NULL, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); g_test_assert_expected_messages(); ASSERT (connection != NULL, @@ -12539,7 +12359,6 @@ test_write_bond_slave_ib (void) char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; - gboolean ignore_error = FALSE; connection = nm_simple_connection_new (); @@ -12588,15 +12407,14 @@ test_write_bond_slave_ib (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - NULL, - &unmanaged, - &keyfile, - &routefile, - &route6file, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error); unlink (testfile); ASSERT (reread != NULL, @@ -12639,8 +12457,8 @@ test_read_dcb_basic (void) guint expected_traffic_classes[8] = { 7, 6, 5, 4, 3, 2, 1, 0 }; gboolean expected_pfcs[8] = { TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE }; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -12698,7 +12516,7 @@ test_write_dcb_basic (void) NMSettingDcb *s_dcb; NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; - gboolean success, ignore_error; + gboolean success; guint i; char *uuid, *testfile; const guint group_ids[8] = { 4, 0xF, 6, 0xF, 1, 7, 3, 0xF }; @@ -12770,13 +12588,12 @@ test_write_dcb_basic (void) g_assert (testfile); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + NULL, NULL, + NULL, NULL, + &error); unlink (testfile); g_assert_no_error (error); @@ -12797,8 +12614,8 @@ test_read_dcb_default_app_priorities (void) NMSettingDcb *s_dcb; gboolean success; - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-default-app-priorities", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-default-app-priorities", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -12828,8 +12645,8 @@ test_read_dcb_bad_booleans (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_STRICT value*not all 0s and 1s*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-booleans", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-booleans", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12845,8 +12662,8 @@ test_read_dcb_short_booleans (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_STRICT value*8 characters*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-booleans", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-booleans", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12862,8 +12679,8 @@ test_read_dcb_bad_uints (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_UP2TC value*not 0 - 7*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-uints", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-uints", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12879,8 +12696,8 @@ test_read_dcb_short_uints (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_UP2TC value*8 characters*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-uints", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-uints", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12896,8 +12713,8 @@ test_read_dcb_bad_percent (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_PCT percentage value*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-percent", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-percent", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12913,8 +12730,8 @@ test_read_dcb_short_percent (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_PCT percentage list value*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-percent", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-percent", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12930,8 +12747,8 @@ test_read_dcb_pgpct_not_100 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_PCT percentages do not equal 100*"); - connection = connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-pgpct-not-100", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-pgpct-not-100", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -12950,7 +12767,7 @@ test_read_fcoe_mode (gconstpointer user_data) char *file; file = g_strdup_printf (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-fcoe-%s", expected_mode); - connection = connection_from_file (file, NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_free (file); g_assert_no_error (error); g_assert (connection); @@ -12978,7 +12795,7 @@ test_write_fcoe_mode (gconstpointer user_data) NMSettingDcb *s_dcb; NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; - gboolean success, ignore_error; + gboolean success; char *uuid, *testfile; connection = nm_simple_connection_new (); @@ -13040,13 +12857,12 @@ test_write_fcoe_mode (gconstpointer user_data) } /* re-read the connection for comparison */ - reread = connection_from_file (testfile, - NULL, - TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, - &error, - &ignore_error); + reread = connection_from_file_test (testfile, + NULL, + TYPE_ETHERNET, + NULL, NULL, + NULL, NULL, + &error); unlink (testfile); g_assert_no_error (error); @@ -13069,8 +12885,8 @@ test_read_team_master (void) GError *error = NULL; const char *expected_config = "{ \"device\": \"team0\", \"link_watch\": { \"name\": \"ethtool\" } }"; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-master", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-master", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -13181,8 +12997,8 @@ test_write_team_master (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, + NULL, NULL, NULL, NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -13208,8 +13024,8 @@ test_read_team_port (void) GError *error = NULL; const char *expected_config = "{ \"p4p1\": { \"prio\": -10, \"sticky\": true } }"; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -13304,8 +13120,8 @@ test_write_team_port (void) nm_connection_normalize (connection, NULL, NULL, NULL); /* re-read the connection for comparison */ - reread = connection_from_file (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error, NULL); + reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, + NULL, NULL, NULL, NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -13329,8 +13145,8 @@ test_read_team_port_empty_config (void) gboolean success; GError *error = NULL; - connection = connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port-empty-config", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port-empty-config", + NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -13475,8 +13291,8 @@ test_read_vlan_trailing_spaces (void) g_assert (strstr (contents, "DEVICE=\"vlan201\" \n")); g_free (contents); - connection = connection_from_file (testfile, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error, NULL); + connection = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); From 12bfaf5a8da788ae5ed50c0c93c203250a6ecf8b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 09:18:31 -0500 Subject: [PATCH 2/5] ifcfg-rh: remove "ignore_error" arg from connection_from_file() Instead of having connection_from_file() return a flag telling its caller whether to log a warning or not, just have it log the warning (or not) itself. --- .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 8 +++---- .../plugins/ifcfg-rh/nm-ifcfg-connection.h | 3 +-- src/settings/plugins/ifcfg-rh/plugin.c | 21 +++---------------- src/settings/plugins/ifcfg-rh/reader.c | 13 ++++++++---- src/settings/plugins/ifcfg-rh/reader.h | 3 +-- 5 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index caa1f4ba21..ec143edd03 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -102,8 +102,7 @@ files_changed_cb (NMInotifyHelper *ih, NMIfcfgConnection * nm_ifcfg_connection_new (NMConnection *source, const char *full_path, - GError **error, - gboolean *ignore_error) + GError **error) { GObject *object; NMConnection *tmp; @@ -119,8 +118,7 @@ nm_ifcfg_connection_new (NMConnection *source, else { tmp = connection_from_file (full_path, &unhandled_spec, - error, - ignore_error); + error); if (!tmp) return NULL; @@ -259,7 +257,7 @@ commit_changes (NMSettingsConnection *connection, * it if it's really changed. */ if (priv->path) { - reread = connection_from_file (priv->path, NULL, NULL, NULL); + reread = connection_from_file (priv->path, NULL, NULL); if (reread) { same = nm_connection_compare (NM_CONNECTION (connection), reread, diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h index 37eacaf0d3..58576d9d15 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h @@ -48,8 +48,7 @@ GType nm_ifcfg_connection_get_type (void); NMIfcfgConnection *nm_ifcfg_connection_new (NMConnection *source, const char *full_path, - GError **error, - gboolean *ignore_error); + GError **error); const char *nm_ifcfg_connection_get_path (NMIfcfgConnection *self); diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c index 2dced56b49..60ffcc7f84 100644 --- a/src/settings/plugins/ifcfg-rh/plugin.c +++ b/src/settings/plugins/ifcfg-rh/plugin.c @@ -129,23 +129,13 @@ _internal_new_connection (SCPluginIfcfg *self, SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); NMIfcfgConnection *connection; const char *cid; - GError *local = NULL; - gboolean ignore_error = FALSE; if (!source) nm_log_info (LOGD_SETTINGS, "parsing %s ... ", path); - connection = nm_ifcfg_connection_new (source, path, &local, &ignore_error); - if (!connection) { - if (!ignore_error) - nm_log_warn (LOGD_SETTINGS, " %s", (local && local->message) ? local->message : "(unknown)"); - if (local) - g_propagate_error (error, local); - else - g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, - "(unknown)"); + connection = nm_ifcfg_connection_new (source, path, error); + if (!connection) return NULL; - } cid = nm_connection_get_id (NM_CONNECTION (connection)); g_assert (cid); @@ -248,7 +238,6 @@ connection_new_or_changed (SCPluginIfcfg *self, SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); NMIfcfgConnection *new; GError *error = NULL; - gboolean ignore_error = FALSE; const char *new_unmanaged = NULL, *old_unmanaged = NULL; const char *new_unrecognized = NULL, *old_unrecognized = NULL; gboolean unmanaged_changed, unrecognized_changed; @@ -285,13 +274,9 @@ connection_new_or_changed (SCPluginIfcfg *self, return; } - new = (NMIfcfgConnection *) nm_ifcfg_connection_new (NULL, path, &error, &ignore_error); + new = (NMIfcfgConnection *) nm_ifcfg_connection_new (NULL, path, NULL); if (!new) { /* errors reading connection; remove it */ - if (!ignore_error) - nm_log_warn (LOGD_SETTINGS, " %s", (error && error->message) ? error->message : "(unknown)"); - g_clear_error (&error); - nm_log_info (LOGD_SETTINGS, "removed %s.", path); remove_connection (self, existing); return; diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 1c2b566d1f..171fb13398 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4842,14 +4842,19 @@ done: NMConnection * connection_from_file (const char *filename, char **out_unhandled, - GError **error, - gboolean *out_ignore_error) + GError **error) { - return connection_from_file_full (filename, NULL, NULL, + gboolean ignore_error = FALSE; + NMConnection *conn; + + conn = connection_from_file_full (filename, NULL, NULL, out_unhandled, NULL, NULL, NULL, error, - out_ignore_error); + &ignore_error); + if (error && *error && !ignore_error) + PARSE_WARNING ("%s", (*error)->message); + return conn; } NMConnection * diff --git a/src/settings/plugins/ifcfg-rh/reader.h b/src/settings/plugins/ifcfg-rh/reader.h index 7fafc56783..15d5bac36e 100644 --- a/src/settings/plugins/ifcfg-rh/reader.h +++ b/src/settings/plugins/ifcfg-rh/reader.h @@ -28,8 +28,7 @@ NMConnection *connection_from_file (const char *filename, char **out_unhandled, - GError **error, - gboolean *out_ignore_error); + GError **error); char *uuid_from_file (const char *filename); From 1600ed9c6804c097dea96eaeea831224b20d1412 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 10:00:47 -0500 Subject: [PATCH 3/5] ifcfg-rh/tests: remove gratuituous checks A bunch of tests appear to have copy-and-pasted the same unnecessary check for route6file having been created. Remove them. --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index ce133c0df0..fecb7f92c5 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -6327,9 +6327,6 @@ test_write_wired_static (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "wired-static-write", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -6663,9 +6660,6 @@ test_write_wired_static_ip6_only (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "wired-static-ip6-only-write", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -10429,9 +10423,6 @@ test_write_wired_qeth_dhcp (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "wired-qeth-dhcp-write", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -10560,9 +10551,6 @@ test_write_wired_ctc_dhcp (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -10670,9 +10658,6 @@ test_write_permissions (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "permissions-write", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -10808,9 +10793,6 @@ test_write_wifi_wep_agent_keys (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -11333,9 +11315,6 @@ test_write_bridge_component (void) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -12091,9 +12070,6 @@ test_write_bond_slave (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "bond-slave-write", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); @@ -12426,9 +12402,6 @@ test_write_bond_slave_ib (void) ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, "bond-slave-write-ib", "written and re-read connection weren't the same."); - if (route6file) - unlink (route6file); - g_free (testfile); g_free (unmanaged); g_free (keyfile); From a564dafc35651f5b86d6a0ee53b687540c2dd878 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 09:58:35 -0500 Subject: [PATCH 4/5] ifcfg-rh/tests: removed unused connection_from_file_test() args Don't pass &keyfile, &routefile, and &route6file if we aren't going to use the return value. Don't pass &unmanaged if we aren't going to check it. (And when we do check it, don't g_free() it if we've asserted that it's NULL.) --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 1188 +++-------------- 1 file changed, 199 insertions(+), 989 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index fecb7f92c5..14d01d6e5c 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -527,7 +527,6 @@ test_read_wired_static (const char *file, g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE); } - g_free (unmanaged); g_object_unref (connection); } @@ -584,9 +583,6 @@ test_read_wired_dhcp (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *mac; char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee }; @@ -598,9 +594,7 @@ test_read_wired_dhcp (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); @@ -720,10 +714,6 @@ test_read_wired_dhcp (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -890,9 +880,6 @@ test_read_wired_defroute_no (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no"; @@ -901,9 +888,7 @@ test_read_wired_defroute_no (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); @@ -987,10 +972,6 @@ test_read_wired_defroute_no (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_NEVER_DEFAULT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1006,9 +987,6 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no-gatewaydev-yes"; @@ -1017,9 +995,7 @@ test_read_wired_defroute_no_gatewaydev_yes (void) TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-gatewaydev-yes-read", @@ -1111,10 +1087,6 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_NEVER_DEFAULT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1176,9 +1148,6 @@ test_read_wired_static_routes_legacy (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPRoute *ip4_route; @@ -1188,9 +1157,7 @@ test_read_wired_static_routes_legacy (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, @@ -1283,10 +1250,6 @@ test_read_wired_static_routes_legacy (void) g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "7.7.7.7"); g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1298,9 +1261,6 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; @@ -1309,9 +1269,7 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv4-manual-read", "failed to read %s: %s", file, error->message); @@ -1392,10 +1350,6 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "3.3.3.3"); g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 8); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1410,9 +1364,6 @@ test_read_wired_ipv6_manual (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-manual"; @@ -1425,9 +1376,7 @@ test_read_wired_ipv6_manual (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -1623,10 +1572,6 @@ test_read_wired_ipv6_manual (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1641,9 +1586,6 @@ test_read_wired_ipv6_only (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-only"; @@ -1654,9 +1596,7 @@ test_read_wired_ipv6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); @@ -1759,10 +1699,6 @@ test_read_wired_ipv6_only (void) g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 1), ==, "ipsum.org"); g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 2), ==, "dolor.edu"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1777,9 +1713,6 @@ test_read_wired_dhcp6_only (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-dhcp6-only"; @@ -1789,9 +1722,7 @@ test_read_wired_dhcp6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); @@ -1862,10 +1793,6 @@ test_read_wired_dhcp6_only (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1877,18 +1804,13 @@ test_read_onboot_no (void) NMConnection *connection; NMSettingConnection *s_con; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_ONBOOT_NO, NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); @@ -1914,10 +1836,6 @@ test_read_onboot_no (void) NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_AUTOCONNECT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1929,19 +1847,13 @@ test_read_noip (void) NMConnection *connection; NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_NOIP, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -1957,10 +1869,6 @@ test_read_noip (void) g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE); g_assert (nm_setting_ip_config_get_never_default (s_ip6) == FALSE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1976,9 +1884,6 @@ test_read_wired_8021x_peap_mschapv2 (void) NMSetting8021x *s_8021x; NMSetting8021x *tmp_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_identity = "David Smith"; @@ -1992,9 +1897,7 @@ test_read_wired_8021x_peap_mschapv2 (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); @@ -2154,10 +2057,6 @@ test_read_wired_8021x_peap_mschapv2 (void) g_object_unref (tmp_8021x); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2170,10 +2069,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags NMConnection *connection; NMSettingWired *s_wired; NMSetting8021x *s_8021x; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *expected_identity = "David Smith"; gboolean success = FALSE; @@ -2182,10 +2077,8 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags connection = connection_from_file_test (ifcfg, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -2218,10 +2111,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags g_free (dirname); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2350,10 +2239,6 @@ test_read_wired_aliases_good (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System aliasem0"; @@ -2366,10 +2251,8 @@ test_read_wired_aliases_good (void) connection = connection_from_file_test (TEST_IFCFG_ALIASES_GOOD, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "aliases-good-read", "failed to read %s: %s", TEST_IFCFG_ALIASES_GOOD, error->message); @@ -2459,9 +2342,6 @@ test_read_wired_aliases_good (void) expected_address[i]); } - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2471,10 +2351,6 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) NMConnection *connection; NMSettingConnection *s_con; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; @@ -2482,10 +2358,8 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) connection = connection_from_file_test (base, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, @@ -2547,9 +2421,6 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) /* Gateway */ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1"); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2583,10 +2454,6 @@ test_read_wifi_open (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2601,10 +2468,8 @@ test_read_wifi_open (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); @@ -2742,10 +2607,6 @@ test_read_wifi_open (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2757,10 +2618,6 @@ test_read_wifi_open_auto (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-open-auto)"; @@ -2769,10 +2626,8 @@ test_read_wifi_open_auto (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_AUTO, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); @@ -2821,10 +2676,6 @@ test_read_wifi_open_auto (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2836,10 +2687,6 @@ test_read_wifi_open_ssid_hex (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2849,10 +2696,8 @@ test_read_wifi_open_ssid_hex (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_HEX, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); @@ -2907,10 +2752,6 @@ test_read_wifi_open_ssid_hex (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2918,27 +2759,17 @@ static void test_read_wifi_open_ssid_bad (const char *file, const char *test) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (file, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); g_clear_error (&error); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } #define TEST_IFCFG_WIFI_OPEN_SSID_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-quoted" @@ -2949,10 +2780,6 @@ test_read_wifi_open_ssid_quoted (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2962,10 +2789,8 @@ test_read_wifi_open_ssid_quoted (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); @@ -3020,10 +2845,6 @@ test_read_wifi_open_ssid_quoted (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3037,10 +2858,6 @@ test_read_wifi_wep (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3057,10 +2874,8 @@ test_read_wifi_wep (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message); @@ -3276,10 +3091,6 @@ test_read_wifi_wep (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3293,10 +3104,6 @@ test_read_wifi_wep_adhoc (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3308,10 +3115,8 @@ test_read_wifi_wep_adhoc (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_ADHOC, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); @@ -3514,10 +3319,6 @@ test_read_wifi_wep_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3530,10 +3331,6 @@ test_read_wifi_wep_passphrase (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "foobar222blahblah"; @@ -3542,10 +3339,8 @@ test_read_wifi_wep_passphrase (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_PASSPHRASE, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-passphrase-read", "failed to read %s: %s", @@ -3637,10 +3432,6 @@ test_read_wifi_wep_passphrase (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3653,10 +3444,6 @@ test_read_wifi_wep_40_ascii (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "Lorem"; @@ -3665,10 +3452,8 @@ test_read_wifi_wep_40_ascii (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_40_ASCII, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); @@ -3758,10 +3543,6 @@ test_read_wifi_wep_40_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3774,10 +3555,6 @@ test_read_wifi_wep_104_ascii (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "LoremIpsumSit"; @@ -3786,10 +3563,8 @@ test_read_wifi_wep_104_ascii (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_104_ASCII, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); @@ -3879,10 +3654,6 @@ test_read_wifi_wep_104_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3895,10 +3666,6 @@ test_read_wifi_leap (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-leap)"; @@ -3908,10 +3675,8 @@ test_read_wifi_leap (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_LEAP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); @@ -4002,10 +3767,6 @@ test_read_wifi_leap (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4018,10 +3779,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte NMConnection *connection; NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *expected_identity = "Bill Smith"; gboolean success; @@ -4029,10 +3786,8 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte connection = connection_from_file_test (file, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -4056,10 +3811,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte g_assert (nm_setting_wireless_security_get_leap_password_flags (s_wsec) == expected_flags); g_assert (nm_setting_wireless_security_get_leap_password (s_wsec) == NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4073,10 +3824,6 @@ test_read_wifi_wpa_psk (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4102,10 +3849,8 @@ test_read_wifi_wpa_psk (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); @@ -4355,10 +4100,6 @@ test_read_wifi_wpa_psk (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4371,10 +4112,6 @@ test_read_wifi_wpa_psk_2 (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System ipsum (test-wifi-wpa-psk-2)"; @@ -4383,10 +4120,8 @@ test_read_wifi_wpa_psk_2 (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_2, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-2-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_2, error->message); @@ -4444,10 +4179,6 @@ test_read_wifi_wpa_psk_2 (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4460,10 +4191,6 @@ test_read_wifi_wpa_psk_unquoted (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-unquoted)"; @@ -4472,10 +4199,8 @@ test_read_wifi_wpa_psk_unquoted (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); @@ -4533,10 +4258,6 @@ test_read_wifi_wpa_psk_unquoted (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4546,10 +4267,6 @@ static void test_read_wifi_wpa_psk_unquoted2 (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; /* Ensure a quoted 64-character WPA passphrase will fail since passphrases @@ -4559,19 +4276,13 @@ test_read_wifi_wpa_psk_unquoted2 (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection == NULL, "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); g_clear_error (&error); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } #define TEST_IFCFG_WIFI_WPA_PSK_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc" @@ -4584,10 +4295,6 @@ test_read_wifi_wpa_psk_adhoc (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-adhoc)"; @@ -4600,10 +4307,8 @@ test_read_wifi_wpa_psk_adhoc (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_ADHOC, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); @@ -4743,10 +4448,6 @@ test_read_wifi_wpa_psk_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4760,10 +4461,6 @@ test_read_wifi_wpa_psk_hex (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4775,10 +4472,8 @@ test_read_wifi_wpa_psk_hex (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_HEX, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); @@ -4883,10 +4578,6 @@ test_read_wifi_wpa_psk_hex (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4903,9 +4594,6 @@ test_read_wifi_wpa_eap_tls (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Bill Smith"; @@ -4915,9 +4603,7 @@ test_read_wifi_wpa_eap_tls (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); @@ -5022,10 +4708,6 @@ test_read_wifi_wpa_eap_tls (void) expected_privkey_password, NM_SETTING_802_1X_PRIVATE_KEY); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5041,9 +4723,6 @@ test_read_wifi_wpa_eap_ttls_tls (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Chuck Shumer"; @@ -5053,9 +4732,7 @@ test_read_wifi_wpa_eap_ttls_tls (void) NULL, TYPE_WIRELESS, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); @@ -5179,10 +4856,6 @@ test_read_wifi_wpa_eap_ttls_tls (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_IDENTITY); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5195,20 +4868,14 @@ test_read_wifi_dynamic_wep_leap (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSetting8021x *s_8021x; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; gboolean success; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5250,10 +4917,6 @@ test_read_wifi_dynamic_wep_leap (void) g_assert_cmpstr (nm_setting_802_1x_get_identity (s_8021x), ==, "bill smith"); g_assert_cmpstr (nm_setting_802_1x_get_password (s_8021x), ==, "foobar baz"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5269,9 +4932,6 @@ test_read_wifi_wep_eap_ttls_chap (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_password = "foobar baz"; @@ -5282,9 +4942,7 @@ test_read_wifi_wep_eap_ttls_chap (void) NULL, TYPE_WIRELESS, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); @@ -5409,10 +5067,6 @@ test_read_wifi_wep_eap_ttls_chap (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_PASSWORD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5678,9 +5332,6 @@ test_read_wired_qeth_static (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-qeth-static"; @@ -5694,9 +5345,7 @@ test_read_wired_qeth_static (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); @@ -5829,10 +5478,6 @@ test_read_wired_qeth_static (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5845,9 +5490,6 @@ test_read_wired_ctc_static (void) NMSettingConnection *s_con; NMSettingWired *s_wired; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ctc-static"; @@ -5860,9 +5502,7 @@ test_read_wired_ctc_static (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5899,10 +5539,6 @@ test_read_wired_ctc_static (void) g_assert (tmp != NULL); g_assert_cmpstr (tmp, ==, "0"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5915,10 +5551,6 @@ test_read_wifi_wep_no_keys (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System foobar (test-wifi-wep-no-keys)"; @@ -5927,10 +5559,8 @@ test_read_wifi_wep_no_keys (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_NO_KEYS, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-no-keys-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_NO_KEYS, error->message); @@ -6009,10 +5639,6 @@ test_read_wifi_wep_no_keys (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6023,10 +5649,6 @@ test_read_permissions (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; gboolean success; GError *error = NULL; guint32 num; @@ -6035,10 +5657,8 @@ test_read_permissions (void) connection = connection_from_file_test (TEST_IFCFG_PERMISSIONS, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "permissions-read", "failed to read %s: %s", TEST_IFCFG_PERMISSIONS, error->message); @@ -6081,10 +5701,6 @@ test_read_permissions (void) ASSERT (strcmp (tmp, "johnny5") == 0, "permissions-verify-permissions", "unexpected permission #3"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6096,10 +5712,6 @@ test_read_wifi_wep_agent_keys (void) NMConnection *connection; NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMWepKeyType key_type; gboolean success; @@ -6108,10 +5720,8 @@ test_read_wifi_wep_agent_keys (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_AGENT_KEYS, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -6143,10 +5753,6 @@ test_read_wifi_wep_agent_keys (void) flags = nm_setting_wireless_security_get_wep_key_flags (s_wsec); g_assert (flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6176,9 +5782,6 @@ test_write_wired_static (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6300,9 +5903,9 @@ test_write_wired_static (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -6328,9 +5931,6 @@ test_write_wired_static (void) "wired-static-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -6349,10 +5949,6 @@ test_write_wired_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6417,10 +6013,8 @@ test_write_wired_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -6434,10 +6028,6 @@ test_write_wired_dhcp (void) "wired-dhcp-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -6570,9 +6160,6 @@ test_write_wired_static_ip6_only (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6644,9 +6231,9 @@ test_write_wired_static_ip6_only (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -6661,9 +6248,6 @@ test_write_wired_static_ip6_only (void) "wired-static-ip6-only-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -6815,13 +6399,8 @@ test_read_write_static_routes_legacy (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; char *testfile = NULL; - char *keyfile = NULL; - char *keyfile2 = NULL; - char *routefile = NULL; char *routefile2 = NULL; - char *route6file = NULL; char *route6file2 = NULL; gboolean success; GError *error = NULL; @@ -6830,10 +6409,8 @@ test_read_write_static_routes_legacy (void) connection = connection_from_file_test (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "read-write-static-routes-legacy-read", "failed to read %s: %s", @@ -6918,8 +6495,8 @@ test_read_write_static_routes_legacy (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile2, + NULL, + NULL, &routefile2, &route6file2, &error); @@ -6940,12 +6517,7 @@ test_read_write_static_routes_legacy (void) "read-write-static-routes-legacy-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (keyfile2); - g_free (routefile); g_free (routefile2); - g_free (route6file); g_free (route6file2); g_object_unref (connection); g_object_unref (reread); @@ -6972,10 +6544,7 @@ test_write_wired_static_routes (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -7069,10 +6638,10 @@ test_write_wired_static_routes (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, + NULL, + NULL, &routefile, - &route6file, + NULL, &error); unlink (testfile); @@ -7090,10 +6659,7 @@ test_write_wired_static_routes (void) "wired-static-routes-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7112,10 +6678,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -7198,10 +6761,10 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -7219,10 +6782,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) "wired-dhcp-8021x-peap-mschapv2write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7264,10 +6824,7 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; const char *pw; char *tmp; @@ -7380,10 +6937,10 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); g_assert (keyfile != NULL); @@ -7452,10 +7009,7 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, g_free (tmp); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7478,10 +7032,6 @@ test_write_wired_aliases (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; shvarFile *ifcfg; int i, j; @@ -7578,10 +7128,8 @@ test_write_wired_aliases (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); unlink (TEST_SCRATCH_ALIAS_BASE ":2"); @@ -7638,9 +7186,6 @@ test_write_wired_aliases (void) g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1"); g_free (testfile); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7787,10 +7332,6 @@ test_write_wifi_open (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; const char *bssid = "11:22:33:44:55:66"; @@ -7870,10 +7411,8 @@ test_write_wifi_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); @@ -7904,10 +7443,6 @@ test_write_wifi_open (void) "wifi-open-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7925,10 +7460,6 @@ test_write_wifi_open_hex_ssid (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -7998,10 +7529,8 @@ test_write_wifi_open_hex_ssid (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -8015,10 +7544,6 @@ test_write_wifi_open_hex_ssid (void) "wifi-open-hex-ssid-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8037,10 +7562,7 @@ test_write_wifi_wep (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8125,10 +7647,10 @@ test_write_wifi_wep (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8154,10 +7676,7 @@ test_write_wifi_wep (void) "wifi-wep-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8176,10 +7695,7 @@ test_write_wifi_wep_adhoc (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8270,10 +7786,10 @@ test_write_wifi_wep_adhoc (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8299,10 +7815,7 @@ test_write_wifi_wep_adhoc (void) "wifi-wep-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8321,10 +7834,7 @@ test_write_wifi_wep_passphrase (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8407,10 +7917,10 @@ test_write_wifi_wep_passphrase (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8436,10 +7946,7 @@ test_write_wifi_wep_passphrase (void) "wifi-wep-passphrase-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8458,10 +7965,7 @@ test_write_wifi_wep_40_ascii (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah40"; struct stat statbuf; @@ -8546,10 +8050,10 @@ test_write_wifi_wep_40_ascii (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8575,10 +8079,7 @@ test_write_wifi_wep_40_ascii (void) "wifi-wep-40-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8597,10 +8098,7 @@ test_write_wifi_wep_104_ascii (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah104"; struct stat statbuf; @@ -8685,10 +8183,10 @@ test_write_wifi_wep_104_ascii (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8714,10 +8212,7 @@ test_write_wifi_wep_104_ascii (void) "wifi-wep-104-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8736,10 +8231,7 @@ test_write_wifi_leap (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8821,10 +8313,10 @@ test_write_wifi_leap (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8850,10 +8342,7 @@ test_write_wifi_leap (void) "wifi-leap-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8872,10 +8361,7 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -8956,10 +8442,10 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8982,10 +8468,7 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9009,10 +8492,7 @@ test_write_wifi_wpa_psk (const char *name, gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9108,10 +8588,10 @@ test_write_wifi_wpa_psk (const char *name, reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9131,10 +8611,7 @@ test_write_wifi_wpa_psk (const char *name, test_name, "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9153,10 +8630,7 @@ test_write_wifi_wpa_psk_adhoc (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; NMIPAddress *addr; @@ -9253,10 +8727,10 @@ test_write_wifi_wpa_psk_adhoc (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9274,10 +8748,7 @@ test_write_wifi_wpa_psk_adhoc (void) "wifi-wpa-psk-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9297,10 +8768,7 @@ test_write_wifi_wpa_eap_tls (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9415,10 +8883,10 @@ test_write_wifi_wpa_eap_tls (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9436,10 +8904,7 @@ test_write_wifi_wpa_eap_tls (void) "wifi-wpa-eap-tls-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9459,10 +8924,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9595,10 +9057,10 @@ test_write_wifi_wpa_eap_ttls_tls (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9616,10 +9078,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) "wifi-wpa-eap-ttls-tls-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9639,10 +9098,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9747,10 +9203,10 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9768,10 +9224,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) "wifi-wpa-eap-ttls-mschapv2-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9790,10 +9243,7 @@ test_write_wifi_wpa_then_open (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9887,10 +9337,10 @@ test_write_wifi_wpa_then_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -9901,12 +9351,6 @@ test_write_wifi_wpa_then_open (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - g_free (unmanaged); - unmanaged = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; g_object_unref (reread); /* Now change the connection to open and recheck */ @@ -9932,10 +9376,10 @@ test_write_wifi_wpa_then_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); g_assert_no_error (error); @@ -9954,10 +9398,7 @@ test_write_wifi_wpa_then_open (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (reread); g_object_unref (connection); @@ -9977,10 +9418,7 @@ test_write_wifi_wpa_then_wep_with_perms (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; char **perms; const char *ssid_data = "SomeSSID"; @@ -10080,10 +9518,10 @@ test_write_wifi_wpa_then_wep_with_perms (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -10094,12 +9532,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - g_free (unmanaged); - unmanaged = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; g_object_unref (reread); /* Now change the connection to WEP and recheck */ @@ -10131,10 +9563,10 @@ test_write_wifi_wpa_then_wep_with_perms (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); @@ -10154,10 +9586,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (reread); g_object_unref (connection); @@ -10178,10 +9606,7 @@ test_write_wifi_dynamic_wep_leap (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; shvarFile *ifcfg; @@ -10272,10 +9697,10 @@ test_write_wifi_dynamic_wep_leap (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -10308,10 +9733,7 @@ test_write_wifi_dynamic_wep_leap (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -10330,9 +9752,6 @@ test_write_wired_qeth_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10407,9 +9826,9 @@ test_write_wired_qeth_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10424,9 +9843,6 @@ test_write_wired_qeth_dhcp (void) "wired-qeth-dhcp-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10446,9 +9862,6 @@ test_write_wired_ctc_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; shvarFile *ifcfg; char *tmp; @@ -10536,9 +9949,9 @@ test_write_wired_ctc_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10552,9 +9965,6 @@ test_write_wired_ctc_dhcp (void) g_assert (success); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10573,9 +9983,6 @@ test_write_permissions (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10642,9 +10049,9 @@ test_write_permissions (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10659,9 +10066,6 @@ test_write_permissions (void) "permissions-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10683,9 +10087,6 @@ test_write_wifi_wep_agent_keys (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10765,9 +10166,9 @@ test_write_wifi_wep_agent_keys (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10794,9 +10195,6 @@ test_write_wifi_wep_agent_keys (void) g_assert (success); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -11025,19 +10423,13 @@ test_read_bridge_main (void) NMSettingBridge *s_bridge; const char *mac; char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BRIDGE_MAIN, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -11061,10 +10453,6 @@ test_read_bridge_main (void) g_assert (mac); g_assert (nm_utils_hwaddr_matches (mac, -1, expected_mac_address, ETH_ALEN)); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11083,10 +10471,6 @@ test_write_bridge_main (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); g_assert (connection); @@ -11157,10 +10541,8 @@ test_write_bridge_main (void) reread = connection_from_file_test (testfile, NULL, TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11170,10 +10552,6 @@ test_write_bridge_main (void) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11186,20 +10564,14 @@ test_read_bridge_component (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingBridgePort *s_port; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; gboolean success; connection = connection_from_file_test (TEST_IFCFG_BRIDGE_COMPONENT, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); @@ -11218,10 +10590,6 @@ test_read_bridge_component (void) g_assert_cmpuint (nm_setting_bridge_port_get_priority (s_port), ==, 28); g_assert_cmpuint (nm_setting_bridge_port_get_path_cost (s_port), ==, 100); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11239,9 +10607,6 @@ test_write_bridge_component (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -11301,9 +10666,9 @@ test_write_bridge_component (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -11316,9 +10681,6 @@ test_write_bridge_component (void) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -11329,19 +10691,13 @@ test_read_bridge_missing_stp (void) { NMConnection *connection; NMSettingBridge *s_bridge; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp", NULL, TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -11355,10 +10711,6 @@ test_read_bridge_missing_stp (void) g_assert (s_bridge); g_assert (nm_setting_bridge_get_stp (s_bridge) == FALSE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11368,10 +10720,6 @@ static void test_read_vlan_interface (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; guint32 from = 0, to = 0; @@ -11379,18 +10727,12 @@ test_read_vlan_interface (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "vlan43"); @@ -11437,28 +10779,18 @@ static void test_read_vlan_only_vlan_id (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert (nm_connection_get_interface_name (connection) == NULL); @@ -11477,28 +10809,18 @@ static void test_read_vlan_only_device (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_DEVICE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "eth0.9"); @@ -11540,10 +10862,6 @@ static void test_write_vlan (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; char *written = NULL; GError *error = NULL; gboolean success = FALSE; @@ -11551,10 +10869,8 @@ test_write_vlan (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, NULL, TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -11567,20 +10883,12 @@ test_write_vlan (void) unlink (written); g_free (written); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } static void test_write_vlan_only_vlanid (void) { NMConnection *connection, *reread; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; char *written = NULL; GError *error = NULL; gboolean success = FALSE; @@ -11588,23 +10896,12 @@ test_write_vlan_only_vlanid (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, NULL, TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - unmanaged = NULL; - g_free (keyfile); - keyfile = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; - success = writer_new_connection (connection, TEST_SCRATCH_DIR "/network-scripts/", &written, @@ -11618,17 +10915,11 @@ test_write_vlan_only_vlanid (void) reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (written); g_free (written); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_no_error (error); g_assert (reread != NULL); @@ -11657,10 +10948,6 @@ test_write_ethernet_missing_ipv6 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); g_assert (connection); @@ -11724,10 +11011,8 @@ test_write_ethernet_missing_ipv6 (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11754,10 +11039,6 @@ test_write_ethernet_missing_ipv6 (void) "ethernet-missing-ipv6", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11782,19 +11063,13 @@ test_read_bond_main (void) { NMConnection *connection; NMSettingBond *s_bond; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_MAIN, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "bond-main-read", "unexpected failure reading %s", TEST_IFCFG_BOND_MAIN); @@ -11818,10 +11093,6 @@ test_read_bond_main (void) "bond-main", "failed to verify %s: miimon=%s does not match 100", TEST_IFCFG_BOND_MAIN, nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_MIIMON)); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11840,10 +11111,6 @@ test_write_bond_main (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -11913,10 +11180,8 @@ test_write_bond_main (void) reread = connection_from_file_test (testfile, NULL, TYPE_BOND, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11930,10 +11195,6 @@ test_write_bond_main (void) "bond-main-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11945,19 +11206,13 @@ test_read_bond_slave (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -11980,10 +11235,6 @@ test_read_bond_slave (void) "bond-slave-read", "failed to verify %s: slave-type is not bond", TEST_IFCFG_BOND_SLAVE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12000,9 +11251,6 @@ test_write_bond_slave (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12054,9 +11302,9 @@ test_write_bond_slave (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -12071,9 +11319,6 @@ test_write_bond_slave (void) "bond-slave-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -12087,9 +11332,6 @@ test_read_infiniband (void) NMConnection *connection; NMSettingInfiniband *s_infiniband; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *mac; char expected_mac_address[INFINIBAND_ALEN] = { 0x80, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22 }; @@ -12099,9 +11341,7 @@ test_read_infiniband (void) NULL, TYPE_INFINIBAND, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "infiniband-read", "failed to read %s: %s", TEST_IFCFG_INFINIBAND, error->message); @@ -12146,10 +11386,6 @@ test_read_infiniband (void) NM_SETTING_INFINIBAND_SETTING_NAME, NM_SETTING_INFINIBAND_TRANSPORT_MODE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12169,10 +11405,6 @@ test_write_infiniband (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12245,10 +11477,8 @@ test_write_infiniband (void) reread = connection_from_file_test (testfile, NULL, TYPE_INFINIBAND, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -12262,10 +11492,6 @@ test_write_infiniband (void) "infiniband-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -12277,19 +11503,13 @@ test_read_bond_slave_ib (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE_IB, NULL, NULL, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages(); @@ -12312,10 +11532,6 @@ test_read_bond_slave_ib (void) "bond-slave-read-ib", "failed to verify %s: slave-type is not bond", TEST_IFCFG_BOND_SLAVE_IB); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12331,9 +11547,6 @@ test_write_bond_slave_ib (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12386,9 +11599,9 @@ test_write_bond_slave_ib (void) reread = connection_from_file_test (testfile, NULL, NULL, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -12403,9 +11616,6 @@ test_write_bond_slave_ib (void) "bond-slave-write-ib", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); From 335dbda16b323be1483b95e19ae8eb170ada482b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 10:33:16 -0500 Subject: [PATCH 5/5] ifcfg-rh/tests: drop out_*file args from connection_from_file_test() The out_keyfile, out_routefile, and out_route6file args were just based on trivial calls to utils.h functions, and could just as easily be done by the caller directly. So do that. --- src/settings/plugins/ifcfg-rh/reader.c | 23 -- src/settings/plugins/ifcfg-rh/reader.h | 3 - .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 317 ++++-------------- 3 files changed, 71 insertions(+), 272 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 171fb13398..478d1b24eb 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4629,9 +4629,6 @@ connection_from_file_full (const char *filename, const char *network_file, /* for unit tests only */ const char *test_type, /* for unit tests only */ char **out_unhandled, - char **out_keyfile, - char **out_routefile, - char **out_route6file, GError **error, gboolean *out_ignore_error) { @@ -4644,12 +4641,6 @@ connection_from_file_full (const char *filename, g_return_val_if_fail (filename != NULL, NULL); if (out_unhandled) g_return_val_if_fail (*out_unhandled == NULL, NULL); - if (out_keyfile) - g_return_val_if_fail (*out_keyfile == NULL, NULL); - if (out_routefile) - g_return_val_if_fail (*out_routefile == NULL, NULL); - if (out_route6file) - g_return_val_if_fail (*out_route6file == NULL, NULL); /* Non-NULL only for unit tests; normally use /etc/sysconfig/network */ if (!network_file) @@ -4827,13 +4818,6 @@ connection_from_file_full (const char *filename, connection = NULL; } - if (out_keyfile) - *out_keyfile = utils_get_keys_path (filename); - if (out_routefile) - *out_routefile = utils_get_route_path (filename); - if (out_route6file) - *out_route6file = utils_get_route6_path (filename); - done: svCloseFile (parsed); return connection; @@ -4849,7 +4833,6 @@ connection_from_file (const char *filename, conn = connection_from_file_full (filename, NULL, NULL, out_unhandled, - NULL, NULL, NULL, error, &ignore_error); if (error && *error && !ignore_error) @@ -4862,18 +4845,12 @@ connection_from_file_test (const char *filename, const char *network_file, const char *test_type, char **out_unhandled, - char **out_keyfile, - char **out_routefile, - char **out_route6file, GError **error) { return connection_from_file_full (filename, network_file, test_type, out_unhandled, - out_keyfile, - out_routefile, - out_route6file, error, NULL); } diff --git a/src/settings/plugins/ifcfg-rh/reader.h b/src/settings/plugins/ifcfg-rh/reader.h index 15d5bac36e..6a6af167ff 100644 --- a/src/settings/plugins/ifcfg-rh/reader.h +++ b/src/settings/plugins/ifcfg-rh/reader.h @@ -37,9 +37,6 @@ NMConnection *connection_from_file_test (const char *filename, const char *network_file, const char *test_type, char **out_unhandled, - char **out_keyfile, - char **out_routefile, - char **out_route6file, GError **error); #endif /* __READER_H__ */ diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 14d01d6e5c..bf3b8952cd 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -195,7 +195,7 @@ test_read_basic (void) gboolean success; connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-minimal", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -255,7 +255,7 @@ test_read_miscellaneous_variables (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid MAC in HWADDR_BLACKLIST 'XX:aa:invalid'*"); connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-misc-variables", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection); @@ -305,7 +305,7 @@ test_read_variables_corner_cases (void) gboolean success; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-variables-corner-cases-1", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -353,7 +353,7 @@ test_read_unmanaged (void) connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled", NULL, TYPE_ETHERNET, &unhandled_spec, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -386,7 +386,7 @@ test_read_unmanaged_unrecognized (void) connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-nm-controlled-unrecognized", NULL, NULL, &unhandled_spec, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -417,7 +417,7 @@ test_read_unrecognized (void) connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-unrecognized", NULL, NULL, &unhandled_spec, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -453,7 +453,7 @@ test_read_wired_static (const char *file, gboolean success; connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, - &unmanaged, NULL, NULL, NULL, &error); + &unmanaged, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -547,7 +547,7 @@ test_read_wired_static_no_prefix (gconstpointer user_data) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*missing PREFIX, assuming*"); connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection); @@ -594,7 +594,6 @@ test_read_wired_dhcp (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); @@ -730,7 +729,7 @@ test_read_wired_dhcp_plus_ip (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -807,7 +806,7 @@ test_read_wired_global_gateway (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway", TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway", - TYPE_ETHERNET, &unmanaged, NULL, NULL, NULL, &error); + TYPE_ETHERNET, &unmanaged, &error); nmtst_assert_connection_verifies_without_normalization (connection); g_assert (unmanaged == NULL); @@ -847,7 +846,7 @@ test_read_wired_never_default (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default", TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default", - TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + TYPE_ETHERNET, NULL, &error); nmtst_assert_connection_verifies_without_normalization (connection); /* ===== WIRED SETTING ===== */ @@ -888,7 +887,6 @@ test_read_wired_defroute_no (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); @@ -995,7 +993,6 @@ test_read_wired_defroute_no_gatewaydev_yes (void) TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-gatewaydev-yes-read", @@ -1101,7 +1098,7 @@ test_read_wired_static_routes (void) NMIPRoute *ip4_route; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); nmtst_assert_connection_verifies_without_normalization (connection); /* ===== CONNECTION SETTING ===== */ @@ -1157,7 +1154,6 @@ test_read_wired_static_routes_legacy (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, @@ -1269,7 +1265,6 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv4-manual-read", "failed to read %s: %s", file, error->message); @@ -1376,7 +1371,6 @@ test_read_wired_ipv6_manual (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -1596,7 +1590,6 @@ test_read_wired_ipv6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); @@ -1722,7 +1715,6 @@ test_read_wired_dhcp6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); @@ -1810,7 +1802,6 @@ test_read_onboot_no (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); @@ -1853,7 +1844,6 @@ test_read_noip (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -1897,7 +1887,6 @@ test_read_wired_8021x_peap_mschapv2 (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); @@ -2078,7 +2067,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -2127,7 +2115,7 @@ test_read_write_802_1X_subj_matches (void) "*missing IEEE_8021X_CA_CERT*peap*"); connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1X-subj-matches", NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_test_assert_expected_messages (); g_assert_no_error (error); g_assert (connection != NULL); @@ -2161,7 +2149,7 @@ test_read_write_802_1X_subj_matches (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*missing IEEE_8021X_CA_CERT*peap*"); reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_test_assert_expected_messages (); unlink (written); g_free (written); @@ -2209,7 +2197,7 @@ test_read_802_1x_ttls_eapgtc (void) */ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-802-1x-ttls-eapgtc", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_WIRELESS, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -2252,7 +2240,6 @@ test_read_wired_aliases_good (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "aliases-good-read", "failed to read %s: %s", TEST_IFCFG_ALIASES_GOOD, error->message); @@ -2359,7 +2346,6 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, @@ -2469,7 +2455,6 @@ test_read_wifi_open (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); @@ -2627,7 +2612,6 @@ test_read_wifi_open_auto (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); @@ -2697,7 +2681,6 @@ test_read_wifi_open_ssid_hex (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); @@ -2765,7 +2748,6 @@ test_read_wifi_open_ssid_bad (const char *file, const char *test) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); g_clear_error (&error); @@ -2790,7 +2772,6 @@ test_read_wifi_open_ssid_quoted (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); @@ -2875,7 +2856,6 @@ test_read_wifi_wep (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message); @@ -3116,7 +3096,6 @@ test_read_wifi_wep_adhoc (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); @@ -3340,7 +3319,6 @@ test_read_wifi_wep_passphrase (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-passphrase-read", "failed to read %s: %s", @@ -3453,7 +3431,6 @@ test_read_wifi_wep_40_ascii (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); @@ -3564,7 +3541,6 @@ test_read_wifi_wep_104_ascii (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); @@ -3676,7 +3652,6 @@ test_read_wifi_leap (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); @@ -3787,7 +3762,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -3850,7 +3824,6 @@ test_read_wifi_wpa_psk (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); @@ -4121,7 +4094,6 @@ test_read_wifi_wpa_psk_2 (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-2-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_2, error->message); @@ -4200,7 +4172,6 @@ test_read_wifi_wpa_psk_unquoted (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); @@ -4277,7 +4248,6 @@ test_read_wifi_wpa_psk_unquoted2 (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection == NULL, "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); @@ -4308,7 +4278,6 @@ test_read_wifi_wpa_psk_adhoc (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); @@ -4473,7 +4442,6 @@ test_read_wifi_wpa_psk_hex (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); @@ -4603,7 +4571,6 @@ test_read_wifi_wpa_eap_tls (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); @@ -4732,7 +4699,6 @@ test_read_wifi_wpa_eap_ttls_tls (void) NULL, TYPE_WIRELESS, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); @@ -4875,7 +4841,6 @@ test_read_wifi_dynamic_wep_leap (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -4942,7 +4907,6 @@ test_read_wifi_wep_eap_ttls_chap (void) NULL, TYPE_WIRELESS, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); @@ -5080,7 +5044,7 @@ test_read_wifi_hidden (void) GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-hidden", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_WIRELESS, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5168,7 +5132,7 @@ test_write_wifi_hidden (void) /* re-read the connection for comparison */ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error); + NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -5194,7 +5158,7 @@ test_read_wifi_band_a (void) GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_WIRELESS, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5282,7 +5246,7 @@ test_write_wifi_band_a (void) /* re-read the connection for comparison */ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error); + NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -5305,7 +5269,7 @@ test_read_wifi_band_a_channel_mismatch (void) GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-a-channel-mismatch", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_WIRELESS, NULL, &error); g_assert (connection == NULL); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); } @@ -5317,7 +5281,7 @@ test_read_wifi_band_bg_channel_mismatch (void) GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-band-bg-channel-mismatch", - NULL, TYPE_WIRELESS, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_WIRELESS, NULL, &error); g_assert (connection == NULL); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); } @@ -5345,7 +5309,6 @@ test_read_wired_qeth_static (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); @@ -5502,7 +5465,6 @@ test_read_wired_ctc_static (void) NULL, TYPE_ETHERNET, &unmanaged, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5560,7 +5522,6 @@ test_read_wifi_wep_no_keys (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-no-keys-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_NO_KEYS, error->message); @@ -5658,7 +5619,6 @@ test_read_permissions (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "permissions-read", "failed to read %s: %s", TEST_IFCFG_PERMISSIONS, error->message); @@ -5721,7 +5681,6 @@ test_read_wifi_wep_agent_keys (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -5904,9 +5863,6 @@ test_write_wired_static (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -6014,7 +5970,6 @@ test_write_wired_dhcp (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -6042,7 +5997,7 @@ test_write_wired_dhcp_plus_ip (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-plus-ip", NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -6057,7 +6012,7 @@ test_write_wired_dhcp_plus_ip (void) /* re-read the connection for comparison */ reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); unlink (written); g_free (written); @@ -6088,7 +6043,7 @@ test_read_write_wired_dhcp_send_hostname (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp-send-hostname", NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -6117,7 +6072,7 @@ test_read_write_wired_dhcp_send_hostname (void) /* re-read the connection for comparison */ reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); unlink (written); g_free (written); @@ -6232,9 +6187,6 @@ test_write_wired_static_ip6_only (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -6348,8 +6300,7 @@ test_write_wired_static_ip6_only_gw (gconstpointer user_data) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -6410,7 +6361,6 @@ test_read_write_static_routes_legacy (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "read-write-static-routes-legacy-read", "failed to read %s: %s", @@ -6496,12 +6446,11 @@ test_read_write_static_routes_legacy (void) NULL, TYPE_ETHERNET, NULL, - NULL, - &routefile2, - &route6file2, &error); unlink (testfile); + routefile2 = utils_get_route_path (testfile); unlink (routefile2); + route6file2 = utils_get_route6_path (testfile); unlink (route6file2); ASSERT (reread != NULL, @@ -6639,17 +6588,13 @@ test_write_wired_static_routes (void) NULL, TYPE_ETHERNET, NULL, - NULL, - &routefile, - NULL, &error); unlink (testfile); ASSERT (reread != NULL, "wired-static-routes-write-reread", "failed to read %s: %s", testfile, error->message); - ASSERT (routefile != NULL, - "wired-static-routes-write-reread", "expected routefile for '%s'", testfile); + routefile = utils_get_route_path (testfile); unlink (routefile); ASSERT (nm_connection_verify (reread, &error), @@ -6762,17 +6707,13 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) NULL, TYPE_ETHERNET, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); ASSERT (reread != NULL, "wired-dhcp-8021x-peap-mschapv2write-reread", "failed to read %s: %s", testfile, error->message); - ASSERT (keyfile != NULL, - "wired-dhcp-8021x-peap-mschapv2write-reread", "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); ASSERT (nm_connection_verify (reread, &error), @@ -6938,12 +6879,9 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - g_assert (keyfile != NULL); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); g_assert (reread != NULL); @@ -7129,7 +7067,6 @@ test_write_wired_aliases (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); unlink (testfile); unlink (TEST_SCRATCH_ALIAS_BASE ":2"); @@ -7302,7 +7239,7 @@ test_write_gateway (void) /* re-read the connection for comparison */ reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - NULL, NULL, NULL, NULL, &error); + NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -7412,7 +7349,6 @@ test_write_wifi_open (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); @@ -7530,7 +7466,6 @@ test_write_wifi_open_hex_ssid (void) NULL, TYPE_WIRELESS, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -7648,22 +7583,16 @@ test_write_wifi_wep (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wep-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-wep-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-wep-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-wep-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -7787,22 +7716,16 @@ test_write_wifi_wep_adhoc (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wep-adhoc-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-wep-adhoc-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-wep-adhoc-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-wep-adhoc-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -7918,22 +7841,16 @@ test_write_wifi_wep_passphrase (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wep-passphrase-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-wep-passphrase-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-wep-passphrase-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -8051,22 +7968,16 @@ test_write_wifi_wep_40_ascii (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wep-40-ascii-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-wep-40-ascii-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -8184,22 +8095,16 @@ test_write_wifi_wep_104_ascii (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wep-104-ascii-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-wep-104-ascii-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -8314,22 +8219,16 @@ test_write_wifi_leap (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-leap-write-reread", "expected keyfile for '%s'", testfile); - + keyfile = utils_get_keys_path (testfile); ASSERT (stat (keyfile, &statbuf) == 0, "wifi-leap-write-reread", "couldn't stat() '%s'", keyfile); ASSERT (S_ISREG (statbuf.st_mode), "wifi-leap-write-reread", "keyfile '%s' wasn't a normal file", keyfile); ASSERT ((statbuf.st_mode & 0077) == 0, "wifi-leap-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); - unlink (keyfile); ASSERT (reread != NULL, @@ -8443,16 +8342,13 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); g_assert_no_error (error); /* No key should be written out since the secret is not system owned */ - g_assert (keyfile); + keyfile = utils_get_keys_path (testfile); g_assert (g_file_test (keyfile, G_FILE_TEST_EXISTS) == FALSE); g_assert (reread); @@ -8589,17 +8485,13 @@ test_write_wifi_wpa_psk (const char *name, NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - tmp = g_strdup_printf ("%s-reread", test_name); - ASSERT (keyfile != NULL, - tmp, "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); + tmp = g_strdup_printf ("%s-reread", test_name); ASSERT (reread != NULL, tmp, "failed to read %s: %s", testfile, error->message); @@ -8728,14 +8620,10 @@ test_write_wifi_wpa_psk_adhoc (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wpa-psk-adhoc-write-reread", "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); ASSERT (reread != NULL, @@ -8884,14 +8772,10 @@ test_write_wifi_wpa_eap_tls (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); - ASSERT (keyfile != NULL, - "wifi-wpa-eap-tls-write-reread", "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); ASSERT (reread != NULL, @@ -9058,17 +8942,13 @@ test_write_wifi_wpa_eap_ttls_tls (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); ASSERT (reread != NULL, "wifi-wpa-eap-ttls-tls-write-reread", "failed to read %s: %s", testfile, error->message); - ASSERT (keyfile != NULL, - "wifi-wpa-eap-ttls-tls-write-reread", "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); ASSERT (nm_connection_verify (reread, &error), @@ -9204,17 +9084,13 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); ASSERT (reread != NULL, "wifi-wpa-eap-ttls-mschapv2-write-reread", "failed to read %s: %s", testfile, error->message); - ASSERT (keyfile != NULL, - "wifi-wpa-eap-ttls-mschapv2-write-reread", "expected keyfile for '%s'", testfile); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); ASSERT (nm_connection_verify (reread, &error), @@ -9338,9 +9214,6 @@ test_write_wifi_wpa_then_open (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -9357,6 +9230,7 @@ test_write_wifi_wpa_then_open (void) nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); /* Write it back out */ + keyfile = utils_get_keys_path (testfile); success = writer_update_connection (connection, TEST_SCRATCH_DIR "/network-scripts/", testfile, @@ -9377,9 +9251,6 @@ test_write_wifi_wpa_then_open (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); unlink (testfile); g_assert_no_error (error); @@ -9387,7 +9258,7 @@ test_write_wifi_wpa_then_open (void) g_assert (reread); /* No keyfile since it's an open connection this time */ - g_assert (keyfile); + keyfile = utils_get_keys_path (testfile); g_assert (g_file_test (keyfile, G_FILE_TEST_EXISTS) == FALSE); success = nm_connection_verify (reread, &error); @@ -9519,9 +9390,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -9545,6 +9413,7 @@ test_write_wifi_wpa_then_wep_with_perms (void) nm_setting_wireless_security_set_wep_key (s_wsec, 0, "abraka dabra"); /* Write it back out */ + keyfile = utils_get_keys_path (testfile); success = writer_update_connection (connection, TEST_SCRATCH_DIR "/network-scripts/", testfile, @@ -9564,9 +9433,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); g_assert_no_error (error); @@ -9582,6 +9448,7 @@ test_write_wifi_wpa_then_wep_with_perms (void) ASSERT (success, "test_write_wifi_wpa_then_wep_with_perms", "failed to compare connections"); + keyfile = utils_get_keys_path (testfile); unlink (keyfile); unlink (testfile); @@ -9698,13 +9565,11 @@ test_write_wifi_dynamic_wep_leap (void) NULL, TYPE_WIRELESS, NULL, - &keyfile, - NULL, - NULL, &error); g_assert_no_error (error); g_assert (reread); - g_assert (keyfile); + + keyfile = utils_get_keys_path (testfile); unlink (keyfile); success = nm_connection_verify (reread, &error); @@ -9827,9 +9692,6 @@ test_write_wired_qeth_dhcp (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -9950,9 +9812,6 @@ test_write_wired_ctc_dhcp (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -10050,9 +9909,6 @@ test_write_permissions (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -10167,9 +10023,6 @@ test_write_wifi_wep_agent_keys (void) NULL, TYPE_WIRELESS, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -10429,7 +10282,6 @@ test_read_bridge_main (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -10542,7 +10394,6 @@ test_write_bridge_main (void) NULL, TYPE_BRIDGE, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -10571,7 +10422,6 @@ test_read_bridge_component (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert (connection); @@ -10667,9 +10517,6 @@ test_write_bridge_component (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -10697,7 +10544,6 @@ test_read_bridge_missing_stp (void) NULL, TYPE_BRIDGE, NULL, - NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -10728,7 +10574,6 @@ test_read_vlan_interface (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -10786,7 +10631,6 @@ test_read_vlan_only_vlan_id (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -10816,7 +10660,6 @@ test_read_vlan_only_device (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -10842,7 +10685,7 @@ test_read_vlan_physdev (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-physdev", NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -10870,7 +10713,6 @@ test_write_vlan (void) NULL, TYPE_VLAN, NULL, - NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -10897,7 +10739,6 @@ test_write_vlan_only_vlanid (void) NULL, TYPE_VLAN, NULL, - NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); @@ -10916,7 +10757,6 @@ test_write_vlan_only_vlanid (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); unlink (written); g_free (written); @@ -11012,7 +10852,6 @@ test_write_ethernet_missing_ipv6 (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -11051,7 +10890,7 @@ test_read_ibft_ignored (void) connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft", NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error); + NULL, &error); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); g_assert (connection == NULL); } @@ -11069,7 +10908,6 @@ test_read_bond_main (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "bond-main-read", "unexpected failure reading %s", TEST_IFCFG_BOND_MAIN); @@ -11181,7 +11019,6 @@ test_write_bond_main (void) NULL, TYPE_BOND, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -11212,7 +11049,6 @@ test_read_bond_slave (void) NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -11303,9 +11139,6 @@ test_write_bond_slave (void) NULL, TYPE_ETHERNET, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -11341,7 +11174,6 @@ test_read_infiniband (void) NULL, TYPE_INFINIBAND, &unmanaged, - NULL, NULL, NULL, &error); ASSERT (connection != NULL, "infiniband-read", "failed to read %s: %s", TEST_IFCFG_INFINIBAND, error->message); @@ -11478,7 +11310,6 @@ test_write_infiniband (void) NULL, TYPE_INFINIBAND, NULL, - NULL, NULL, NULL, &error); unlink (testfile); @@ -11509,7 +11340,6 @@ test_read_bond_slave_ib (void) NULL, NULL, NULL, - NULL, NULL, NULL, &error); g_test_assert_expected_messages(); @@ -11600,9 +11430,6 @@ test_write_bond_slave_ib (void) NULL, NULL, NULL, - NULL, - NULL, - &route6file, &error); unlink (testfile); @@ -11641,7 +11468,7 @@ test_read_dcb_basic (void) gboolean expected_pfcs[8] = { TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE }; connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -11774,8 +11601,7 @@ test_write_dcb_basic (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, + NULL, &error); unlink (testfile); @@ -11798,7 +11624,7 @@ test_read_dcb_default_app_priorities (void) gboolean success; connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-default-app-priorities", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); success = nm_connection_verify (connection, &error); @@ -11829,7 +11655,7 @@ test_read_dcb_bad_booleans (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_STRICT value*not all 0s and 1s*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-booleans", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11846,7 +11672,7 @@ test_read_dcb_short_booleans (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_STRICT value*8 characters*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-booleans", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11863,7 +11689,7 @@ test_read_dcb_bad_uints (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_UP2TC value*not 0 - 7*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-uints", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11880,7 +11706,7 @@ test_read_dcb_short_uints (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_UP2TC value*8 characters*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-uints", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11897,7 +11723,7 @@ test_read_dcb_bad_percent (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_PCT percentage value*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-bad-percent", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11914,7 +11740,7 @@ test_read_dcb_short_percent (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid DCB_PG_PCT percentage list value*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-short-percent", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11931,7 +11757,7 @@ test_read_dcb_pgpct_not_100 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DCB_PG_PCT percentages do not equal 100*"); connection = connection_from_file_test (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-dcb-pgpct-not-100", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_test_assert_expected_messages (); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION); @@ -11950,7 +11776,7 @@ test_read_fcoe_mode (gconstpointer user_data) char *file; file = g_strdup_printf (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-fcoe-%s", expected_mode); - connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + connection = connection_from_file_test (file, NULL, TYPE_ETHERNET, NULL, &error); g_free (file); g_assert_no_error (error); g_assert (connection); @@ -12043,8 +11869,7 @@ test_write_fcoe_mode (gconstpointer user_data) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, - NULL, NULL, + NULL, &error); unlink (testfile); @@ -12069,7 +11894,7 @@ test_read_team_master (void) const char *expected_config = "{ \"device\": \"team0\", \"link_watch\": { \"name\": \"ethtool\" } }"; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-master", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -12181,7 +12006,7 @@ test_write_team_master (void) /* re-read the connection for comparison */ reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error); + NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -12208,7 +12033,7 @@ test_read_team_port (void) const char *expected_config = "{ \"p4p1\": { \"prio\": -10, \"sticky\": true } }"; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -12304,7 +12129,7 @@ test_write_team_port (void) /* re-read the connection for comparison */ reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - NULL, NULL, NULL, NULL, &error); + NULL, &error); unlink (testfile); g_assert_no_error (error); g_assert (reread); @@ -12329,7 +12154,7 @@ test_read_team_port_empty_config (void) GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-team-port-empty-config", - NULL, TYPE_ETHERNET, NULL, NULL, NULL, NULL, &error); + NULL, TYPE_ETHERNET, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -12475,7 +12300,7 @@ test_read_vlan_trailing_spaces (void) g_free (contents); connection = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, NULL, - NULL, NULL, NULL, &error); + &error); g_assert_no_error (error); g_assert (connection != NULL);