HTTP_Client: connect test step added
Signed-off-by: eantwuh <antal.wu-hen-chang@ericsson.com>
diff --git a/IFW_HTTP_Client_Functions.ttcn b/IFW_HTTP_Client_Functions.ttcn
index d95ea4a..d904305 100644
--- a/IFW_HTTP_Client_Functions.ttcn
+++ b/IFW_HTTP_Client_Functions.ttcn
@@ -57,6 +57,20 @@
log(%definitionId, " finished");
}
+ function f_HTTP_Client_connect() runs on IFW_HTTP_Client_CT
+ {
+ log(%definitionId, " started");
+ var Result vl_result;
+
+ log("Connecting the socket to the remote");
+ vl_result := f_IPL4_connect(IPL4_PCO, ctx.remoteHost, ctx.remotePort, ctx.localHost, ctx.localPort, -1, {tcp := {}}, {{reuseAddress := {enable := true}}});
+ f_checkResult(vl_result);
+ ctx.connId := vl_result.connId;
+ log("ctx.connId: ", ctx.connId);
+
+ log(%definitionId, " finished");
+ }
+
function f_HTTP_Client_cleanUp() runs on IFW_HTTP_Client_CT
{
log(%definitionId, " started");
diff --git a/IFW_HTTP_Client_TestSteps.ttcn b/IFW_HTTP_Client_TestSteps.ttcn
index b2d6d43..722305e 100644
--- a/IFW_HTTP_Client_TestSteps.ttcn
+++ b/IFW_HTTP_Client_TestSteps.ttcn
@@ -49,6 +49,19 @@
return true;
}
+ function f_IFW_HttpClient_connect(in integer p_clientIdx) runs on IFW_MAIN_CT
+ return boolean
+ {
+ var IFW_HTTP_Client_CT v_client := httpClients[p_clientIdx];
+ if (v_client == null) { log("IFW: No http client found"); return false; }
+ f_isRunningGuard(v_client);
+
+ v_client.start(f_HTTP_Client_connect());
+ v_client.done;
+
+ return true;
+ }
+
function f_IFW_HttpClient_setRemote(in integer p_clientIdx, in charstring p_remoteAddrId) runs on IFW_MAIN_CT
return boolean
{