Review of PCH test cases

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 816d3ef8
......@@ -2016,7 +2016,7 @@ module OneM2M_Functions {
mccPort.send(f_getMsgOutPrimitive(m_request(valueof(p_requestPrimitive))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, mw_primitiveContentNotification(mw_contentNotification_any)))) -> value vc_response {
[] mccPort.receive(mw_response(mw_responseNotify(int2000))) -> value vc_response {
tc_ac.stop;
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
......@@ -3317,9 +3317,15 @@ module OneM2M_Functions {
if (p_resourceType == int1) {//AccessControlPolicy
}
if (p_resourceType == int9) {//group
} else if (p_resourceType == int2) {//AE
if(ispresent(p_request.primitiveContent.aE.pointOfAccess)) {
p_request.primitiveContent.aE.requestReachability := true;
}
} else if (p_resourceType == int16) {//remoteCSE
if(ispresent(p_request.primitiveContent.remoteCSE.pointOfAccess)) {
p_request.primitiveContent.remoteCSE.requestReachability := true;
}
} else if (p_resourceType == int9) {//group
if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){
if ((p_parentIndex == -1) and (isbound(vc_aeAuxIndex))){
p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[vc_aeAuxIndex].resource)};
......
......@@ -1507,7 +1507,15 @@ module OneM2M_Templates {
* @desc Base NOTIFY request primitive
*/
template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, Notification p_notification) modifies m_notify := {
primitiveContent := {notification := p_notification}
primitiveContent := {notification := p_notification},
requestExpirationTimestamp := {alt_1 := 10000}//Needed for polling
};
/**
* @desc Base NOTIFY request primitive carrying a responsePrimitive
*/
template RequestPrimitive m_notifyResponsePrimitive(XSD.ID p_resourceAddress, ResponsePrimitive p_responsePrimitive) modifies m_notify := {
primitiveContent := {responsePrimitive := p_responsePrimitive}
};
/**
......@@ -1621,6 +1629,10 @@ module OneM2M_Templates {
template PrimitiveContent m_primitiveContentRemoteCSE(template RemoteCSE_optional p_remoteCSE) := {
remoteCSE := p_remoteCSE
}
template PrimitiveContent m_primitiveContentResponsePrimitive(template ResponsePrimitive p_responsePrimitive) := {
responsePrimitive := p_responsePrimitive
}
template PrimitiveContent mw_primitiveContent := ?;
......@@ -1653,7 +1665,7 @@ module OneM2M_Templates {
pointOfAccess := omit, //{"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := omit,//O
nodeLink := p_nodeLink,//NP
requestReachability := true,//M
requestReachability := false,//M
contentSerialization := omit,//O
e2eSecInfo := omit, //O TODO Check whether it is optional or mandatory for create operation
supportedReleaseVersions := {"2a"}, //M
......@@ -1747,7 +1759,7 @@ module OneM2M_Templates {
pointOfAccess := p_poaList, //O {"http://127.0.0.1:1400/monitor"},//{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := omit,//O
nodeLink := omit,//NP
requestReachability := true,//M
requestReachability := false,//M
contentSerialization := omit,//O
e2eSecInfo := omit, //O
supportedReleaseVersions := {"2a"}, //M
......@@ -2457,7 +2469,7 @@ module OneM2M_Templates {
cSE_ID := valueof(p_cSE_ID),//M
m2M_Ext_ID := omit,//O
trigger_Recipient_ID := omit,//O
requestReachability := true,//M
requestReachability := false,//M
nodeLink := omit,//O
triggerReferenceNumber := omit,//O
e2eSecInfo := omit,//O
......@@ -5030,7 +5042,22 @@ module OneM2M_Templates {
vendorInformation := omit
};
template ResponsePrimitive mw_responseNotify(ResponseStatusCode p_statusCode) := {
responseStatusCode := p_statusCode,
requestIdentifier := ?,
primitiveContent := omit,
to_ := *,
from_ := *,
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *,
contentStatus := *,
contentOffset := *,
assignedTokenIdentifiers := *,
tokenRequestInformation := *,
releaseVersionIndicator := ?,
vendorInformation := *
};
group InfoPortTemplates {
......
......@@ -9013,262 +9013,6 @@ module OneM2M_PermutationFunctions {
group PollingChannel {
function f_CSE_PCH_001() runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
[] mcaPort.receive(mw_response(mw_responsePollingResponse)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content not carrying request targeting AE1");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
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_deleteResources();
// Tear down
f_cf01Down();
} // end TC_CSE_PCH_001
function f_CSE_PCH_002() runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
[] mcaPort.receive(mw_response(mw_responsePollingResponse)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content not carrying request targeting AE1");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
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_deleteResources();
// Tear down
f_cf01Down();
} // end TC_CSE_PCH_002
function f_CSE_PCH_003() runs on AeSimu {
//Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
[] mcaPort.receive(mw_response(mw_responsePollingResponse)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content not carrying request targeting AE1");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
mcaPort.send(f_getMsgOutPrimitive(m_request(v_requestNotify)));
//Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
}
function f_CSE_PCH_004() runs on CseSimu {
//Local variables
var integer v_localResourceIndex := -1;
var MsgIn v_request_req1, v_request_req3;
var RequestPrimitive v_request_req2;
var ResponsePrimitive v_response_rsp1;
var template UtTriggerPrimitive v_utRequest1 := m_utCreatePollingChannel;
var template UtTriggerPrimitive v_utRequest2;
var charstring v_action1 := "Please, send a Polling Channel CREATE request";
var charstring v_action2 := "Please, send a Polling request (Retrieve PollingChannelURI request)";
var RequestPrimitive v_requestNotify;
//Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
//send triggering primitive to SUT
v_localResourceIndex := f_cse_createLocalResource(v_utRequest1,v_action1);
f_checkCseSimuStatus();
//Trigger IUT for sending a polling request (req1)
v_utRequest2 := valueof(m_utRetrievePollingChannelUri(f_getLocalResourceAddress(v_localResourceIndex) & "/" & c_resourceShortNamePollingChannelUri));
f_sendUtPrimitive(v_utRequest2,v_action2);
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(mw_retrieve(f_getResourceAddress(v_localResourceIndex) & "/" & c_resourceShortNamePollingChannelUri))) -> value v_request_req1 {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Polling request received successfuly");
v_response_rsp1 := valueof(m_responsePrimitive(int2000,v_request_req1.primitive.requestPrimitive.requestIdentifier));
v_response_rsp1.from_ := PX_CSE1_ID;
v_response_rsp1.to_ := v_request_req1.primitive.requestPrimitive.from_;
//Put in the primitiveContent a Notify request (req2) (simulated) from another node CSE
v_request_req2 := valueof(m_notify(f_getResourceAddress(vc_remoteCseIndex)));
v_response_rsp1.primitiveContent := { requestPrimitive := v_request_req2 };
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response_rsp1)));
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel");
}
}
f_checkCseSimuStatus();
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value v_request_req3 {
tc_ac.stop;
//Check that primitiveContent carries the response to req2 (resp2)
if(v_request_req3.primitive.requestPrimitive.primitiveContent.responsePrimitive.requestIdentifier == v_request_req2.requestIdentifier) {
setverdict(pass, __SCOPE__ & ": NOTIFY request received carrying response (rsp2) to the Notify request (req2)");
} else {
setverdict(fail, __SCOPE__ & ": NOTIFY request received not carryng the expected response (rsp2) to the Notify request (req2)");
}
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No message while expecting NOTIFY request");
}
}
//Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}
function f_CSE_PCH_005(template RequestPrimitive p_requestPrimitive) runs on AeSimu {
//Local variables
......
......@@ -12559,9 +12559,9 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_acpAuxIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
var RequestPrimitive v_req1;
var MsgIn v_resp1;
var RequestPrimitive v_req2;
// Test control
......@@ -12580,16 +12580,16 @@ module OneM2M_Testcases_CSE_Release_2 {
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1)));
v_requestNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification));
v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
vc_cse1.start(f_cse_notifyProcedure_notify(v_req2));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_req2))) -> value v_resp1 {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
......@@ -12635,7 +12635,7 @@ module OneM2M_Testcases_CSE_Release_2 {
function f_CSE_PCH_002() runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_aeIndex, v_acpAuxIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
......@@ -12652,11 +12652,13 @@ module OneM2M_Testcases_CSE_Release_2 {
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_acpAuxIndex := f_cse_preamble_createAcpAux();
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
v_requestNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
......@@ -12710,37 +12712,44 @@ module OneM2M_Testcases_CSE_Release_2 {
function f_CSE_PCH_003() runs on AeSimu {
//Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
var integer v_aeIndex, v_acpAuxIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_req1;
var RequestPrimitive v_req2;
var RequestPrimitive v_req3;
var MsgIn v_resp1, v_resp3;
var ResponsePrimitive v_resp2;//Response to a Notify Request
// Test control
// Test control
// Test component configuration
f_cf02Up();
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Test adapter configuration
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_acpAuxIndex := f_cse_preamble_createAcpAux();
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1)));
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
//v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification));
v_req2 := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
v_req2.requestExpirationTimestamp := {alt_1 := 15000};
vc_cse1.start(f_cse_notifyProcedure_notify(v_req2));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_req2))) -> value v_resp1 {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
......@@ -12759,9 +12768,37 @@ module OneM2M_Testcases_CSE_Release_2 {
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
}
f_checkAeSimuStatus();
//Send response in any case
v_resp2 := valueof(m_responseNotification(int2000, omit));
v_resp2.requestIdentifier := v_resp1.primitive.responsePrimitive.primitiveContent.requestPrimitive.requestIdentifier;
v_req3 := valueof(m_notifyResponsePrimitive(f_getResourceAddress(v_resourceIndex) & "/" & c_resourceShortNamePollingChannelUri, v_resp2));
v_req3.from_ := f_getOriginator(v_aeIndex);
mcaPort.send(f_getMsgOutPrimitive(m_request(v_req3)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_requestNotify)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_resp3 {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__&":INFO: Error while performing notification");
}
[] mcaPort.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__&":INFO: Unexpected message received");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__&":INFO: No answer while performing notification");
}
}
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
//Postamble
f_cse_postamble_deleteResources();
......
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