[ITC][rpc-port][Non-ACR][Add an exception handling] 69/206669/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 20 May 2019 23:43:28 +0000 (08:43 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Thu, 23 May 2019 02:36:03 +0000 (02:36 +0000)
When the proxy application tries to connect the stub application,
the app-control callback function is invoked with the "__K_RPC_PORT" extra
data. In this case, the stub application returns the function.

Change-Id: I25a107259415f75cb0c8c8836a99445726bd60d5
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
(cherry picked from commit 706a262665276f6f9b6a130642c80279158291f0)

src/itc/rpc-port/tct-rpc-port-native.c

index bce869d..2c9cfa3 100755 (executable)
@@ -40,6 +40,7 @@
 #include <sys/wait.h>
 #include <glib.h>
 #include <stdbool.h>
+#include <libgen.h>
 
 #include <service_app.h>
 #include <dlog.h>
@@ -59,6 +60,14 @@ static void app_control(app_control_h app_control, void *data)
 {
        char* pszGetTCName = NULL;
        int i=0, result=0, nRet=0;
+
+       nRet = app_control_get_extra_data(app_control, "__K_RPC_PORT", &pszGetTCName);
+       if (nRet == APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] RPC-Port Request = %s", basename(__FUNCTION__), __LINE__, pszGetTCName);
+               FREE_MEMORY_TC(pszGetTCName);
+               return;
+       }
+
        nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);
        if(nRet != APP_CONTROL_ERROR_NONE)
        {