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
...@@ -19,6 +19,7 @@ module OneM2M_Pics { ...@@ -19,6 +19,7 @@ module OneM2M_Pics {
*/ */
modulepar boolean PICS_ACP_SUPPORT := true; 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_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true; modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
......
...@@ -3715,6 +3715,11 @@ module OneM2M_Templates { ...@@ -3715,6 +3715,11 @@ module OneM2M_Templates {
primitiveContent := {subscription := m_contentSubscription} 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) := { template (value) UtTriggerPrimitive m_utRetrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
operation := int2, operation := int2,
to_ := p_targetResourceAddress, to_ := p_targetResourceAddress,
......
...@@ -1871,6 +1871,10 @@ module OneM2M_Testcases_CSE { ...@@ -1871,6 +1871,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_001 }//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 { group g_CSE_REG_RET_002 {
testcase TC_CSE_REG_RET_002_CST() runs on Tester system CseSystem { testcase TC_CSE_REG_RET_002_CST() runs on Tester system CseSystem {
...@@ -1879,6 +1883,7 @@ module OneM2M_Testcases_CSE { ...@@ -1879,6 +1883,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
v_contentResponse.cSEBase.cseType := ?;
v_ae1.start(f_CSE_REG_RET_002(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_002(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -1891,6 +1896,7 @@ module OneM2M_Testcases_CSE { ...@@ -1891,6 +1896,7 @@ module OneM2M_Testcases_CSE {
v_contentResponse.cSEBase := mw_contentCSEBase_rc1; 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.start(f_CSE_REG_RET_002(v_contentResponse));
v_ae1.done; v_ae1.done;
} }
...@@ -1910,17 +1916,12 @@ module OneM2M_Testcases_CSE { ...@@ -1910,17 +1916,12 @@ module OneM2M_Testcases_CSE {
// Preamble // Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 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; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop; 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"); setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
} else {
setverdict(fail, __SCOPE__ & ": Error: Unable to retrieve attribute");
}
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop; tc_ac.stop;
...@@ -1948,6 +1949,11 @@ module OneM2M_Testcases_CSE { ...@@ -1948,6 +1949,11 @@ module OneM2M_Testcases_CSE {
} //end g_CSE_REG_RET_002 } //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 { testcase TC_CSE_REG_RET_003() runs on AeSimu system CseSystem {
// Local variables // Local variables
var MsgIn v_response; var MsgIn v_response;
...@@ -2000,6 +2006,11 @@ module OneM2M_Testcases_CSE { ...@@ -2000,6 +2006,11 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_003 }//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 { group g_CSE_REG_RET_004 {
testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem { testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem {
...@@ -2008,6 +2019,7 @@ module OneM2M_Testcases_CSE { ...@@ -2008,6 +2019,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.labels := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -2019,6 +2031,7 @@ module OneM2M_Testcases_CSE { ...@@ -2019,6 +2031,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.appName := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -2030,6 +2043,7 @@ module OneM2M_Testcases_CSE { ...@@ -2030,6 +2043,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.pointOfAccess := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -2041,6 +2055,7 @@ module OneM2M_Testcases_CSE { ...@@ -2041,6 +2055,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.nodeLink := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -2052,6 +2067,7 @@ module OneM2M_Testcases_CSE { ...@@ -2052,6 +2067,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE := mw_contentAeBase;
v_contentResponse.aE.contentSerialization := ?;
v_ae1.start(f_CSE_REG_RET_004(v_contentResponse)); v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
v_ae1.done; v_ae1.done;
...@@ -2077,19 +2093,7 @@ module OneM2M_Testcases_CSE { ...@@ -2077,19 +2093,7 @@ module OneM2M_Testcases_CSE {
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop; 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"); 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");
}
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop; tc_ac.stop;
...@@ -2118,7 +2122,7 @@ module OneM2M_Testcases_CSE { ...@@ -2118,7 +2122,7 @@ module OneM2M_Testcases_CSE {
} //end g_CSE_REG_RET_004 } //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 { testcase TC_CSE_REG_RET_005() runs on AeSimu system CseSystem {
...@@ -2145,25 +2149,14 @@ module OneM2M_Testcases_CSE { ...@@ -2145,25 +2149,14 @@ module OneM2M_Testcases_CSE {
// Test Body // Test Body
v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
v_contentResponse.cSEBase.cseType := int1; v_contentResponse.cSEBase.cseType := int1;
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))));//TODO Maybe PX_SUPER_AE_ID
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop; 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)"); 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");
}
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop; tc_ac.stop;
...@@ -2190,6 +2183,10 @@ module OneM2M_Testcases_CSE { ...@@ -2190,6 +2183,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_BV_005 }//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 { testcase TC_CSE_REG_RET_006() runs on CseSimu system CseSystem {
//Local variables //Local variables
//Local variables //Local variables
...@@ -2206,6 +2203,7 @@ module OneM2M_Testcases_CSE { ...@@ -2206,6 +2203,7 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration // Test adapter configuration
// Preamble // Preamble
if(PICS_IN_CSE){
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
...@@ -2234,6 +2232,36 @@ module OneM2M_Testcases_CSE { ...@@ -2234,6 +2232,36 @@ module OneM2M_Testcases_CSE {
} }
} }
} 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 // Postamble
f_cse_postamble_deleteResourcesCSE(); f_cse_postamble_deleteResourcesCSE();
...@@ -2242,6 +2270,10 @@ module OneM2M_Testcases_CSE { ...@@ -2242,6 +2270,10 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_006 }//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 { group g_CSE_REG_RET_007 {
testcase TC_CSE_REG_RET_007_LBL() runs on Tester system CseSystem { testcase TC_CSE_REG_RET_007_LBL() runs on Tester system CseSystem {
...@@ -2250,6 +2282,7 @@ module OneM2M_Testcases_CSE { ...@@ -2250,6 +2282,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.labels := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse)); v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done; v_cse1.done;
...@@ -2261,6 +2294,7 @@ module OneM2M_Testcases_CSE { ...@@ -2261,6 +2294,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.cseType := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse)); v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done; v_cse1.done;
...@@ -2272,6 +2306,7 @@ module OneM2M_Testcases_CSE { ...@@ -2272,6 +2306,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.pointOfAccess := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse)); v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done; v_cse1.done;
...@@ -2283,6 +2318,7 @@ module OneM2M_Testcases_CSE { ...@@ -2283,6 +2318,7 @@ module OneM2M_Testcases_CSE {
var template PrimitiveContent v_contentResponse; var template PrimitiveContent v_contentResponse;
v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
v_contentResponse.remoteCSE.nodeLink := ?;
v_cse1.start(f_CSE_REG_RET_007(v_contentResponse)); v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
v_cse1.done; v_cse1.done;
...@@ -2302,25 +2338,40 @@ module OneM2M_Testcases_CSE { ...@@ -2302,25 +2338,40 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration // Test adapter configuration
// Preamble // Preamble
if(PICS_IN_CSE){
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
tc_ac.start; tc_ac.start;
alt { alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
tc_ac.stop; 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"); setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
} else {
setverdict(fail, __SCOPE__ & ": Error: Unable to retrieve attribute");
} }
} else { [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
setverdict(fail, __SCOPE__ & ": Error: Primitive content not available"); 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");
} }
} }
} 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 { [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code"); setverdict(fail, __SCOPE__ & ": Wrong response status code");
...@@ -2337,6 +2388,7 @@ module OneM2M_Testcases_CSE { ...@@ -2337,6 +2388,7 @@ module OneM2M_Testcases_CSE {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
} }
} }
}
//Postamble //Postamble
f_cse_postamble_deleteResourcesCSE(); f_cse_postamble_deleteResourcesCSE();
...@@ -2416,6 +2468,44 @@ module OneM2M_Testcases_CSE { ...@@ -2416,6 +2468,44 @@ module OneM2M_Testcases_CSE {
}//end TC_CSE_REG_RET_008 }//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 } //end group Retrieve
group Update{ group Update{
...@@ -2470,17 +2560,21 @@ module OneM2M_Testcases_CSE { ...@@ -2470,17 +2560,21 @@ module OneM2M_Testcases_CSE {
}; //end TC_CSE_REG_UPD_BI_001 }; //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 { group g_CSE_REG_UPD_002 {
testcase TC_CSE_REG_UPD_002_ET() runs on Tester system CseSystem { testcase TC_CSE_REG_UPD_002_ET() runs on Tester system CseSystem {
// Local variables // Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"expirationTime", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; 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; v_cse1.done;
} }
...@@ -2488,12 +2582,11 @@ module OneM2M_Testcases_CSE { ...@@ -2488,12 +2582,11 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_LBL() runs on Tester system CseSystem { testcase TC_CSE_REG_UPD_002_LBL() runs on Tester system CseSystem {
// Local variables // Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"labels", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; 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; v_cse1.done;
} }
...@@ -2501,12 +2594,11 @@ module OneM2M_Testcases_CSE { ...@@ -2501,12 +2594,11 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_POA() runs on Tester system CseSystem { testcase TC_CSE_REG_UPD_002_POA() runs on Tester system CseSystem {
// Local variables // Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"pointofAccess", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; 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; v_cse1.done;
} }
...@@ -2514,17 +2606,28 @@ module OneM2M_Testcases_CSE { ...@@ -2514,17 +2606,28 @@ module OneM2M_Testcases_CSE {
testcase TC_CSE_REG_UPD_002_NL() runs on Tester system CseSystem { testcase TC_CSE_REG_UPD_002_NL() runs on Tester system CseSystem {
// Local variables // Local variables
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
const AttributeAux c_Attribute := {"nodeLink", omit};
var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; 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; 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 //Local variables
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
...@@ -2547,22 +2650,19 @@ module OneM2M_Testcases_CSE { ...@@ -2547,22 +2650,19 @@ module OneM2M_Testcases_CSE {
alt { alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { [] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute " & p_Attribute.name); setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute ");
f_setResource(v_request.primitiveContent,int16);
} }
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); 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 { [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute " & p_Attribute.name); setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute ");
f_setResource(v_request.primitiveContent,int16);
} }
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop; 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 { [] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE");
...@@ -2651,7 +2751,13 @@ module OneM2M_Testcases_CSE { ...@@ -2651,7 +2751,13 @@ module OneM2M_Testcases_CSE {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; 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 // Test control
if(not(PICS_MN_CSE)) {
setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
stop;
}
// Test component configuration // Test component configuration
f_cf04Up(); f_cf04Up();
...@@ -2659,7 +2765,12 @@ module OneM2M_Testcases_CSE { ...@@ -2659,7 +2765,12 @@ module OneM2M_Testcases_CSE {
// Test adapter configuration // Test adapter configuration
// Preamble // 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 // Test Body
v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive);
...@@ -2700,128 +2811,6 @@ module OneM2M_Testcases_CSE { ...@@ -2700,128 +2811,6 @@ module OneM2M_Testcases_CSE {
}//end f_CSE_REG_UPD_003 }//end f_CSE_REG_UPD_003
} //end g_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 }// end group Update
group Delete{ group Delete{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment