From 9f026283c67f02eb66301e7b577f4f9e9662d449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 31 Aug 2011 19:05:21 +0200 Subject: [PATCH] ifnet: fix tests --- src/settings/plugins/ifnet/tests/test_all.c | 36 +++++++++---------- .../plugins/ifnet/tests/test_ca_cert.pem | 27 ++++++++++++++ .../plugins/ifnet/tests/wpa_supplicant.conf | 3 +- 3 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 src/settings/plugins/ifnet/tests/test_ca_cert.pem diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test_all.c index d114bbba82..1fd1ed1f56 100644 --- a/src/settings/plugins/ifnet/tests/test_all.c +++ b/src/settings/plugins/ifnet/tests/test_all.c @@ -252,25 +252,25 @@ test_is_unmanaged () static void test_new_connection () { - GError **error = NULL; + GError *error = NULL; NMConnection *connection; - connection = ifnet_update_connection_from_config_block ("eth2", error); + connection = ifnet_update_connection_from_config_block ("eth2", &error); ASSERT (connection != NULL, "new connection", "new connection failed: %s", - error == NULL ? "None" : (*error)->message); + error ? error->message : "None"); g_object_unref (connection); - connection = - ifnet_update_connection_from_config_block ("qiaomuf", error); + + connection = ifnet_update_connection_from_config_block ("qiaomuf", &error); ASSERT (connection != NULL, "new connection", - "new connection failed: %s", error - && (*error) ? (*error)->message : "NONE"); + "new connection failed: %s", + error ? error->message : "NONE"); g_object_unref (connection); - connection = - ifnet_update_connection_from_config_block ("myxjtu2", error); + + connection = ifnet_update_connection_from_config_block ("myxjtu2", &error); ASSERT (connection != NULL, "new connection", - "new connection failed: %s", error - && (*error) ? (*error)->message : "NONE"); + "new connection failed: %s", + error ? error->message : "NONE"); g_object_unref (connection); } @@ -280,32 +280,32 @@ test_new_connection () static void test_update_connection () { - GError **error = NULL; + GError *error = NULL; NMConnection *connection; gboolean success; - connection = ifnet_update_connection_from_config_block ("eth0", error); + connection = ifnet_update_connection_from_config_block ("eth0", &error); ASSERT (connection != NULL, "get connection", "get connection failed: %s", - error == NULL ? "None" : (*error)->message); + error ? error->message : "None"); success = ifnet_update_parsers_by_connection (connection, "eth0", NET_GEN_NAME, SUP_GEN_NAME, NULL, - error); + &error); ASSERT (success, "update connection", "update connection failed %s", "eth0"); g_object_unref (connection); - connection = ifnet_update_connection_from_config_block ("0xab3ace", error); + connection = ifnet_update_connection_from_config_block ("0xab3ace", &error); ASSERT (connection != NULL, "get connection", "get connection failed: %s", - error == NULL ? "None" : (*error)->message); + error ? error->message : "None"); success = ifnet_update_parsers_by_connection (connection, "0xab3ace", NET_GEN_NAME, SUP_GEN_NAME, NULL, - error); + &error); ASSERT (success, "update connection", "update connection failed %s", "0xab3ace"); g_object_unref (connection); diff --git a/src/settings/plugins/ifnet/tests/test_ca_cert.pem b/src/settings/plugins/ifnet/tests/test_ca_cert.pem new file mode 100644 index 0000000000..ef1be20d2b --- /dev/null +++ b/src/settings/plugins/ifnet/tests/test_ca_cert.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEjzCCA3egAwIBAgIJAOvnZPt59yIZMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYD +VQQGEwJVUzESMBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcw +FQYDVQQKEw5NeSBDb21wYW55IEx0ZDEQMA4GA1UECxMHVGVzdGluZzENMAsGA1UE +AxMEdGVzdDEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTAeFw0wOTAzMTAx +NTEyMTRaFw0xOTAzMDgxNTEyMTRaMIGLMQswCQYDVQQGEwJVUzESMBAGA1UECBMJ +QmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5NeSBDb21wYW55 +IEx0ZDEQMA4GA1UECxMHVGVzdGluZzENMAsGA1UEAxMEdGVzdDEcMBoGCSqGSIb3 +DQEJARYNdGVzdEB0ZXN0LmNvbTCCASIwDQYJKo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KqanW5OgQwToBqp +3nniskIjbH0xjgZf/nVMyLnjxg== +-----END CERTIFICATE----- diff --git a/src/settings/plugins/ifnet/tests/wpa_supplicant.conf b/src/settings/plugins/ifnet/tests/wpa_supplicant.conf index a2595d42cf..4f5f68cf97 100644 --- a/src/settings/plugins/ifnet/tests/wpa_supplicant.conf +++ b/src/settings/plugins/ifnet/tests/wpa_supplicant.conf @@ -859,6 +859,7 @@ network={ identity="user@example.com" anonymous_identity="anonymous@example.com" password="foobar" - ca_cert="blob://exampleblob" + ca_cert="test_ca_cert.pem" + phase2="auth=CHAP" priority=20 }