Commit aa986c40 authored by Pramod Kulkarni's avatar Pramod Kulkarni

Rewriting TTCN code for REG/CRE/011 and REG/CRE/020

Signed-off-by: Pramod Kulkarni's avatarpkulkarni <pkulkarni75@gmail.com>
parent 32b986e1
......@@ -1518,7 +1518,48 @@ module OneM2M_Functions {
return v_matchResult;
} //end f_check_notificationContent
} //end f_check_notificationContent
/**
* @desc Handling message exchange for the AE Annc update
* @param p_responseStatusCode Response Status Code to be used for the response to the AE Annc request
* @verdict
*/
function f_cse_notifyProcedure_updateHandler() runs on CseSimu {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template Notification v_notificationRequest := mw_contentNotification_any;
//Preparation of Notification response to be sent
v_responsePrimitive := valueof(m_responseNotification(int2004, omit));
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value vc_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: Notification received");
}
[] mccPortIn.receive{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
stop;
}
}
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict == pass) {
mccPortIn.send(m_httpResponse(v_responsePrimitive));
} else {
v_responsePrimitive.responseStatusCode := int4000;
mccPortIn.send(m_httpResponse(v_responsePrimitive));
}
} //end f_cse_notifyProcedure_updateHandler
}// end of group NotificationFunctions
......
......@@ -1258,6 +1258,71 @@ module OneM2M_Testcases_CSE {
}; //end TC_CSE_REG_CRE_010
/**
* @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and asking an CSE relative AE_ID by indicating AE_ID_Stem with character ‘C’.
*
*/
testcase TC_CSE_REG_CRE_011() runs on AeSimu system CseSystem {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_cseBaseIndex := -1;
var ResourceType v_resourceType := int2;
// Test component configuration
f_cf01Up();
//Preamble
//Test Body
v_request := valueof(m_createAe(PX_APP_ID, omit, "C"));
v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
setverdict(pass, __SCOPE__ & ": AE successfully created.");
if(v_response.primitive.responsePrimitive.primitiveContent.aE.resourceID[0] == "C"){
setverdict(pass, __SCOPE__ & "Resource ID set correctly.");
} else {
setverdict(fail, __SCOPE__ & "Resource ID not set correctly.");
}
if(f_isScopeSpRelative(v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID)){
setverdict(pass, __SCOPE__ & "AE ID set correctly.");
} else {
setverdict(fail, __SCOPE__ & "AE ID not set correctly.");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating AE");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}
/**
* @desc Check that the IUT accepts an AE registration with the optional attribute OPTIONAL_ATTRIBUTE provided
*
*/
group g_CSE_REG_CRE_012 {
testcase TC_CSE_REG_CRE_012_AE_LBL() runs on Tester system CseSystem {
......@@ -1690,6 +1755,90 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_CRE_019
/**
* @desc Check that the IUT accepts a response from IN_CSE on the success update of AEAnnc during AE registration with preprovisioned SP_relative_AE_ID
*
*/
testcase TC_CSE_REG_CRE_020() runs on AeSimu system CseSystem {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var ResourceType v_resourceType := int2;
//Test control
if(not(PICS_MN_CSE)) {
setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
stop;
}
// Test component configuration
f_cf02Up();
//Preambule
vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
vc_cse1.done;
v_request := valueof(m_createAe(PX_APP_ID, omit, omit));
v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{
tc_ac.stop;
f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
setverdict(pass, __SCOPE__ & ": AE successfully created.");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating AE");
}
}
vc_cse1.start(f_cse_notifyProcedure_updateHandler());
vc_cse1.done;
//Test body
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
//continue to test the content
if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){
if (v_response.primitive.responsePrimitive.primitiveContent.aE.app_ID == PX_APP_ID){
setverdict(pass, __SCOPE__ & ": AE creation success.");
}else{
setverdict(fail, __SCOPE__ & ": Error in AE content.");
}
}else{
setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist");
}
}
[] mcaPort.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating AE");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
}; //end TC_CSE_REG_CRE_020
/**
* @desc Check that the IUT rejects the create request of <CSEBase> resource.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment