Commit 7da9b134 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Adding descriptions to all functions in OneM2M_Functions file


Renaming of "child" component:
- vc_cseSimu -> vc_cse1
- vc_aeSimu -> vc_ae1 for CseSimu or vc_ae2 for AeSimu
Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent e3cc4e6d
......@@ -15,13 +15,11 @@ module OneM2M_Functions {
import from XSD all;
import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID};
import from OneM2M_Types all;
import from OneM2M_TypesAndValues all;
import from OneM2M_TestSystem all;
import from OneM2M_Pixits all;
import from OneM2M_Pics all;
// import from OneM2M_AdditionalTypes all;
group ConfigFunctions {
......@@ -45,6 +43,7 @@ module OneM2M_Functions {
vc_auxiliaryAe2Up := p_auxiliaryAe2Required;
vc_ae2 := AeSimu.create("AE2") alive;
vc_ae2.start(f_cf01UpAe2());
vc_ae2.done;
}
//Initialze the IUT
......@@ -79,20 +78,41 @@ module OneM2M_Functions {
// Variables
vc_config := e_cf02;
vc_cseSimu := CseSimu.create("CSE1") alive;
vc_cse1 := CseSimu.create("CSE1") alive;
// Map
map(self:mcaPort, system:mcaPort);
map(vc_cseSimu:mccPort, system:mccPort);
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_aeSimu());
activate(a_cse_cf02_ae1());
vc_cse1.start(f_cf02UpCse1());
vc_cse1.done;
// Connect
f_connectInfoPort(vc_cseSimu);
//Initialze the IUT
} // end f_cf02Up
/**
@desc Ports mapping and default behaviour activation for Config 2 on the CSE1
*/
function f_cf02UpCse1() runs on CseSimu {
// Variables
vc_config := e_cf02;
// Map
map(self:mccPort, system:mccPort);
map(self:mccPortIn, system:mccPortIn);
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_cf02_cse1());
//Initialze the IUT
} // end f_cf02UpCse1
/**
* @desc Ports mapping and default behaviour activation for Config 02
......@@ -101,21 +121,42 @@ module OneM2M_Functions {
// Variables
vc_config := e_cf02;
vc_aeSimu := AeSimu.create("AE1") alive;
vc_ae1 := AeSimu.create("AE1") alive;
// Map
map(self:mccPort, system:mccPort);
map(vc_aeSimu:mcaPort, system:mcaPort);
map(self:mccPortIn, system:mccPortIn);
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_cseSimu());
activate(a_cse_cf02_cse1());
vc_ae1.start(f_cf02UpAe1());
vc_ae1.done;
// Connect
f_connectInfoPort(vc_aeSimu);
//Initialze the IUT
} // end f_cf02UpCseSimuMaster
/**
@desc Ports mapping and default behaviour activation for Config 2 on the AE1
*/
function f_cf02UpAe1() runs on AeSimu {
// Variables
vc_config := e_cf02;
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_cf02_ae1());
//Initialze the IUT
} // end f_cf02UpAe1
/**
* @desc Ports mapping and default behaviour activation for Config 03
*/
......@@ -125,7 +166,7 @@ module OneM2M_Functions {
vc_config := e_cf03;
// Map
map(self:mcaPort, system:mcaPort);
map(self:mcaPort, system:mcaPort);//TODO To be consistent, we should use mcaPortIn for AE testing
map(self:acPort, system:acPort);
activate(a_default());
activate(a_ae_cf03());
......@@ -158,29 +199,6 @@ module OneM2M_Functions {
/**
* @desc Ports unmapping
* @verdict
*/
/*function f_cfCseTesterDown() runs on Tester {
if(vc_config == e_cf01) {
f_cf01Down()
} else if (vc_config == e_cf02){
f_cf02Down()
}
}
/**
* @desc Ports unmapping
* @verdict
*/
/*function f_cfAeTesterDown() runs on AeSimu {
if(vc_config == e_cf03) {
f_cf03Down()
}
}
/**
* @desc Ports unmapping
* @verdict
*/
function f_cf01Down() runs on AeSimu {
......@@ -193,7 +211,6 @@ module OneM2M_Functions {
/**
* @desc Ports unmapping
* @verdict
*/
function f_cf01DownAe2() runs on AeSimu {
......@@ -204,25 +221,25 @@ module OneM2M_Functions {
/**
* @desc Ports unmapping
* @verdict
*/
function f_cf02Down() runs on AeSimu {
unmap(self:mcaPort, system:mcaPort);
unmap(vc_cseSimu:mccPort, system:mccPort);
unmap(self:acPort, system:acPort);
unmap(vc_cseSimu:acPort, system:acPort);
unmap(vc_cse1:mccPort, system:mccPort);
unmap(vc_cse1:mccPortIn, system:mccPortIn);
unmap(vc_cse1:acPort, system:acPort);
}
/**
* @desc Ports unmapping
* @verdict
*/
function f_cf02DownCseSimuMaster() runs on CseSimu {
unmap(self:mccPort, system:mccPort);
unmap(vc_aeSimu:mcaPort, system:mcaPort);
unmap(self:mccPortIn, system:mccPortIn);
unmap(self:acPort, system:acPort);
unmap(vc_aeSimu:acPort, system:acPort);
unmap(vc_ae1:mcaPort, system:mcaPort);
unmap(vc_ae1:acPort, system:acPort);
}
/**
* @desc Ports unmapping for Config 03
......@@ -241,18 +258,199 @@ module OneM2M_Functions {
unmap(self:mccPort, system:mccPort);
unmap(self:acPort, system:acPort);
}
}//end group configFunctions
group InfoPortCommunication {
/**
* @desc Connection of InfoPort of two components
* @param p_tester PTC where InfoPort is to be connected
*/
function f_connectInfoPort(in Tester p_tester) runs on Tester {
// Connect
connect(self:infoPort, p_tester:infoPort);
}
/**
* @desc Disconnection of InfoPort of two components
* @param p_tester PTC where InfoPort is to be connected
*/
function f_disconnectInfoPort(in Tester p_tester) runs on Tester {
// Disconnect
disconnect(self:infoPort, p_tester:infoPort);
}
/**
* @desc Getting last responsePrimitive saved in a component
* @param p_tester Given component
*/
function f_getResponsePrimitive(in Tester p_component) runs on Tester return ResponsePrimitive {
var ResponsePrimitive v_response;
f_connectInfoPort(p_component);
p_component.start(f_sendResponsePrimitive());
alt {
[]infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response {
}
}
f_disconnectInfoPort(p_component);
return v_response;
}
}//end group configFunctions
/**
* @desc Getting last requestPrimitive saved in an AeSimu component
* @param p_tester Given component
*/
function f_getRequestPrimitive(in Tester p_component) runs on Tester return RequestPrimitive {
var RequestPrimitive v_request;
f_connectInfoPort(p_component);
p_component.start(f_sendRequestPrimitive());
alt {
[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
}
}
f_disconnectInfoPort(p_component);
return v_request;
}
/**
* @desc Getting primitiveContent retrieved in an AeSimu component
* @param p_tester AeSimu component
*/
function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent {
var PrimitiveContent v_primitiveContent;
f_connectInfoPort(p_ae);
p_ae.start(f_sendPrimitiveContentRetrievedResource());
alt {
[]infoPort.receive(mw_primitiveContent) -> value v_primitiveContent {
}
}
f_disconnectInfoPort(p_ae);
return v_primitiveContent;
}
/**
* @desc Getting remoteCSE resource from a CseSimu component
* @param p_tester CseSimu component
*/
function f_getRemoteCseResource(in CseSimu p_cse) runs on Tester return integer {
var MyResource v_resource;
var integer v_resourceIndex := -1;
f_connectInfoPort(p_cse);
p_cse.start(f_sendRemoteCseResource());
alt {
[]infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
}
}
f_disconnectInfoPort(p_cse);
return v_resourceIndex;
}
/**
* @desc Getting a specific resource from an AeSimu component
* @param p_tester AeSimu component
* @param p_resourceIndex Index of resource to be retrieved
*/
function f_getResource(in Tester p_component, in integer p_resourceIndex := -1) runs on Tester return integer {
var MyResource v_resource;
var integer v_resourceIndex := -1;
f_connectInfoPort(p_component);
p_component.start(f_sendResource(p_resourceIndex));
alt {
[]infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
}
}
f_disconnectInfoPort(p_component);
return v_resourceIndex;
}
/**
* @desc Sending of last responsePrimitive (vc_response) through InfoPort
*/
function f_sendResponsePrimitive() runs on Tester {
infoPort.send(vc_response.primitive.responsePrimitive);
}
/**
* @desc Sending of last requestPrimitive (vc_request) through InfoPort
*/
function f_sendRequestPrimitive() runs on Tester {
infoPort.send(vc_request.primitive.requestPrimitive);
}
/**
* @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort
*/
function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
infoPort.send(vc_primitiveContentRetrievedResource);
}
/**
* @desc Sending of remoteCSE resource through InfoPort
*/
function f_sendRemoteCseResource() runs on CseSimu {
infoPort.send(vc_resourcesList[vc_remoteCseIndex]);
}
/**
* @desc Sending of Ae resource through InfoPort
*/
function f_sendAeResource() runs on AeSimu {
infoPort.send(vc_resourcesList[vc_aeAuxIndex]);
}
/**
* @desc Sending of a specific resource through InfoPort
* @param p_resourceIndex Index of resource to be sent
*/
function f_sendResource(in integer p_resourceIndex) runs on Tester {
if(p_resourceIndex == -1) {
infoPort.send(vc_resourcesList[vc_aeAuxIndex]); //TODO To send Ae or RemoteCSE depending on the component type
} else {
infoPort.send(vc_resourcesList[p_resourceIndex]);
}
}
}// end of gropu InfoPortCommunication
group CseFunctions {
......@@ -272,8 +470,9 @@ module OneM2M_Functions {
/**
* @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource
* @desc Creation of auxiliar resource AE for correct execution of the test case
* @param p_accessControlPolicyIDs AccessControlPolicyIDs for the auxiliar AE resource
* @param p_poaList Point of contact of the auxiliar AE resource
* @return Internal AE resource index
* @verdict
*/
......@@ -325,12 +524,12 @@ module OneM2M_Functions {
f_checkAeSimuStatus();
return vc_aeAuxIndex;
}
/**
* @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource
* @param p_appId AppID of the AE resource to be created
* @return Internal AE resource index
* @verdict
*/
......@@ -395,6 +594,12 @@ module OneM2M_Functions {
}
/**
* @desc Creation of ServiceSubscribedAppRule resource
* @param p_allowedAEs Allowed AEs
* @return Internal resource index
* @verdict
*/
function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}) runs on AeSimu return integer {//c_CRUDNDi
var integer v_serviceSubscribedAppRuleIndex := -1;
......@@ -405,6 +610,12 @@ module OneM2M_Functions {
}
/**
* @desc Creation of SubscribedProfile resource
* @param p_allowedAEs Allowed AEs
* @return Internal resource index
* @verdict
*/
function f_cse_preamble_createServiceSubscribedProfile(in template ListOfM2MID p_allowedAEs := {""}) runs on AeSimu return integer {//c_CRUDNDi
var integer v_serviceSubscribedAppRuleIndex := -1;
......@@ -420,6 +631,14 @@ module OneM2M_Functions {
}
/**
* @desc Registration of AE2 for handling of notifications and handling of subscription verification started if subscription resource is to be created
* @param p_ae2Index Internal AE2 resource index
* @param p_createRequestPrimitive CREATE Request for the resource to be created
* @param p_resourceType ResourceType of the resource to be created
* @param p_responseStatusCode Response Status Code to be sent in response to the subscription verification request
* @verdict
*/
function f_cse_preamble_subscriptionVerification(inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2001) runs on AeSimu {
if(p_resourceType == int23){
......@@ -440,7 +659,7 @@ module OneM2M_Functions {
group PostambleFunctions {
/**
* @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
* @desc Deletion of all resources created during the test case execution. It deals also with AE2 created resources if any. IUT gets clean and ready for next execution
* @verdict
*/
function f_cse_postamble_deleteResources() runs on AeSimu {
......@@ -485,7 +704,7 @@ module OneM2M_Functions {
}
/**
* @desc Calls to postamble for AE2 entity
* @desc Calls to postamble for AeSimu components (i.e. AE2)
* @verdict
*/
function f_cse_postamble_aeSimu(in AeSimu p_ae) runs on AeSimu {
......@@ -534,172 +753,7 @@ module OneM2M_Functions {
}
}
}
/**
@desc
*/
function f_getResponsePrimitive(in AeSimu p_ae) runs on Tester return ResponsePrimitive {
var ResponsePrimitive v_response;
f_connectInfoPort(p_ae);
p_ae.start(f_sendResponsePrimitive());
alt {
[]infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response {
}
}
f_disconnectInfoPort(p_ae);
return v_response;
}
/**
@desc
*/
function f_getRequestPrimitive(in AeSimu p_ae) runs on Tester return RequestPrimitive {
var RequestPrimitive v_request;
f_connectInfoPort(p_ae);
p_ae.start(f_sendRequestPrimitive());
alt {
[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
}
}
f_disconnectInfoPort(p_ae);
return v_request;
}
function f_getRemoteCseRequestPrimitive(in CseSimu p_cse) runs on Tester return RequestPrimitive {
var RequestPrimitive v_request;
f_connectInfoPort(p_cse);
p_cse.start(f_sendRemoteCseRequestPrimitive());
alt {
[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
}
}
f_disconnectInfoPort(p_cse);
return v_request;
}
/**
@desc
*/
function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent {
var PrimitiveContent v_primitiveContent;
f_connectInfoPort(p_ae);
p_ae.start(f_sendPrimitiveContentRetrievedResource());
alt {
[]infoPort.receive(mw_primitiveContent) -> value v_primitiveContent {
}
}
f_disconnectInfoPort(p_ae);
return v_primitiveContent;
}
/**
@desc
*/
function f_getRemoteCseResource(in CseSimu p_cse) runs on AeSimu return integer {
var MyResource v_resource;
var integer v_resourceIndex := -1;
f_connectInfoPort(p_cse);
p_cse.start(f_sendRemoteCseResource());
alt {
[]infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
}
}
f_disconnectInfoPort(p_cse);
return v_resourceIndex;
}
/**
@desc
*/
function f_getResource(in AeSimu p_ae, in integer p_resourceIndex := -1) runs on AeSimu return integer {
var MyResource v_resource;
var integer v_resourceIndex := -1;
f_connectInfoPort(p_ae);
p_ae.start(f_sendResource(p_resourceIndex));
alt {
[]infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
}
}
f_disconnectInfoPort(p_ae);
p_ae.done;
return v_resourceIndex;
}
function f_sendResponsePrimitive() runs on AeSimu {
infoPort.send(vc_response.primitive.responsePrimitive);
}
function f_sendRequestPrimitive() runs on AeSimu {
infoPort.send(vc_request.primitive.requestPrimitive);
}
function f_sendRemoteCseRequestPrimitive() runs on CseSimu {
infoPort.send(vc_request.primitive.requestPrimitive);
}
function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
infoPort.send(vc_primitiveContentRetrievedResource);
}
function f_sendRemoteCseResource() runs on CseSimu {
infoPort.send(vc_resourcesList[vc_remoteCseIndex]);
}