From: Saurav Babu Date: Thu, 21 Apr 2016 08:59:49 +0000 (+0530) Subject: [wifi] Add test code for WiFi EAP connection X-Git-Tag: submit/tizen/20160426.023658~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60effa5bedd4449b1d424b9d675e476849a8e31b;p=platform%2Fcore%2Fapi%2Fwifi.git [wifi] Add test code for WiFi EAP connection Change-Id: I2f69a0c6972b4586e9037daaf7310f3d2bcac8a4 Signed-off-by: Saurav Babu --- diff --git a/test/wifi_test.c b/test/wifi_test.c index e83490f..2b420dc 100755 --- a/test/wifi_test.c +++ b/test/wifi_test.c @@ -427,6 +427,48 @@ static bool __test_found_eap_ap_callback(wifi_ap_h ap, void *user_data) printf("name : %s, is password set : %s\n", inputed_name, is_pass_set ? "TRUE" : "FALSE"); + printf("Input certificate file:\n"); + rv = scanf("%99s", input_str1); + + rv = wifi_ap_set_eap_ca_cert_file(ap, input_str1); + if (rv != WIFI_ERROR_NONE) { + printf("Fail to set eap certificatefile : %s\n", __test_convert_error_to_string(rv)); + g_free(ap_name); + return false; + } + + int input_int; + printf("Input EAP type:\n"); + printf("0 -> WIFI_EAP_TYPE_PEAP\n"); + printf("1 -> WIFI_EAP_TYPE_TLS\n"); + printf("2 -> WIFI_EAP_TYPE_TTLS\n"); + printf("3 -> WIFI_EAP_TYPE_SIM\n"); + printf("4 -> WIFI_EAP_TYPE_AKA\n"); + rv = scanf("%d", &input_int); + + rv = wifi_ap_set_eap_type(ap, input_int); + if (rv != WIFI_ERROR_NONE) { + printf("Fail to set eap type : %s\n", __test_convert_error_to_string(rv)); + g_free(ap_name); + return false; + } + + printf("Input EAP authentication type:\n"); + printf("0 -> WIFI_EAP_AUTH_TYPE_NONE\n"); + printf("1 -> WIFI_EAP_AUTH_TYPE_PAP\n"); + printf("2 -> WIFI_EAP_AUTH_TYPE_MSCHAP\n"); + printf("3 -> WIFI_EAP_AUTH_TYPE_MSCHAPV2\n"); + printf("4 -> WIFI_EAP_AUTH_TYPE_GTC\n"); + printf("5 -> WIFI_EAP_AUTH_TYPE_MD5\n"); + rv = scanf("%d", &input_int); + + rv = wifi_ap_set_eap_auth_type(ap, input_int); + if (rv != WIFI_ERROR_NONE) { + printf("Fail to set eap auth type : %s\n", __test_convert_error_to_string(rv)); + g_free(ap_name); + return false; + } + rv = wifi_connect(ap, __test_connected_callback, NULL); if (rv != WIFI_ERROR_NONE) printf("Fail to connection request [%s] : %s\n", ap_name, __test_convert_error_to_string(rv));