Commit 23efeabc authored by Abbas AHMAD's avatar Abbas AHMAD

Added All Protocol Biding related modifications

parent 0b23d86c
......@@ -45,6 +45,7 @@ module OneM2M_Functions {
if(p_auxiliaryAe2Required) {
vc_auxiliaryAe2Up := p_auxiliaryAe2Required;
vc_ae2 := AeSimu.create("AE2") alive;
f_setProtocolBinding(PX_PROTOCOL_BINDING_AE2);
vc_ae2.start(f_cf01UpAe2());
vc_ae2.done;
}
......@@ -80,6 +81,7 @@ module OneM2M_Functions {
vc_config := e_cf02;
vc_testSystemRole := e_ae;
vc_cse1 := CseSimu.create("CSE1") alive;
f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1);
// Map
map(self:mcaPort, system:mcaPort);
......@@ -130,6 +132,7 @@ module OneM2M_Functions {
vc_config := e_cf02CseSimuMaster;
vc_testSystemRole := e_cse;
vc_ae1 := AeSimu.create("AE1") alive;
f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1);
//Initialization of local CSEBase
v_cSEBaseResource := f_generateLocalResource(-, -1, int5);
......@@ -528,7 +531,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(int2, v_request, -1);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
......@@ -593,10 +596,10 @@ module OneM2M_Functions {
//TODO Test, to be removed
v_request.to_ := f_getResourceAddress();
mcaPort.send(m_request(v_request));
//mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME})));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
//mcaPort.send(f_getMsgOutPrimitive(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME}))));
} else {
mcaPort.send(m_request(m_createAe(p_appId)));
mcaPort.send(f_getMsgOutPrimitive(m_request(m_createAe(p_appId))));
}
tc_ac.start;
alt {
......@@ -733,7 +736,7 @@ module OneM2M_Functions {
v_request.from_ := f_getOriginator(vc_resourcesIndexToBeDeleted[i]);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
......@@ -818,7 +821,7 @@ module OneM2M_Functions {
v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false)));
mccPort.send(m_request(v_request));
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
......@@ -862,7 +865,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -926,7 +929,7 @@ module OneM2M_Functions {
*/
function f_cse_updateAnnouncedResource(in RequestPrimitive p_requestPrimitive) runs on CseSimu {
mccPort.send(m_request(p_requestPrimitive));
mccPort.send(f_getMsgOutPrimitive(m_request(p_requestPrimitive)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -964,7 +967,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(int1, v_request, -1);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -1000,7 +1003,7 @@ module OneM2M_Functions {
*/
function f_cse_updateResource(in RequestPrimitive p_requestPrimitive) runs on AeSimu {
mcaPort.send(m_request(p_requestPrimitive));
mcaPort.send(f_getMsgOutPrimitive(m_request(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -1032,7 +1035,7 @@ module OneM2M_Functions {
*/
function f_cse_retrieveResource(integer p_resourceIndex) runs on AeSimu return PrimitiveContent{
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -1069,7 +1072,7 @@ module OneM2M_Functions {
v_request := valueof(p_requestPrimitive);
}
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
......@@ -1100,7 +1103,7 @@ module OneM2M_Functions {
function f_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean {
//Check to see if the resource is present or not
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
......@@ -1137,7 +1140,7 @@ module OneM2M_Functions {
log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource");
//Check to see if the resource has NOT been created
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex))));
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
......@@ -1174,7 +1177,7 @@ module OneM2M_Functions {
v_request.from_ := f_getOriginator(vc_acpAuxIndex);
v_request.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {valueof(m_createAcr(PX_ACOR, p_allowedOperations))};
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
......@@ -1330,7 +1333,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
}
......@@ -1385,13 +1388,13 @@ module OneM2M_Functions {
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict == pass) {
mcaPortIn.send(m_httpResponse(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_httpResponse(v_responsePrimitive)));
} else {
v_responsePrimitive.responseStatusCode := int4000;
mcaPortIn.send(m_httpResponse(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_httpResponse(v_responsePrimitive)));
}
//mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted
//mcaPort.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive))); // TODO have to be deleted
} //end f_subscriptionVerificationHandler
......@@ -1416,7 +1419,7 @@ module OneM2M_Functions {
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
tc_ac.start;
repeat;
}
......@@ -1455,7 +1458,7 @@ module OneM2M_Functions {
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive{
tc_ac.stop;
......@@ -1499,7 +1502,7 @@ module OneM2M_Functions {
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
tc_ac.stop;
......@@ -1512,7 +1515,7 @@ module OneM2M_Functions {
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
v_notificationsReceived := v_notificationsReceived + 1;
if(v_notificationsReceived < p_numberOfAggregatedNotification) {
tc_ac.start;
......@@ -1547,7 +1550,7 @@ module OneM2M_Functions {
tc_ac.stop;
v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
if(not(match(vc_request.primitive.requestPrimitive.primitiveContent.notification.subscriptionDeletion, true))) {
setverdict(fail, __SCOPE__ & ":ERROR: subscriptionDeletion attribute have to be set to TRUE");
}
......@@ -1677,7 +1680,7 @@ module OneM2M_Functions {
v_responsePrimitive.from_ := PX_CSE1_ID;
v_responsePrimitive.to_ := v_request.primitive.requestPrimitive.from_;
v_responsePrimitive.primitiveContent := vc_localResourcesList[v_announcedResourceIndex].resource;
mccPortIn.send(m_response(v_responsePrimitive));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
......@@ -1703,7 +1706,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(f_getAnnouncedResourceType(p_resourceType), p_requestPrimitive, vc_remoteCseIndex);
mccPort.send(m_request(v_request));
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
......@@ -1766,10 +1769,10 @@ module OneM2M_Functions {
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict == pass) {
mccPortIn.send(m_httpResponse(v_responsePrimitive));
mccPortIn.send(f_getMsgOutPrimitive(m_httpResponse(v_responsePrimitive)));
} else {
v_responsePrimitive.responseStatusCode := int4000;
mccPortIn.send(m_httpResponse(v_responsePrimitive));
mccPortIn.send(f_getMsgOutPrimitive(m_httpResponse(v_responsePrimitive)));
}
} //end f_cse_notifyProcedure_updateHandler
......@@ -1784,7 +1787,7 @@ module OneM2M_Functions {
function f_cse_isResourcePresent (integer p_resourceIndex) runs on CseSimu return boolean {
//Check to see if the resource is present or not
mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) {
......@@ -1821,7 +1824,7 @@ module OneM2M_Functions {
log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource");
//Check to see if the resource has NOT been created
mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex))));
mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) {
......@@ -1864,7 +1867,7 @@ module OneM2M_Functions {
v_request := f_getCreateRequestPrimitive(int16, p_requestPrimitive, -1);
mccPort.send(m_request(v_request));
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
......@@ -1931,7 +1934,7 @@ module OneM2M_Functions {
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
v_response.primitiveContent.remoteCSE := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
vc_remoteCseIndex := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource)), int16, -1);
v_resourceIndex := vc_remoteCseIndex;
......@@ -1969,7 +1972,7 @@ module OneM2M_Functions {
setverdict(pass, __SCOPE__&":INFO: CREATE Request received successfuly");
v_responsePrimitive := f_getCreateResponsePrimitive(vc_request.primitive.requestPrimitive.resourceType, vc_request.primitive.requestPrimitive);
v_responsePrimitive.responseStatusCode := int2001;
mccPortIn.send(m_response(v_responsePrimitive));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mccPortIn.receive(mw_request(?)) {
tc_ac.stop;
......@@ -2011,7 +2014,7 @@ module OneM2M_Functions {
v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime;
v_myResource.cSEBase.cSE_ID := PX_CSE1_ID;
v_myResource.cSEBase.supportedResourceType := PX_CSE1_SRT;
v_myResource.cSEBase.pointOfAccess := {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING, PX_CSE1_ADDRESS, "")};
v_myResource.cSEBase.pointOfAccess := {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_CSE1, PX_CSE1_ADDRESS, "")};
v_myResource.cSEBase.cseType := vc_cseType;
}else if(p_resourceType == int16 and ispresent(p_resource)) { //RemoteCSE
......@@ -2241,7 +2244,7 @@ module OneM2M_Functions {
}
v_response.from_ := PX_CSE1_ID;
v_response.to_ := p_requestPrimitive.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
}
......@@ -2289,7 +2292,7 @@ module OneM2M_Functions {
//Send response
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
log(__SCOPE__&": WARNING: Unexpected Notification message received");
repeat;
}
......@@ -2297,7 +2300,7 @@ module OneM2M_Functions {
//Send response
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
log(__SCOPE__&": WARNING: Unexpected Notification for Subscription Verification message received");
repeat;
}
......@@ -2332,7 +2335,7 @@ module OneM2M_Functions {
}
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
tc_ac.start(10.0);
repeat;
}
......@@ -2347,16 +2350,16 @@ module OneM2M_Functions {
v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
} else {
v_response := valueof(m_responsePrimitive(int2000,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
if(ischosen(vc_localResourcesList[v_localResourceIndex].resource.cSEBase)) {
mccPortIn.send(m_response(v_response, {{"parentID", omit}}));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response, {{"parentID", omit}})));
} else {
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
}
}
......@@ -2374,14 +2377,14 @@ module OneM2M_Functions {
v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
} else {
v_response := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
f_updateLocalResource(v_localResourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
mccPortIn.send(m_response(v_response));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
}
tc_ac.start(10.0);
repeat;
......@@ -2478,7 +2481,7 @@ module OneM2M_Functions {
v_localResourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
mcaPortIn.send(m_response(vc_response.primitive.responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
}
......@@ -2524,11 +2527,11 @@ module OneM2M_Functions {
v_modifiedResource := f_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, int2, v_parentIndex);
if(v_resourceIndex != -1) {
mcaPortIn.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource)));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource))));
setverdict(pass, __SCOPE__&":INFO: Container created successfuly");
}
else {
mcaPortIn.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))));
setverdict(inconc, __SCOPE__&":INFO: Container creation failed");
}
}
......@@ -2561,7 +2564,7 @@ module OneM2M_Functions {
[] mcaPort.receive(mw_request(?)) -> value v_request {
log(__SCOPE__ & ":WARNING: Unexpected request received");
mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)));
mcaPort.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))));
repeat;
}
......@@ -2589,10 +2592,10 @@ module OneM2M_Functions {
v_modifiedResource := f_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, v_rp.resourceType, v_parentIndex);
if(v_resourceIndex != -1) {
mcaPortIn.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource)));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource))));
}
else {
mcaPortIn.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))));
}
repeat;
}
......@@ -3002,7 +3005,7 @@ module OneM2M_Functions {
* @param p_announcementTargetResource Announcement Target Resource
* @return p_annoucementTargetPoA Announcemenet Target PoA
*/
function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring {
function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING_CSE1, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring {
if(p_protocolBinding == "HTTP") {
return "http://" & p_announcementTargetAddress & "/" & p_announcementTargetResource;
......@@ -3502,6 +3505,22 @@ module OneM2M_Functions {
f_checkAeSimuStatus();
}
/**
* @desc Sets the protocol binding to be used by a component
* @param p_protocolBinding Protocol binding to be used
*/
function f_setProtocolBinding(charstring p_protocolBinding) runs on Tester {
vc_protocolBinding := p_protocolBinding;
}
/**
* @desc Returns the protocol binding used by the component
*/
function f_getProtocolBinding() runs on Tester return charstring {
return vc_protocolBinding;
}
/**
* @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA
......@@ -3570,6 +3589,16 @@ module OneM2M_Functions {
}
/**
* @desc Get MsgOut primitive
* @param MsgOut MsgOut primitive
*/
function f_getMsgOutPrimitive(MsgOut p_msgOut) runs on Tester return MsgOut {
p_msgOut.protocolBinding := vc_protocolBinding;
return p_msgOut;
}
function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester {
if (PX_UT_IMPLEMENTED){
......
......@@ -119,7 +119,22 @@ module OneM2M_Pixits {
/**
* @desc Protocolo binding to use during test execution
*/
modulepar charstring PX_PROTOCOL_BINDING := "HTTP";
//modulepar charstring PX_PROTOCOL_BINDING := "HTTP";
/**
* @desc Protocolo binding to use during test execution
*/
modulepar charstring PX_PROTOCOL_BINDING_CSE1 := "HTTP";
/**
* @desc Protocolo binding to use during test execution
*/
modulepar charstring PX_PROTOCOL_BINDING_AE1 := "HTTP";
/**
* @desc Protocolo binding to use during test execution
*/
modulepar charstring PX_PROTOCOL_BINDING_AE2 := "HTTP";
/**
* @desc Namespace composed of "prefix" = "xml namespace" to use during test execution
......
......@@ -45,7 +45,7 @@ module OneM2M_Templates {
primitive := { requestPrimitive := p_requestPrimitive},
host := PX_SUT_ADDRESS,
xmlNamespace := PX_XML_NAMESPACE,
protocolBinding := PX_PROTOCOL_BINDING,
protocolBinding := PX_PROTOCOL_BINDING_CSE1,
serialization := PX_SERIALIZATION,
forcedFields := p_forcedFields
};
......@@ -58,7 +58,7 @@ module OneM2M_Templates {
primitive := { responsePrimitive := p_responsePrimitive},
host := PX_SUT_ADDRESS,
xmlNamespace := PX_XML_NAMESPACE,
protocolBinding := PX_PROTOCOL_BINDING,
protocolBinding := PX_PROTOCOL_BINDING_CSE1,
serialization := PX_SERIALIZATION,
forcedFields := p_forcedFields
};
......
......@@ -30,6 +30,7 @@ module OneM2M_TestSystem {
timer tc_ac := PX_TAC;
timer tc_wait := PX_TWAIT;
//global variables
var charstring vc_protocolBinding;
var Configurations vc_config;
var TestSystemRole vc_testSystemRole;
var MyResourcesList vc_resourcesList;
......
......@@ -60,12 +60,12 @@ module OneM2M_PermutationFunctions {
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(v_responsePrimitive))));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while creating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))))));
stop;
}
[] tc_ac.timeout {
......@@ -109,12 +109,12 @@ module OneM2M_PermutationFunctions {
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while creating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -162,12 +162,12 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -209,12 +209,12 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -262,12 +262,12 @@ module OneM2M_PermutationFunctions {
setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while retrieving container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -310,12 +310,12 @@ module OneM2M_PermutationFunctions {
setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while retrieving container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -360,12 +360,12 @@ module OneM2M_PermutationFunctions {
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -406,12 +406,12 @@ module OneM2M_PermutationFunctions {
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
stop;
}
[] tc_ac.timeout {
......@@ -460,12 +460,12 @@ module OneM2M_PermutationFunctions {
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : AE registration request is rejected due to not including the optional attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
......@@ -521,13 +521,13 @@ module OneM2M_PermutationFunctions {
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : ContentInstance creation request is rejected due to not including the attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
......@@ -567,12 +567,12 @@ module OneM2M_PermutationFunctions {
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Container creation request is rejected due to not including the attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
......@@ -614,12 +614,12 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(?)) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : AE update request is rejected due to not including the optional attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
......@@ -656,13 +656,13 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Container update request is rejected due to not including the attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
......@@ -703,12 +703,12 @@ module OneM2M_PermutationFunctions {
setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!");
v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : error while retrieving resource !");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
......@@ -757,12 +757,12 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Subscription creation request is rejected due to not including the optional attribute!");
mcaPortIn.send(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
......@@ -826,7 +826,7 @@ module OneM2M_PermutationFunctions {
v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
......@@ -886,7 +886,7 @@ module OneM2M_PermutationFunctions {
v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
......@@ -947,7 +947,7 @@ module OneM2M_PermutationFunctions {
v_addressingMethod := e_nonHierarchical;
v_primitiveScope := p_primitiveScope;
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
......@@ -1004,7 +1004,7 @@ module OneM2M_PermutationFunctions {
v_addressingMethod := e_hierarchical;
v_primitiveScope := p_primitiveScope;
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start;
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
tc_ac.stop;
......@@ -1070,7 +1070,7 @@ module OneM2M_PermutationFunctions {
v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_updateRequest));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
......@@ -1133,7 +1133,7 @@ module OneM2M_PermutationFunctions {
v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_updateRequest));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
......@@ -1197,7 +1197,7 @@ module OneM2M_PermutationFunctions {
v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
mcaPort.send(m_request(v_request));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
......@@ -1257,7 +1257,7 @@ module OneM2M_PermutationFunctions {
v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
mcaPort.send(m_request(v_request));