[UTC][connection][ACR-1769] Add TCs for getting DHCP state 49/298649/2
authorAnjali Nijhara <a.nijhara@samsung.com>
Fri, 25 Aug 2023 10:33:54 +0000 (16:03 +0530)
committerAnjali Nijhara <a.nijhara@samsung.com>
Tue, 12 Sep 2023 11:43:31 +0000 (17:13 +0530)
Change-Id: Idf7dc2ab39e8849ed9c3103c71b33f4ad80bb48f

src/utc/connection/tct-connection-core_mobile.h
src/utc/connection/tct-connection-core_tizeniot.h
src/utc/connection/tct-connection-core_tv.h
src/utc/connection/tct-connection-core_wearable.h
src/utc/connection/utc-network-connection.c

index f0e25734c971ce70baefedb588e289fd082ffa4a..21657dcf4bd732725235b2c8f9d8e27ab4fe8c5f 100755 (executable)
@@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void);
 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);
@@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(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);
@@ -366,6 +373,8 @@ testcase tc_array[] = {
     {"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},
@@ -441,6 +450,11 @@ testcase tc_array[] = {
     {"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},
index f0e25734c971ce70baefedb588e289fd082ffa4a..21657dcf4bd732725235b2c8f9d8e27ab4fe8c5f 100755 (executable)
@@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void);
 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);
@@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(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);
@@ -366,6 +373,8 @@ testcase tc_array[] = {
     {"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},
@@ -441,6 +450,11 @@ testcase tc_array[] = {
     {"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},
index 8b08bfdda1c046dbdff558205067932b346aa32c..c9b5d2831728aabd263f95ee20c38f8c8f9ecb12 100755 (executable)
@@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void);
 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);
@@ -224,6 +226,11 @@ extern int utc_connection_foreach_ipv6_address_p(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);
 
@@ -358,6 +365,8 @@ testcase tc_array[] = {
     {"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},
@@ -428,6 +437,11 @@ testcase tc_array[] = {
     {"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}
index f0e25734c971ce70baefedb588e289fd082ffa4a..21657dcf4bd732725235b2c8f9d8e27ab4fe8c5f 100755 (executable)
@@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void);
 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);
@@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(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);
@@ -366,6 +373,8 @@ testcase tc_array[] = {
     {"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},
@@ -441,6 +450,11 @@ testcase tc_array[] = {
     {"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},
index 45e4cbabe67200fc1e590d030253cc3858f91806..6d244fc21a232d3f643eba5a2191a84840fabbc0 100755 (executable)
@@ -73,6 +73,12 @@ static void test_connection_internet_state_changed_callback(connection_internet_
        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;
@@ -562,6 +568,64 @@ int utc_connection_get_ethernet_state_p(void)
        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
@@ -2612,6 +2676,93 @@ int utc_connection_unset_internet_state_changed_cb_n(void)
        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