Skip to content
Snippets Groups Projects
Commit 9dbdee9e authored by Antal Wu-Hen-Chang's avatar Antal Wu-Hen-Chang
Browse files

DTLS testcase added with bugfixes


Signed-off-by: default avatarAntal Wu-Hen-Chang <antal.wu-hen-chang@ericsson.com>
parent 5f8aea27
No related branches found
No related tags found
No related merge requests found
......@@ -59,8 +59,12 @@ module IFW_CoAP_Peer_Functions
);
f_checkResult(vl_result);
*/
ctx.connId := vl_result.connId;
if (isbound(vl_result.connId))
{
ctx.connId := vl_result.connId;
}
ctx.cherryPickOptionsCheck := tsp_cherryPickOptionCheck;
log(%definitionId, " finished");
......@@ -78,7 +82,8 @@ module IFW_CoAP_Peer_Functions
var f_IPL4_getMsgLen vl_f := refers(f_COAP_getMsgLength);
f_IPL4_setGetMsgLen(IPL4_PCO, vl_result.connId, vl_f, {});
ctx.connId_listen := vl_result.connId;
ctx.connId_listen := vl_result.connId;
ctx.connId := vl_result.connId;
}
function f_CoAP_Peer_connect() runs on IFW_COAP_CT
......
......@@ -17,11 +17,13 @@
module Lwm2mTestSuite
{
import from IoT_FT_Framework_Definitions all;
import from IoT_FT_Framework_Functions all;
import from IoT_FT_Framework_Functions all;
import from IFW_CoAP_Peer_Definitions all;
import from IFW_CoAP_Peer_TestSteps all;
import from CoAP_Types all;
import from LightweightM2M_Types all;
import from LightweightM2M_CoAP_Binding all;
import from IFW_Common all;
testcase tc_client_LightweightM2M_10_int_101_102_103_regdereg() runs on IFW_MAIN_CT
{
......@@ -43,6 +45,8 @@ module Lwm2mTestSuite
}
f_IFW_CoapPeer_saveLocationPath(client);
f_IFW_wait(3.0);
f_IFW_CoapPeer_setMessageToSend(client, valueof(t_client_LightweightM2M_10_int_102_update));
f_IFW_CoapPeer_addUriPath(client);
f_IFW_CoapPeer_send(client);
......@@ -53,6 +57,8 @@ module Lwm2mTestSuite
setverdict(fail); stop;
}
f_IFW_wait(3.0);
f_IFW_CoapPeer_setMessageToSend(client, valueof(t_client_LightweightM2M_10_int_103_deregister));
f_IFW_CoapPeer_addUriPath(client);
f_IFW_CoapPeer_send(client);
......@@ -174,6 +180,64 @@ module Lwm2mTestSuite
options := {},
payload := omit
}
testcase tc_client_LightweightM2M_10_int_101_102_103_regdereg_dtls() runs on IFW_MAIN_CT
{
setverdict(pass);
var integer client := f_IFW_addComponent(COAP_PEER, "client");
f_IFW_CoapPeer_setRemote(client, "server");
// Setting DTLS parameters
var CoapContext v_ctx;
f_IFW_CoapPeer_getContext(client, v_ctx);
v_ctx.connectProtocol := { dtls := { udp := {} } };
v_ctx.connectOptions[sizeof(v_ctx.connectOptions)] := {
psk_options := {
psk_identity := "client1",
psk_identity_hint := omit,
psk_key := "01020304"
}
}
f_IFW_CoapPeer_setContext(client, v_ctx);
f_IFW_initComponents();
f_IFW_CoapPeer_setMessageToSend(client, valueof(t_client_LightweightM2M_10_int_101_register));
f_IFW_CoapPeer_send(client);
f_IFW_CoapPeer_receive(client);
if (not f_IFW_CoapPeer_check(client, t_client_LightweightM2M_10_int_101_registered))
{
setverdict(fail); stop;
}
f_IFW_CoapPeer_saveLocationPath(client);
f_IFW_wait(3.0);
f_IFW_CoapPeer_setMessageToSend(client, valueof(t_client_LightweightM2M_10_int_102_update));
f_IFW_CoapPeer_addUriPath(client);
f_IFW_CoapPeer_send(client);
f_IFW_CoapPeer_receive(client);
if (not f_IFW_CoapPeer_check(client, t_client_LightweightM2M_10_int_102_updated))
{
setverdict(fail); stop;
}
f_IFW_wait(3.0);
f_IFW_CoapPeer_setMessageToSend(client, valueof(t_client_LightweightM2M_10_int_103_deregister));
f_IFW_CoapPeer_addUriPath(client);
f_IFW_CoapPeer_send(client);
f_IFW_CoapPeer_receive(client);
if (not f_IFW_CoapPeer_check(client, t_client_LightweightM2M_10_int_103_deregistered))
{
setverdict(fail); stop;
}
}
testcase tc_client_LightweightM2M_10_int_101_102_103_regdereg_lwm2mPDU() runs on IFW_MAIN_CT
{
......@@ -286,6 +350,6 @@ module Lwm2mTestSuite
{
execute(tc_client_LightweightM2M_10_int_101_102_103_regdereg());
execute(tc_client_LightweightM2M_10_int_101_102_103_regdereg_lwm2mPDU());
//execute(tc_json_encdec());
execute(tc_json_encdec());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment