extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
extern int utc_connection_get_ethernet_state_p(void);
+extern int utc_connection_get_dhcp_state_n(void);
+extern int utc_connection_get_dhcp_state_p(void);
extern int utc_connection_get_wifi_state_n(void);
extern int utc_connection_get_wifi_state_p(void);
extern int utc_connection_get_bt_state_n(void);
extern int utc_connection_set_internet_state_changed_cb_n2(void);
extern int utc_connection_unset_internet_state_changed_cb_p(void);
extern int utc_connection_unset_internet_state_changed_cb_n(void);
+extern int utc_connection_set_dhcp_state_changed_cb_p(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n1(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n2(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_p(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_n(void);
extern int utc_connection_profile_get_internet_state_p(void);
extern int utc_connection_profile_get_internet_state_n1(void);
extern int utc_connection_profile_get_internet_state_n2(void);
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup},
extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
extern int utc_connection_get_ethernet_state_p(void);
+extern int utc_connection_get_dhcp_state_n(void);
+extern int utc_connection_get_dhcp_state_p(void);
extern int utc_connection_get_wifi_state_n(void);
extern int utc_connection_get_wifi_state_p(void);
extern int utc_connection_get_bt_state_n(void);
extern int utc_connection_set_internet_state_changed_cb_n2(void);
extern int utc_connection_unset_internet_state_changed_cb_p(void);
extern int utc_connection_unset_internet_state_changed_cb_n(void);
+extern int utc_connection_set_dhcp_state_changed_cb_p(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n1(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n2(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_p(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_n(void);
extern int utc_connection_profile_get_internet_state_p(void);
extern int utc_connection_profile_get_internet_state_n1(void);
extern int utc_connection_profile_get_internet_state_n2(void);
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup},
extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
extern int utc_connection_get_ethernet_state_p(void);
+extern int utc_connection_get_dhcp_state_n(void);
+extern int utc_connection_get_dhcp_state_p(void);
extern int utc_connection_get_wifi_state_n(void);
extern int utc_connection_get_wifi_state_p(void);
extern int utc_connection_get_bt_state_n(void);
extern int utc_connection_foreach_ipv6_address_n(void);
extern int utc_connection_set_ethernet_cable_state_changed_cb_n(void);
extern int utc_connection_unset_ethernet_cable_state_changed_cb_n(void);
+extern int utc_connection_set_dhcp_state_changed_cb_p(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n1(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n2(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_p(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_n(void);
extern int utc_connection_destroy_p(void);
extern int utc_connection_destroy_n(void);
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_foreach_ipv6_address_n", utc_connection_foreach_ipv6_address_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_set_ethernet_cable_state_changed_cb_n", utc_connection_set_ethernet_cable_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_ethernet_cable_state_changed_cb_n", utc_connection_unset_ethernet_cable_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_destroy_p", utc_connection_destroy_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_destroy_n", utc_connection_destroy_n, utc_network_connection_startup, utc_network_connection_cleanup},
{NULL, NULL}
extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
extern int utc_connection_get_ethernet_state_p(void);
+extern int utc_connection_get_dhcp_state_n(void);
+extern int utc_connection_get_dhcp_state_p(void);
extern int utc_connection_get_wifi_state_n(void);
extern int utc_connection_get_wifi_state_p(void);
extern int utc_connection_get_bt_state_n(void);
extern int utc_connection_set_internet_state_changed_cb_n2(void);
extern int utc_connection_unset_internet_state_changed_cb_p(void);
extern int utc_connection_unset_internet_state_changed_cb_n(void);
+extern int utc_connection_set_dhcp_state_changed_cb_p(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n1(void);
+extern int utc_connection_set_dhcp_state_changed_cb_n2(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_p(void);
+extern int utc_connection_unset_dhcp_state_changed_cb_n(void);
extern int utc_connection_profile_get_internet_state_p(void);
extern int utc_connection_profile_get_internet_state_n1(void);
extern int utc_connection_profile_get_internet_state_n2(void);
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup},
PRINT_RETURN("test_connection_internet_state_changed_callback", CONNECTION_ERROR_NONE);
}
+static void test_connection_dhcp_state_changed_callback(connection_dhcp_state_e state,
+ const char *interface_name, connection_error_e result, void *user_data)
+{
+ PRINT_RETURN("test_connection_dhcp_state_changed_callback", CONNECTION_ERROR_NONE);
+}
+
static int test_get_profile_by_name(connection_profile_h *profile, char *name)
{
connection_profile_h profile_h;
return 0;
}
+/**
+ * @testcase utc_connection_get_dhcp_state_n
+ * @since_tizen 8.0
+ * @type Negative
+ * @description connection_get_dhcp_state should fail with invalid parameter.
+ * @scenario Verify connection_get_dhcp_state by passing invalid parameter.
+ */
+int utc_connection_get_dhcp_state_n(void)
+{
+ int ret;
+ connection_dhcp_state_e state;
+
+ if(all_features_not_supported) {
+ ret = connection_get_dhcp_state(NULL, NULL, NULL);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = connection_get_dhcp_state(NULL, NULL, &state);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_get_dhcp_state(NULL, "wlan0", NULL);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_get_dhcp_state(NULL, "wlan0", &state);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_get_dhcp_state(connection, NULL, NULL);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_get_dhcp_state(connection, "wlan0", NULL);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_get_dhcp_state(connection, NULL, &state);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_get_dhcp_state_p
+ * @since_tizen 8.0
+ * @type Positive
+ * @description Gets the DHCP state of the interface
+ * @scenario Invoking connection_get_dhcp_state with valid parameter.
+ */
+int utc_connection_get_dhcp_state_p(void)
+{
+ int ret;
+ connection_dhcp_state_e state;
+
+ if (all_features_not_supported) {
+ ret = connection_get_dhcp_state(connection, NULL, &state);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = connection_get_dhcp_state(connection, "wlan0", &state);
+ CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NONE);
+
+ return 0;
+}
+
/**
* @testcase utc_connection_get_wifi_state_n
* @since_tizen 2.3
return 0;
}
+/**
+ * @testcase utc_connection_set_dhcp_state_changed_cb_p
+ * @since_tizen 8.0
+ * @type Positive
+ * @description Set DHCP state changed callback.
+ * @scenario Verify connection_set_dhcp_state_changed_cb by passing valid parameter.
+ */
+int utc_connection_set_dhcp_state_changed_cb_p(void)
+{
+ int ret;
+ ret = connection_set_dhcp_state_changed_cb(connection,
+ test_connection_dhcp_state_changed_callback, NULL);
+
+ CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_NONE);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_set_dhcp_state_changed_cb_n1
+ * @since_tizen 8.0
+ * @type Negative
+ * @description connection_set_dhcp_state_changed_cb should fail when connection is NULL.
+ * @scenario Verify connection_set_dhcp_state_changed_cb by passing connection as NULL.
+ */
+int utc_connection_set_dhcp_state_changed_cb_n1(void)
+{
+ int ret;
+ ret = connection_set_dhcp_state_changed_cb(NULL,
+ test_connection_dhcp_state_changed_callback, NULL);
+
+ CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_set_internet_state_changed_cb_n2
+ * @since_tizen 8.0
+ * @type Negative
+ * @description connection_set_dhcp_state_changed_cb should fail when callback is NULL.
+ * @scenario Verify connection_set_dhcp_state_changed_cb by passing callback as NULL.
+ */
+int utc_connection_set_dhcp_state_changed_cb_n2(void)
+{
+ int ret;
+ ret = connection_set_dhcp_state_changed_cb(connection, NULL, NULL);
+
+ CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_unset_dhcp_state_changed_cb_p
+ * @since_tizen 8.0
+ * @type Positive
+ * @description Unset DHCP state changed callback.
+ * @scenario Verify connection_unset_dhcp_state_changed_cb by passing valid parameter.
+ */
+int utc_connection_unset_dhcp_state_changed_cb_p(void)
+{
+ int ret;
+ ret = connection_unset_dhcp_state_changed_cb(connection);
+
+ CHECK_RETURN("connection_unset_dhcp_state_changed_cb", ret, CONNECTION_ERROR_NONE);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_unset_dhcp_state_changed_cb_n
+ * @since_tizen 8.0
+ * @type Negative
+ * @description connection_unset_dhcp_state_changed_cb should fail when connection is NULL.
+ * @scenario Verify connection_unset_dhcp_state_changed_cb by passing connection as NULL.
+ */
+int utc_connection_unset_dhcp_state_changed_cb_n(void)
+{
+ int ret;
+ ret = connection_unset_dhcp_state_changed_cb(NULL);
+
+ CHECK_RETURN("connection_unset_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
/**
* @testcase utc_connection_destroy_p
* @since_tizen 2.3