diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 7596cbd5f..caa1f4ba2 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 145a0a391..1c2b566d1 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 c23e5870e..7fafc5678 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 4a6940d0d..ce133c0df 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);