Commit 1633ac83 authored by Pramod Kulkarni's avatar Pramod Kulkarni Committed by Miguel Angel Reina Ortega

Improvements for the CSE registration procedure:

- New function f_getResourceIndex, used in default a_cse_cf02_cse1
- Update of default to receive some optional messages (retrieve CSEBase, etc..) from MN

Improvements for handling Announcement procedure
- announcement handler updated
- values in template AEAnnc corrected
- new templates for announced resources
Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 1c9895c1
This diff is collapsed.
......@@ -391,7 +391,7 @@ module OneM2M_Templates {
to_ := p_to,
from_ := p_from,
requestIdentifier := ?,
resourceType := ?,
resourceType := omit,
primitiveContent:= ?,
roleIDs := *,
originatingTimestamp := *,
......@@ -592,6 +592,35 @@ module OneM2M_Templates {
tokenRequestIndicator := *
}
/**
* @desc Base Reception template for create operation for announced resources
*/
template RequestPrimitive mw_createAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?) := {
operation := int1,
to_ := p_to,
from_ := p_from,
requestIdentifier := ?,
resourceType := ?,
primitiveContent := ?,
roleIDs := *,
originatingTimestamp := *,
requestExpirationTimestamp := *,
resultExpirationTimestamp := *,
operationExecutionTime := *,
responseType := *,
resultPersistence := *,
resultContent := *,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
filterCriteria := *,
discoveryResultType := *,
tokens := *,
tokenIDs := *,
localTokenIDs := *,
tokenRequestIndicator := *
}
/**
* @desc Base CREATE request primitive for AEAnnc resource
......@@ -612,7 +641,7 @@ module OneM2M_Templates {
/**
* @desc Reception template for CREATE AEAnnc
*/
template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template (omit) AcpType p_accessControlPolicyIds := omit) modifies mw_create := {
template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?) modifies mw_createAnnc := {
resourceType := int10002,
primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
};
......@@ -661,7 +690,7 @@ module OneM2M_Templates {
template RequestPrimitive mw_createAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
to_ := p_to,
from_ := p_from,
resourceType := int10002,
resourceType := int10001,
primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
};
......@@ -1354,14 +1383,14 @@ module OneM2M_Templates {
expirationTime := ?,//MA M
link := ?,//M
dynamicAuthorizationConsultationIDs := omit, //OA
appName := omit,//OA
app_ID := omit,//OA
aE_ID := omit,//OA
pointOfAccess := omit, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := omit,//OA
nodeLink := omit,//OA
requestReachability := omit,//OA
contentSerialization := omit,//OA
appName := *,//OA
app_ID := *,//OA
aE_ID := *,//OA
pointOfAccess := *, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := *,//OA
nodeLink := *,//OA
requestReachability := *,//OA
contentSerialization := *,//OA
e2eSecInfo := ?, //MA
choice := omit//NA
};
......@@ -1427,7 +1456,7 @@ module OneM2M_Templates {
* @desc Base reception template of primitiveContent for CREATE operation for AccessControlPolicyAnnc resource
* @param p_labels Labels
*/
template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template (omit) Labels p_labels := omit) := {
template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template Labels p_labels := ?) := {
resourceName := omit,//NA M
resourceType := omit,//NA M
resourceID := omit,//NA M
......@@ -1437,8 +1466,8 @@ module OneM2M_Templates {
labels := p_labels,//MA
expirationTime := ?,//MA M
link := ?,//M
privileges := *,//MA
selfPrivileges := *,//MA
privileges := ?,//MA
selfPrivileges := ?,//MA
choice := omit//NA
};
......
......@@ -62,9 +62,9 @@ module OneM2M_TestSystem {
//global variables
var MyResourcesList vc_localResourcesList := {};
var AeSimu vc_ae1;//For CF02 when CseSimu is master
var integer vc_remoteCseIndex;
var integer vc_localRemoteCseIndex;
var integer vc_cSEBaseIndex; //Index of the CSEBase resource of the Tester inside vc_localResourcesList
var integer vc_remoteCseIndex := -1;
var integer vc_localRemoteCseIndex := -1;
var integer vc_cSEBaseIndex := -1; //Index of the CSEBase resource of the Tester inside vc_localResourcesList
};
type component InCseSimu extends CseSimu {}
......@@ -77,6 +77,7 @@ module OneM2M_TestSystem {
port OneM2MPort mccPort;
port OneM2MPort mccPortIn;
port AdapterControlPort acPort;
port UpperTesterPort utPort;
}
type component AeSystem {
......
......@@ -6181,14 +6181,17 @@ module OneM2M_PermutationFunctions {
group Basic {
function f_CSE_ANNC_001(ResourceType p_resourceType, template RequestPrimitive p_requestCreatePrimitive, template (present) RequestPrimitive p_requestAnnc, 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 vc_response;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_containerIndex := -1;
var integer v_aeIndex := -1;
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 := {PX_CSE_ID};
// Test control
......@@ -6198,51 +6201,40 @@ 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;
//Preamble
v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
vc_cse1.start(f_cse_resourceAnnouncementHandler());
v_resourceIndex := f_cse_createResource(p_resourceType, m_createAEAnnc(PX_APP_ID, omit, omit));
vc_cse1.start(f_cse_resourceAnnouncementHandler(mw_createAEAnnc(-, -, -)));
v_aeIndex := f_cse_createResource(int2,v_create);
vc_cse1.done;
// Test Body
if (ispresent (p_requestUpdatePrimitive)) {
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_requestUpdatePrimitive);
v_responsePrimitive.responseStatusCode := int2004;
v_resourceIndex := f_cse_createResource(p_resourceType,p_requestCreatePrimitive);
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_requestUpdatePrimitive);
v_responsePrimitive.responseStatusCode := int2004;
} else {
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_parentIndex);
v_responsePrimitive.responseStatusCode := int2001;
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_parentIndex);
v_responsePrimitive.responseStatusCode := int2001;
}
vc_cse1.start(f_cse_resourceAnnouncementHandler(p_createRequestAnnc));
mcaPort.send(m_request(v_request));
vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc));
vc_cse1.done;
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(v_responsePrimitive.responseStatusCode))) -> value vc_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(v_responsePrimitive.responseStatusCode))) -> value v_response {
tc_ac.stop;
if (v_responsePrimitive.responseStatusCode == int2004){
setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
} else if (v_responsePrimitive.responseStatusCode == int2001) {
setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
}
setverdict(pass, __SCOPE__, ": Operation for resource " & int2str(enum2int(p_resourceType)) & " performed successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__, ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__, ": Error while updating optional attribute");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
}
// Postamble
f_cse_postamble_deleteResources();
......
......@@ -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;
......@@ -7252,19 +7252,91 @@ module OneM2M_Testcases_CSE_Release_2 {
testcase TC_CSE_ANNC_001_ACP_UPD() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int1, v_createRequest, mw_createAccessControlPolicyAnnc, v_updateRequest));//AccessControlPolicy
v_ae1.start(f_CSE_ANNC_001(int1, v_createRequestAnnc, omit, v_updateRequest));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_ANNC_001_ACP_CRE() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int1, v_createRequestAnnc, v_createRequest, omit));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_ANNC_001_CNT_UPD() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContainerAnncBase;
v_updateRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int3, v_createRequestAnnc, omit, v_updateRequest));//Container
v_ae1.done;
}
testcase TC_CSE_ANNC_001_CNT_CRE() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContainerAnncBase;
v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int3, v_createRequestAnnc, v_createRequest, omit));//Container
v_ae1.done;
}
testcase TC_CSE_ANNC_001_GRP_UPD() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
v_updateRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int9, v_createRequestAnnc, omit, v_updateRequest));//Group
v_ae1.done;
}
testcase TC_CSE_ANNC_001_GRP_CRE() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int9, v_createRequestAnnc, v_createRequest, omit));//Group
v_ae1.done;
}
testcase TC_CSE_ANNC_001_CIN_CRE() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContentInstanceAnncBase;
v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_ANNC_001(int4, v_createRequestAnnc, v_createRequest, omit));//ContentInstance
v_ae1.done;
}
}// end group g_CSE_ANNC_001
}
}
}//end group Basic
}//end group Announcement
}//end group CSE
......
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