Skip to content
Snippets Groups Projects
Commit a065939d authored by acverdugo's avatar acverdugo
Browse files

Merge branch 'STF531-REG-TCs' of https://git.onem2m.org/TST/ATS into STF531-REG-TCs

# Conflicts:
#	OneM2M_Testcases_CSE.ttcn
parents 407e3e11 e67bca78
No related branches found
No related tags found
1 merge request!24STF531 REG TCs
......@@ -18,7 +18,8 @@ module OneM2M_Pics {
* @see oneM2M TS-0017 A.5.5.1/1
*/
modulepar boolean PICS_ACP_SUPPORT := true;
modulepar boolean PICS_IN_CSE := true;
modulepar boolean PICS_IN_CSE := true;
modulepar boolean PICS_MN_CSE := true;
modulepar boolean PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
......
......@@ -3715,6 +3715,11 @@ module OneM2M_Templates {
primitiveContent := {subscription := m_contentSubscription}
}
template (value) UtTriggerPrimitive m_utCreateRemoteCSE modifies m_utCreate := {
requestIdentifier := testcasename() & "-m_utCreateRemoteCSE" & f_rnd(1, 1000000),
resourceType := int16
}
template (value) UtTriggerPrimitive m_utRetrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
operation := int2,
to_ := p_targetResourceAddress,
......
......@@ -1871,6 +1871,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_001
/**
* @desc Check that the IUT accepts a retrieval request of <CSEBase> resource with the optional ATTRIBUTE
*
*/
group g_CSE_REG_RET_002 {
testcase TC_CSE_REG_RET_002_CST() runs on Tester system CseSystem {
......@@ -1879,6 +1883,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
v_contentResponse.cSEBase.cseType := ?;
v_ae1.start(f_CSE_REG_RET_002(v_contentResponse));
v_ae1.done;
......@@ -1890,7 +1895,8 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
v_contentResponse.cSEBase.nodeLink := ?;
v_contentResponse.cSEBase.nodeLink := ?;
v_ae1.start(f_CSE_REG_RET_002(v_contentResponse));
v_ae1.done;
}
......@@ -1910,17 +1916,12 @@ module OneM2M_Testcases_CSE {
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop;
if ((ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.nodeLink))){
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
} else {
setverdict(fail, __SCOPE__ & ": Error: Unable to retrieve attribute");
}
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
......@@ -1948,6 +1949,11 @@ module OneM2M_Testcases_CSE {
} //end g_CSE_REG_RET_002
/**
* @desc Check that the IUT accepts a retrieval request of <AE> resource with attributes multiplicity equals to 1
*
*/
testcase TC_CSE_REG_RET_003() runs on AeSimu system CseSystem {
// Local variables
var MsgIn v_response;
......@@ -2000,6 +2006,11 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_003
/**
* @desc Check that the IUT accepts a retrieval request of <AE> resource with optional ATTRIBUTE
*
*/
group g_CSE_REG_RET_004 {
testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem {
......@@ -2008,6 +2019,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.labels := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done;
......@@ -2019,6 +2031,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.appName := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done;
......@@ -2030,6 +2043,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.pointOfAccess := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done;
......@@ -2041,6 +2055,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.nodeLink := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done;
......@@ -2052,6 +2067,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.contentSerialization := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done;
......@@ -2077,19 +2093,7 @@ module OneM2M_Testcases_CSE {
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop;
if (ispresent(v_response.primitive.responsePrimitive.primitiveContent)){
if ((ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.appName)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.nodeLink)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.labels)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.pointOfAccess)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.contentSerialization)) ){
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
} else {
setverdict(fail, __SCOPE__ & ": Error: Unable to retrieve attribute");
}
} else {
setverdict(fail, __SCOPE__ & ": Error: Primitive content not available");
}
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
......@@ -2118,7 +2122,7 @@ module OneM2M_Testcases_CSE {
} //end g_CSE_REG_RET_004
/**
* @desc Check that if the IUT is IN-CSE, it accepts an retrieval request of <CSEBase> resource and returns the cseType attribute. cseType Attribute is mandatory for IN-CSE
* @desc Check that the IUT accepts a retrieval request of <CSEBase> resource including the cseType attribute
*
*/
testcase TC_CSE_REG_RET_005() runs on AeSimu system CseSystem {
......@@ -2145,25 +2149,14 @@ module OneM2M_Testcases_CSE {
// Test Body
v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
v_contentResponse.cSEBase.cseType := int1;
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
if (ispresent(v_response.primitive.responsePrimitive.primitiveContent)) {
if (ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)){
if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType==int1){
setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)");
}else{
setverdict(fail, __SCOPE__ & ": Error, cseType attribute is set to " & int2str(enum2int(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)));
}
}else{
setverdict(fail, __SCOPE__ & ": Error, cseType attribute is not present");
}
} else {
setverdict(fail, __SCOPE__ & ": Error, Primitive content not available");
}
setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
......@@ -2190,6 +2183,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_BV_005
/**
* @desc Check that the IUT accepts a retrieval request of <remoteCSE> resource
*
*/
testcase TC_CSE_REG_RET_006() runs on CseSimu system CseSystem {
//Local variables
//Local variables
......@@ -2206,33 +2203,64 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
if(PICS_IN_CSE){
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
} else if (PICS_MN_CSE) {
vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase);
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
......@@ -2242,6 +2270,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_006
/**
* @desc Check that the IUT accepts an retrieval request of <remoteCSE> resource with optional ATTRIBUTE
*
*/
group g_CSE_REG_RET_007 {
testcase TC_CSE_REG_RET_007_LBL() runs on Tester system CseSystem {
......@@ -2250,6 +2282,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.labels := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done;
......@@ -2261,6 +2294,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.cseType := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done;
......@@ -2272,6 +2306,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.pointOfAccess := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done;
......@@ -2283,6 +2318,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.nodeLink := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done;
......@@ -2302,39 +2338,55 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop;
if (ispresent(v_response.primitive.responsePrimitive.primitiveContent)){
if ((ispresent(v_response.primitive.responsePrimitive.primitiveContent.remoteCSE.labels)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.remoteCSE.nodeLink)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.remoteCSE.cseType)) or
(ispresent(v_response.primitive.responsePrimitive.primitiveContent.remoteCSE.pointOfAccess))){
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
} else {
setverdict(fail, __SCOPE__ & ": Error: Unable to retrieve attribute");
}
} else {
setverdict(fail, __SCOPE__ & ": Error: Primitive content not available");
}
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
if(PICS_IN_CSE){
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
} else if (PICS_MN_CSE){
vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase);
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
}
......@@ -2415,6 +2467,44 @@ module OneM2M_Testcases_CSE {
f_cf01Down();
}//end TC_CSE_REG_RET_008
testcase TC_CSE_REG_RET_009() runs on CseSimu system CseSystem {
//Local variables
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var ResourceType v_resourceType := int16; //remoteCSE
var template PrimitiveContent v_contentResponse;
var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
// 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_cf04Up();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase);
//Send Trigger Message
v_utRequest.to_ := f_getResourceAddress();
v_utRequest.from_ := "UNINITIALIZED";
f_sendUtPrimitive(v_utRequest);
tc_ac.start;
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
}//end TC_CSE_REG_RET_009
} //end group Retrieve
......@@ -2470,17 +2560,21 @@ module OneM2M_Testcases_CSE {
}; //end TC_CSE_REG_UPD_BI_001
/**
* @desc Check that the IUT accepts an update request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE.
*
*/
group g_CSE_REG_UPD_002 {
testcase TC_CSE_REG_UPD_002_ET() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"expirationTime", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345";
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest, c_Attribute));
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest));
v_cse1.done;
}
......@@ -2488,12 +2582,11 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_LBL() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"labels", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"};
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest, c_Attribute));
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest));
v_cse1.done;
}
......@@ -2501,12 +2594,11 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_POA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"pointofAccess", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"};
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest, c_Attribute));
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest));
v_cse1.done;
}
......@@ -2514,17 +2606,28 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_NL() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"nodeLink", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID;
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest, c_Attribute));
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest));
v_cse1.done;
}
function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive, in AttributeAux p_Attribute) runs on CseSimu {
testcase TC_CSE_REG_UPD_002_RR() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.requestReachability := true;
v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest));
v_cse1.done;
}
function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive) runs on CseSimu {
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
......@@ -2547,22 +2650,19 @@ module OneM2M_Testcases_CSE {
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute " & p_Attribute.name);
f_setResource(v_request.primitiveContent,int16);
setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute ");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
f_setResource(v_request.primitiveContent,int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute " & p_Attribute.name);
f_setResource(v_request.primitiveContent,int16);
setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute ");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute" & p_Attribute.name);
setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE");
......@@ -2650,8 +2750,14 @@ module OneM2M_Testcases_CSE {
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var ResourceType v_resourceType := int16; //remoteCSE
var ResourceType v_resourceType := int16; //remoteCSE
var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
// 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_cf04Up();
......@@ -2659,7 +2765,12 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase);
//Send Trigger Message
v_utRequest.to_ := f_getResourceAddress();
v_utRequest.from_ := "UNINITIALIZED";
f_sendUtPrimitive(v_utRequest);
// Test Body
v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive);
......@@ -2700,128 +2811,6 @@ module OneM2M_Testcases_CSE {
}//end f_CSE_REG_UPD_003
} //end g_CSE_REG_UPD_003
group g_CSE_REG_UPD_004 {
testcase TC_CSE_REG_UPD_004_ET() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345";
v_cse1.start(f_CSE_REG_UPD_004(v_updateRequest, c_optionalAttribute));
v_cse1.done;
}
testcase TC_CSE_REG_UPD_004_LBL() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"};
v_cse1.start(f_CSE_REG_UPD_004(v_updateRequest, c_optionalAttribute));
v_cse1.done;
}
testcase TC_CSE_REG_UPD_004_POA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_optionalAttribute := {"pointofAccess", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"};
v_cse1.start(f_CSE_REG_UPD_004(v_updateRequest, c_optionalAttribute));
v_cse1.done;
}
testcase TC_CSE_REG_UPD_004_NL() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_optionalAttribute := {"nodeLink", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID;
v_cse1.start(f_CSE_REG_UPD_004(v_updateRequest, c_optionalAttribute));
v_cse1.done;
}
testcase TC_CSE_REG_UPD_004_RR() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_optionalAttribute := {"requestReachability", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.requestReachability := true;
v_cse1.start(f_CSE_REG_UPD_004(v_updateRequest, c_optionalAttribute));
v_cse1.done;
}
function f_CSE_REG_UPD_004(template RequestPrimitive p_requestPrimitive, in AttributeAux p_Attribute) runs on CseSimu {
// Local variables
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var ResourceType v_resourceType := int16; //remoteCSE
// Test control
// Test component configuration
f_cf04Up();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
// Test Body
v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive);
mccPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute " & p_Attribute.name);
f_setResource(v_request.primitiveContent,int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
f_setResource(v_request.primitiveContent,int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute " & p_Attribute.name);
f_setResource(v_request.primitiveContent,int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute" & p_Attribute.name);
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
}//end f_CSE_REG_UPD_004
} //end g_CSE_REG_UPD_004
}// end group Update
group Delete{
......
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