#include "ITs-vpn-service-common.h"
vpnsvc_h g_hVpnSvcHandle = NULL;
+#define VPNSVC_IP4_STRING_LEN 16
//& set: VpnService
return 0;
}
+//& type: auto
+//& purpose: To Set local IP for VPN
+/**
+* @testcase ITc_vpnsvc_set_local_ip_address_p
+* @since_tizen 3.0
+* @author SRID(nibha.sharma)
+* @reviewer SRID(parshant.v)
+* @type auto
+* @description To Set local IP for VPN
+* @scenario To Set local IP for VPN
+* @apicovered vpnsvc_set_local_ip_address
+* @passcase If vpnsvc_set_local_ip_address returns success
+* @failcase If vpnsvc_set_local_ip_address returns false
+* @precondition vpn-service should be initialized
+* @postcondition vpn-service should be de-initialized
+*/
+int ITc_vpnsvc_set_local_ip_address_p(void)
+{
+ START_TEST;
+
+ char *pszLocalIp = "192.168.123.45";
+
+ // Target API
+ int nRetValue = vpnsvc_set_local_ip_address(g_hVpnSvcHandle, pszLocalIp);
+ PRINT_RESULT(VPNSVC_ERROR_NONE, nRetValue, "vpnsvc_set_local_ip_address", VPNSVCGetError(nRetValue));
+
+ return 0;
+}
+
+//& type: auto
+//& purpose: To Set remote IP for VPN
+/**
+* @testcase ITc_vpnsvc_set_remote_ip_address_p
+* @since_tizen 3.0
+* @author SRID(nibha.sharma)
+* @reviewer SRID(parshant.v)
+* @type auto
+* @description To Set remote IP for VPN
+* @scenario To Set remote IP for VPN
+* @apicovered vpnsvc_set_remote_ip_address
+* @passcase If vpnsvc_set_remote_ip_address returns success
+* @failcase If vpnsvc_set_remote_ip_address returns false
+* @precondition vpn-service should be initialized
+* @postcondition vpn-service should be de-initialized
+*/
+int ITc_vpnsvc_set_remote_ip_address_p(void)
+{
+ START_TEST;
+
+ char *pszRemoteIp = "192.168.123.123";
+
+ // Target API
+ int nRetValue = vpnsvc_set_remote_ip_address(g_hVpnSvcHandle, pszRemoteIp);
+ PRINT_RESULT(VPNSVC_ERROR_NONE, nRetValue, "vpnsvc_set_remote_ip_address", VPNSVCGetError(nRetValue));
+
+ return 0;
+}
+
+//& type: auto
+//& purpose: To update vpn settings
+/**
+* @testcase ITc_vpnsvc_update_settings_p
+* @since_tizen 3.0
+* @author SRID(nibha.sharma)
+* @reviewer SRID(parshant.v)
+* @type auto
+* @description To update vpn settings
+* @scenario To update vpn settings
+* @apicovered vpnsvc_update_settings
+* @passcase If vpnsvc_update_settings returns success
+* @failcase If vpnsvc_update_settings returns false
+* @precondition vpn-service should be initialized
+* @postcondition vpn-service should be de-initialized
+*/
+int ITc_vpnsvc_update_settings_p(void)
+{
+ START_TEST;
+
+ char *pszLocalIp = "192.168.123.45";
+ char *pszRemoteIp = "192.168.123.123";
+
+ int nRetValue = vpnsvc_set_local_ip_address(g_hVpnSvcHandle, pszLocalIp);
+ PRINT_RESULT(VPNSVC_ERROR_NONE, nRetValue, "vpnsvc_set_local_ip_address", VPNSVCGetError(nRetValue));
+
+ nRetValue = vpnsvc_set_remote_ip_address(g_hVpnSvcHandle, pszRemoteIp);
+ PRINT_RESULT(VPNSVC_ERROR_NONE, nRetValue, "vpnsvc_set_remote_ip_address", VPNSVCGetError(nRetValue));
+
+ // Target API
+ nRetValue = vpnsvc_update_settings(g_hVpnSvcHandle);
+ PRINT_RESULT(VPNSVC_ERROR_NONE, nRetValue, "vpnsvc_update_settings", VPNSVCGetError(nRetValue));
+
+ return 0;
+}
/** @} */
/** @} */
extern int ITc_vpnsvc_set_blocking_p(void);
extern int ITc_vpnsvc_block_unblock_networks_p(void);
extern int ITc_vpnsvc_protect_p(void);
+extern int ITc_vpnsvc_set_local_ip_address_p(void);
+extern int ITc_vpnsvc_set_remote_ip_address_p(void);
+extern int ITc_vpnsvc_update_settings_p(void);
+extern int ITc_vpnsvc_add_remove_route_p(void);
+extern int ITc_vpnsvc_add_remove_dns_server_p(void);
testcase tc_array[] = {
{"ITc_vpnsvc_init_deinit_p", ITc_vpnsvc_init_deinit_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
{"ITc_vpnsvc_set_blocking_p", ITc_vpnsvc_set_blocking_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
{"ITc_vpnsvc_block_unblock_networks_p", ITc_vpnsvc_block_unblock_networks_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
{"ITc_vpnsvc_protect_p", ITc_vpnsvc_protect_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
+ {"ITc_vpnsvc_set_local_ip_address_p", ITc_vpnsvc_set_local_ip_address_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
+ {"ITc_vpnsvc_set_remote_ip_address_p", ITc_vpnsvc_set_remote_ip_address_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
+ {"ITc_vpnsvc_update_settings_p", ITc_vpnsvc_update_settings_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
+ {"ITc_vpnsvc_add_remove_route_p", ITc_vpnsvc_add_remove_route_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
+ {"ITc_vpnsvc_add_remove_dns_server_p", ITc_vpnsvc_add_remove_dns_server_p, ITs_vpn_service_startup, ITs_vpn_service_cleanup},
{NULL, NULL}
};