return false;
}
+void test_connection_dhcp_state_changed_callback(connection_dhcp_state_e state, const char *interface_name, connection_error_e result, void *user_data)
+{
+ FPRINTF("[Line : %d][%s]Inside test_connection_dhcp_state_changed_callback\n", __LINE__, API_NAMESPACE);
+}
+
void ConnectionInternetStateChangedCB(connection_internet_state_e state, void* user_data)
{
FPRINTF("[Line : %d][%s]Inside ConnectionInternetStateChangedCB callback\n", __LINE__, API_NAMESPACE);
return 0;
}
+//& purpose: To check state of dhcp
+//& type : auto
+/**
+* @testcase ITc_connection_get_dhcp_state_p
+* @since_tizen 8.0
+* @author SRID(tarun1.kumar)
+* @reviewer SRID(shobhit.v)
+* @type auto
+* @description To check state of dhcp
+* @scenario Call API to get state of dhcp
+* @apicovered connection_get_dhcp_state
+* @passcase When API return CONNECTION_ERROR_NONE
+* @failcase When API not return CONNECTION_ERROR_NONE
+* @precondition None
+* @postcondition None
+*/
+int ITc_connection_get_dhcp_state_p(void)
+{
+ START_TEST;
+
+ FPRINTF("[Line : %d][%s]Starting test : %s\\n", __LINE__, API_NAMESPACE,__FUNCTION__);
+
+ if ( g_nPreconditionError == 1 )
+ {
+ FPRINTF("[Line : %d][%s] ITc_connection_get_dhcp_state_p failed on precondition\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ connection_dhcp_state_e state;
+ int nRet = connection_get_dhcp_state(g_hConnection, "wlan0", &state);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_get_dhcp_state", ConnectionGetError(nRet));
+
+ return 0;
+}
+
//& purpose: To check state of Bluetooth
//& type : auto
/**
return 0;
}
+
+//& purpose: To check whether dhcp state changed
+//& type : auto
+/**
+* @testcase ITc_connection_set_unset_internet_state_changed_cb_p
+* @since_tizen 8.0
+* @author SRID(tarun1.kumar)
+* @reviewer SRID(shobhit.v)
+* @description To check for dhcp state changed callback .
+* @apicovered connection_set_dhcp_state_changed_cb, connection_unset_dhcp_state_changed_cb
+* @passcase When connection_set_dhcp_state_changed_cb, connection_unset_dhcp_state_changed_cb return CONNECTION_ERROR_NONE
+* @failcase When connection_set_dhcp_state_changed_cb, connection_unset_dhcp_state_changed_cb not return CONNECTION_ERROR_NONE
+* @precondition None
+* @postcondition None
+*/
+
+int ITc_connection_set_unset_dhcp_state_changed_cb_p(void)
+{
+ START_TEST;
+
+ if (g_nPreconditionError == 1)
+ {
+ FPRINTF("[Line: %d][%s] ITc_connection_set_unset_dhcp_state_changed_cb_p failed\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ int nRet = -1;
+
+ nRet = connection_set_dhcp_state_changed_cb(g_hConnection, test_connection_dhcp_state_changed_callback, NULL);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_set_dhcp_state_changed_cb", ConnectionGetError(nRet));
+
+ nRet = connection_unset_dhcp_state_changed_cb(g_hConnection);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_unset_dhcp_state_changed_cb", ConnectionGetError(nRet));
+
+ return 0;
+}
/** @} */
/** @} */
extern int ITc_connection_is_metered_network_p(void);
extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
extern int ITc_connection_profile_get_internet_state_p(void);
+extern int ITc_connection_get_dhcp_state_p(void);
+extern int ITc_connection_set_unset_dhcp_state_changed_cb_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
+ {"ITc_connection_get_dhcp_state_p", ITc_connection_get_dhcp_state_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_dhcp_state_changed_cb_p", ITc_connection_set_unset_dhcp_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{NULL, NULL}
};
extern int ITc_connection_is_metered_network_p(void);
extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
extern int ITc_connection_profile_get_internet_state_p(void);
+extern int ITc_connection_get_dhcp_state_p(void);
+extern int ITc_connection_set_unset_dhcp_state_changed_cb_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
+ {"ITc_connection_get_dhcp_state_p", ITc_connection_get_dhcp_state_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_dhcp_state_changed_cb_p", ITc_connection_set_unset_dhcp_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{NULL, NULL}
};
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
extern int ITc_connection_profile_get_internet_state_p(void);
+extern int ITc_connection_get_dhcp_state_p(void);
+extern int ITc_connection_set_unset_dhcp_state_changed_cb_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
+ {"ITc_connection_get_dhcp_state_p", ITc_connection_get_dhcp_state_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_dhcp_state_changed_cb_p", ITc_connection_set_unset_dhcp_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{NULL, NULL}
};
extern int ITc_connection_is_metered_network_p(void);
extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
extern int ITc_connection_profile_get_internet_state_p(void);
+extern int ITc_connection_get_dhcp_state_p(void);
+extern int ITc_connection_set_unset_dhcp_state_changed_cb_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
+ {"ITc_connection_get_dhcp_state_p", ITc_connection_get_dhcp_state_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_dhcp_state_changed_cb_p", ITc_connection_set_unset_dhcp_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
{NULL, NULL}
};