Commit d1eef6fe authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

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

# Conflicts:
#	OneM2M_Testcases_CSE.ttcn
parents e27f30c1 a1a029a0
......@@ -191,8 +191,10 @@ module OneM2M_Functions {
function f_cf04Up() runs on CseSimu {
// Variables
var PrimitiveContent v_cSEBaseResource;
vc_config := e_cf04;
vc_testSystemRole := e_cse;
vc_testSystemRole := e_cse;
// Map
map(self:mccPort, system:mccPort);
......@@ -200,10 +202,15 @@ module OneM2M_Functions {
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_cf04());
//Creation of CSEBase
v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5);
vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1);
// Connect
//Initialze the IUT
//Initialize the IUT
} // end f_cf03Up
......@@ -1568,8 +1575,8 @@ module OneM2M_Functions {
setverdict(pass, __SCOPE__&":INFO: Resource type RemoteCSE created successfuly");
f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16, -1);
v_remoteCSEResource := f_cse_generateLocalResource(v_response.primitive.responsePrimitive.primitiveContent, 1, int16);
v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, -1);
v_remoteCSEResource := f_cse_generateLocalResource(v_response.primitive.responsePrimitive.primitiveContent, vc_cSEBaseIndex, int16);
v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, vc_cSEBaseIndex);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
......@@ -1602,14 +1609,19 @@ module OneM2M_Functions {
var PrimitiveContent v_remoteCSEResource;
var integer v_localResourceIndex := -1;
var integer v_resourceIndex := -1;
var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
var charstring v_action := "Please, register CSE on the Tester";
//send triggering primitive to SUT
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(p_requestPrimitive)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type RemoteCSE created successfuly");
v_remoteCSEResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, 1, int16);//TODO Get index from v_request.primitive.requestPrimitive.to_
v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, -1);
v_remoteCSEResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, vc_cSEBaseIndex, int16);//TODO Get index from v_request.primitive.requestPrimitive.to_
v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, vc_cSEBaseIndex);
v_response := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
......@@ -1670,24 +1682,41 @@ module OneM2M_Functions {
* @param p_resourceType Type of the resource to be created
* @return Internal created resource
*/
function f_cse_generateLocalResource(in PrimitiveContent p_resource, in integer p_parentIndex, in ResourceType p_resourceType) runs on CseSimu return PrimitiveContent {
function f_cse_generateLocalResource(in template(omit) PrimitiveContent p_resource := omit, in integer p_parentIndex, in ResourceType p_resourceType) runs on CseSimu return PrimitiveContent {
var integer v_resourceIndex := lengthof(vc_localResourcesList);
var PrimitiveContent v_myResource;
// TODO To review the code (use of indexes, generation of value for certain attributes, etc..)
if(p_resourceType == int16 and ispresent(p_resource)) {
if(p_resourceType == int5) { //CSEBase
v_myResource.cSEBase.resourceName := "CSEBase" & int2str(v_resourceIndex);
v_myResource.cSEBase.resourceType := p_resourceType;
v_myResource.cSEBase.resourceID := "CSEBase" & int2str(v_resourceIndex);
v_myResource.cSEBase.parentID := omit; //Following TS-0001, it must be NULL
//v_myResource.cSEBase.creationTime := fx_generateTimestamp();
v_myResource.cSEBase.creationTime := "20171231T012345";
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, "")};
if (PX_MN_CSE){
v_myResource.cSEBase.cseType := int1; //Tester is an IN-CSE
}else if (PX_IN_CSE){
v_myResource.cSEBase.cseType := int2; //Tester is a MN-CSE
}
}else if(p_resourceType == int16 and ispresent(p_resource)) { //RemoteCSE
if(ischosen(p_resource.remoteCSE)){
v_myResource.remoteCSE := p_resource.remoteCSE;
if(not(ispresent(p_resource.remoteCSE.resourceName))) {
v_myResource.remoteCSE.resourceName := "remoteCSE" & int2char(v_resourceIndex);
v_myResource.remoteCSE.resourceName := "remoteCSE" & int2str(v_resourceIndex);
}
v_myResource.remoteCSE.resourceType := p_resourceType;
//v_myResource.remoteCSE.resourceID := "remoteCSE" & int2char(v_resourceIndex);
v_myResource.remoteCSE.resourceID := "remoteCSE";
v_myResource.remoteCSE.resourceID := "remoteCSE" & int2str(v_resourceIndex);
v_myResource.remoteCSE.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
v_myResource.remoteCSE.creationTime := fx_generateTimestamp();
//v_myResource.remoteCSE.creationTime := fx_generateTimestamp();
v_myResource.remoteCSE.creationTime := "20171231T012345";
if(not(ispresent(p_resource.remoteCSE.expirationTime))) {
v_myResource.remoteCSE.expirationTime := "20301231T012345";
}
......@@ -1699,10 +1728,10 @@ module OneM2M_Functions {
//TODO Create a pollingChannel resource
v_myResource.remoteCSE.pointOfAccess := omit;
}
if(vc_localResourcesList[v_resourceIndex].resourceType == int5) {
/*if(vc_localResourcesList[v_resourceIndex].resourceType == int5) {
v_myResource.remoteCSE.m2M_Ext_ID := omit;
v_myResource.remoteCSE.trigger_Recipient_ID:= omit;
}
}*/
v_myResource.remoteCSE.nodeLink := omit;
}
......@@ -2722,9 +2751,8 @@ module OneM2M_Functions {
/**
* @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA
* @param data Corresponding information for the correct execution of the given action
* @desc Boolean to charstring
* @param p_bool
* @verdict
*/
function f_checkAeSimuStatus() runs on AeSimu {
......@@ -2835,7 +2863,7 @@ module OneM2M_Functions {
}else{
action(__SCOPE__ & ":" & p_action);
action(p_action);
}
......
......@@ -104,6 +104,11 @@ module OneM2M_Pixits {
* @desc Test System CSE1 resource ID with Unstructured-CSE-relative-Resource-ID (relative) format according to TS-0001-7.2-1
*/
modulepar XSD.ID PX_CSE1_RESOURCE_ID := "CSE1_RESOURCE_ID";
/**
* @desc CSE1 Supported resource type
*/
modulepar ResourceTypeList_1 PX_CSE1_SRT := {int1, int2, int3, int16};
/**
* @desc Test System M2M-SP1-ID with M2M-SP-ID format (absolute) according to TS-0001-7.2-1 Unstructured-CSE-relative -Resource-ID
......
......@@ -3721,7 +3721,8 @@ module OneM2M_Templates {
template (value) UtTriggerPrimitive m_utCreateRemoteCSE modifies m_utCreate := {
requestIdentifier := testcasename() & "-m_utCreateRemoteCSE" & f_rnd(1, 1000000),
resourceType := int16
resourceType := int16,
primitiveContent := {remoteCSE := m_contentRemoteCSE_allOmit}
}
template (value) UtTriggerPrimitive m_utRetrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
......
......@@ -63,6 +63,7 @@ module OneM2M_TestSystem {
var MyResourcesList vc_localResourcesList;
var AeSimu vc_ae1;//For CF02 when CseSimu is master
var integer vc_remoteCseIndex;
var integer vc_cSEBaseIndex; //Index of the CSEBase resource of the Tester inside vc_localResourcesList
};
type component InCseSimu extends CseSimu {}
......
This diff is collapsed.
......@@ -2749,7 +2749,7 @@ module OneM2M_Testcases_CSE {
var ResourceType v_resourceType := int16; //remoteCSE
var template PrimitiveContent v_contentResponse;
var template UtTriggerPrimitive v_utRequest;
var charstring v_action := "Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS;
var charstring v_action := __SCOPE__ & ":" & " Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS;
// Test control
if(not(PICS_MN_CSE)) {
......@@ -3107,7 +3107,6 @@ module OneM2M_Testcases_CSE {
var ResourceType v_resourceType := int16; //remoteCSE
var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
var charstring v_action := "Please, send a valid UPDATE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing a valid attribute " & p_attribute[0];
// Test control
if(not(PICS_MN_CSE)) {
setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
......@@ -3319,7 +3318,7 @@ module OneM2M_Testcases_CSE {
var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var charstring v_action := "Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS;
var charstring v_action := __SCOPE__ & ":" & " Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS;
// Test control
// Test component configuration
......
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