Commit 44ab129c authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Generic Changes done for handling Announcement procedure

parent 5412573d
......@@ -86,6 +86,9 @@ module OneM2M_Functions {
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
if(PX_UT_IMPLEMENTED) {
map(self:utPort, system:utPort);
}
activate(a_default());
activate(a_cse_cf02_ae1());
vc_cse1.start(f_cf02UpCse1());
......@@ -261,6 +264,9 @@ module OneM2M_Functions {
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
if(PX_UT_IMPLEMENTED){
unmap(self:utPort, system:utPort);
}
unmap(vc_cse1:mccPort, system:mccPort);
unmap(vc_cse1:mccPortIn, system:mccPortIn);
unmap(vc_cse1:acPort, system:acPort);
......@@ -1140,10 +1146,6 @@ module OneM2M_Functions {
v_responsePrimitive.primitiveContent := vc_localResourcesList[vc_localRemoteCseIndex].resource;
mccPortIn.send(m_response(v_responsePrimitive));
}
[] mccPortIn.receive{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":ERROR: Unexpected message received");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
}
......@@ -1702,6 +1704,13 @@ module OneM2M_Functions {
var integer v_resourceIndex := -1;
var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
var charstring v_action := "Please, send a CSE registration request";
var integer v_parentIndex := vc_localRemoteCseIndex;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_announcedResource;
var PrimitiveContent v_resource;
var integer vc_localResourceIndex := -1;
//send triggering primitive to SUT
f_sendUtPrimitive(v_utRequest,v_action);
......@@ -1721,6 +1730,43 @@ module OneM2M_Functions {
mccPortIn.send(m_response(v_response));
v_resourceIndex := f_setResource(v_request.primitive.requestPrimitive.primitiveContent, int16, -1);
tc_ac.start;
repeat;
}
[] mccPortIn.receive(mw_request(mw_create())) -> value v_request {
tc_ac.stop;
v_resource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, vc_cSEBaseIndex, v_request.primitive.requestPrimitive.resourceType);//TODO Get index from v_request.primitive.requestPrimitive.to_
vc_localResourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, vc_cSEBaseIndex);
v_response := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
v_response.primitiveContent := vc_localResourcesList[vc_localResourceIndex].resource;
mccPortIn.send(m_response(v_response));
tc_ac.start;
repeat;
}
[] mccPortIn.receive(mw_request(mw_retrieve(f_getLocalResourceAddress(-, e_hierarchical, e_spRelative)))) -> value v_request {
tc_ac.stop;
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[vc_cSEBaseIndex].resource;
mccPortIn.send(m_response(v_response));
tc_ac.start;
repeat;
}
[] mccPortIn.receive(mw_request(mw_update())) -> value v_request {
tc_ac.stop;
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_;
v_response.primitiveContent := vc_localResourcesList[vc_localRemoteCseIndex].resource;
mccPortIn.send(m_response(v_response));
//tc_ac.start;
//repeat;
}
[] mccPortIn.receive {
tc_ac.stop;
......@@ -1729,7 +1775,7 @@ module OneM2M_Functions {
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type remoteCSE");
}
}
}
f_checkCseSimuStatus();
......@@ -1860,6 +1906,27 @@ module OneM2M_Functions {
v_myResource.contentInstanceAnnc.expirationTime := p_resource.contentInstanceAnnc.expirationTime;
v_myResource.contentInstanceAnnc.labels := p_resource.contentInstanceAnnc.labels;
}
} else if (p_resourceType == int1 and ispresent (p_resource)) { //Acp Resource
if(ischosen (p_resource.accessControlPolicy)){
v_myResource.accessControlPolicy := valueof(p_resource.accessControlPolicy);
if(not(ispresent(p_resource.accessControlPolicy.resourceName))) {
v_myResource.accessControlPolicy.resourceName := "accessControlPolicy" & int2str(v_resourceIndex);
}
v_myResource.accessControlPolicy.resourceType := p_resourceType;
v_myResource.accessControlPolicy.resourceID := "accessControlPolicy" & int2str(v_resourceIndex);
v_myResource.accessControlPolicy.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
v_myResource.accessControlPolicy.labels := p_resource.accessControlPolicy.labels;
v_myResource.accessControlPolicy.creationTime := fx_generateTimestamp();
if(not(ispresent(p_resource.accessControlPolicy.expirationTime))) {
v_myResource.accessControlPolicy.expirationTime := "20301231T012345";
}
v_myResource.accessControlPolicy.lastModifiedTime := v_myResource.accessControlPolicy.creationTime;
v_myResource.accessControlPolicy.announceTo := omit;
v_myResource.accessControlPolicy.announcedAttribute := omit;
}
}
return v_myResource;
......@@ -1904,7 +1971,7 @@ module OneM2M_Functions {
*/
altstep a_cse_cf02_cse1() runs on CseSimu {
[] mccPortIn.receive {
[] mccPortIn.receive (mw_request(?)){
log(__SCOPE__&": WARNING: Unexpected message received");
repeat;
}
......
......@@ -391,7 +391,7 @@ module OneM2M_Templates {
to_ := p_to,
from_ := p_from,
requestIdentifier := ?,
resourceType := ?,
resourceType := omit,
primitiveContent:= ?,
roleIDs := *,
originatingTimestamp := *,
......
......@@ -77,6 +77,7 @@ module OneM2M_TestSystem {
port OneM2MPort mccPort;
port OneM2MPort mccPortIn;
port AdapterControlPort acPort;
port UpperTesterPort utPort;
}
type component AeSystem {
......
......@@ -6181,7 +6181,7 @@ module OneM2M_PermutationFunctions {
group Basic {
function f_CSE_ANNC_001(ResourceType p_resourceType, template (present) RequestPrimitive p_createRequestAnnc, template(omit) RequestPrimitive p_requestCreatePrimitive := omit, template(omit) RequestPrimitive p_requestUpdatePrimitive := omit) runs on AeSimu {
function f_CSE_ANNC_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit, in template RequestPrimitive p_requestUpdatePrimitive := omit) runs on AeSimu {
// Local variables
var MsgIn v_response;
......@@ -6191,7 +6191,7 @@ module OneM2M_PermutationFunctions {
var integer v_resourceIndex;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
v_create.primitiveContent.aE.announceTo := {f_getAnnouncementTargetPoA()};
v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
// Test control
......@@ -6201,9 +6201,11 @@ module OneM2M_PermutationFunctions {
// Test adapter configuration
//Register the CSE
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
vc_cse1.done;
f_sleep(10.0);
//Preamble
vc_cse1.start(f_cse_resourceAnnouncementHandler(mw_createAEAnnc(-, -, -)));
v_aeIndex := f_cse_createResource(int2,v_create);
......
......@@ -766,7 +766,7 @@ module OneM2M_Testcases_CSE_Release_1 {
vc_cse1.start(f_cse_resourceAnnouncementHandler(PX_CSE_ID, f_getResourceAddress(v_aeIndex, e_nonHierarchical, e_spRelative)));
vc_cse1.done;
tc_ac.start;
alt {
......
......@@ -5485,7 +5485,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_aeAuxIndex := -1;
var LocationSource v_locationSource := int1;//Network-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_request;
var MsgIn v_response;
......@@ -5551,7 +5551,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_acpAuxIndex := -1;
var LocationSource v_locationSource := int1;//Network-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_request;
var MsgIn v_response;
......@@ -5620,7 +5620,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_aeIndex := -1;
var LocationSource v_locationSource := int1;//Netwok-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_request;
var MsgIn v_response;
......@@ -5683,7 +5683,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var LocationSource v_locationSource := int1;//Netwok-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Duration locationUpdatePeriod_invalid := c_invalid_location_update_period;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_request;
var RequestPrimitive v_locpolicy_request_preamble;
......@@ -5745,7 +5745,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_locPolicyResourceIndex := -1;
var integer v_locContainerResourceIndex := -1;
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_loc_request_preamble;
var RequestPrimitive v_container_request_preamble;
......@@ -5943,7 +5943,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_subscriptionResourceIndex := -1;
var LocationSource v_locationSource := int1;//Netwok-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_locpolicy_request_preamble;
var RequestPrimitive v_container_request_preamble;
......@@ -6146,7 +6146,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var integer v_locContainerResourceIndex := -1;
var LocationSource v_locationSource := int1;//Netwok-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
var RequestPrimitive v_locpolicy_request_preamble;
var RequestPrimitive v_container_request_preamble;
......@@ -6207,7 +6207,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var MsgIn v_response;
var LocationSource v_locationSource := int1;//Netwok-based
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var LocationTargetID locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
......
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