Fix unit testcases for DM -- 1. Connect WiFi at startup, 2. Provide valid tx power...
authorvenkat.iyer <venkat.iyer@samsung.com>
Mon, 18 Sep 2017 10:38:17 +0000 (19:38 +0900)
committervenkat.iyer <venkat.iyer@samsung.com>
Mon, 18 Sep 2017 11:00:02 +0000 (20:00 +0900)
apps/examples/testcase/ta_tc/device_management/utc/Kconfig
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_conn.c
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_lwm2m.c
apps/examples/testcase/ta_tc/device_management/utc/utc_dm_main.c

index 65c56a6..c1b4ea2 100644 (file)
@@ -12,6 +12,14 @@ menuconfig EXAMPLES_TESTCASE_DM_UTC
 
 if EXAMPLES_TESTCASE_DM_UTC
 
+config UTC_DM_SERVER_IPADDR
+       string "Server IP address"
+       default "192.168.1.7"
+
+config UTC_DM_SERVER_PORT
+       string "Server Port"
+       default "5683"
+
 config TC_DM_START
        bool "Start API"
        default n
index b97189b..8f32191 100644 (file)
@@ -235,7 +235,10 @@ static void utc_dm_conn_set_tx_power_n(void)
 static void utc_dm_conn_set_tx_power_p(void)
 {
        int ret;
-       int val;
+       int val = 20;
+       /* Please make sure you provide a valid tx power value within
+        * the range of 13 to 29. Here, we provide a valid value of 20.
+        */
        ret = dm_conn_set_tx_power(&val);
 
        TC_ASSERT_EQ("dm_conn_set_tx_power", ret, DM_ERROR_NONE);
index 98a58eb..9df8176 100644 (file)
@@ -36,8 +36,8 @@
 
 extern dm_lwm2m_client_state_e dm_state;
 
-struct dm_lwm2m_context_s test_data1 = { {"192.168.1.152", "5683", false}, {300} };
-struct dm_lwm2m_context_s test_data2 = { {"192.168.1.152", "123AB", false}, {300} };
+struct dm_lwm2m_context_s test_data1 = { {CONFIG_UTC_DM_SERVER_IPADDR, CONFIG_UTC_DM_SERVER_PORT, false}, {300} };
+struct dm_lwm2m_context_s test_data2 = { {CONFIG_UTC_DM_SERVER_IPADDR, "123AB", false}, {300} };
 
 /**
 * @testcase             utc_dm_lwm2m_start_client_p
index bf1e950..1dbe2d1 100644 (file)
@@ -86,8 +86,7 @@ int wifiAutoConnectInit(void)
        dm_conn_register_linkup_cb(linkUpEvent);
 
        if (WiFiIsConnected(&result, NULL) != SLSI_STATUS_SUCCESS) {
-               printf("failed to WifiIsConnected\n");
-               return -1;
+               printf("Wifi Is not Connected\n");
        }
 
        if (result > 0) {