Commit 2a54e012 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge remote-tracking branch 'remotes/origin/Release2-onwards' into Release2

parents 1bed25be c65033ce
......@@ -2075,6 +2075,7 @@ module OneM2M_Functions {
alt {
[] mcaPortIn.receive(mw_request(mw_notifyNotification(p_notification))) -> value vc_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: Expected deletion notification received");
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
f_send(e_mca_in_port, m_response(v_responsePrimitive));
......@@ -2082,10 +2083,6 @@ module OneM2M_Functions {
setverdict(fail, __SCOPE__ & ":ERROR: subscriptionDeletion attribute have to be set to TRUE");
}
}
[] mcaPortIn.receive{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
}
......@@ -2621,7 +2618,7 @@ module OneM2M_Functions {
function f_cse_retrieveChildResourceRefs_cseSimu(template(omit) ResourceTypeList p_resourceTypeList := omit, integer p_targetResourceIndex := -1, XSD.ID p_originator := PX_SUPER_CSE_ID) runs on CseSimu return URIList {
var RequestPrimitive v_requestPrimitive;
var URIList v_uriList := {};
v_requestPrimitive := valueof(m_retrieveChildResourceRefs(f_getResourceAddress(p_targetResourceIndex), p_originator));
v_requestPrimitive := valueof(m_retrieveChildResourceRefs(f_getResourceAddress(p_targetResourceIndex), p_originator, p_resourceTypeList));
f_send(e_mcc_port, m_request(v_requestPrimitive));
tc_ac.start;
......@@ -2831,7 +2828,7 @@ module OneM2M_Functions {
v_response.primitiveContent.remoteCSE := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE;
f_send(e_mcc_in_port, m_response(v_response));
vc_remoteCseIndex := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource(f_getCompletePoA(PX_TS_CSE1.mcaPortIn, "")))), int16, -1, false);
vc_remoteCseIndex := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource(f_getCompletePoA(PX_TS_CSE1.mcaPortIn, "")))), int16, -1, true);
v_resourceIndex := vc_remoteCseIndex;
v_remoteCSERegistered:=true;
tc_ac.start(10.0);
......@@ -2923,7 +2920,7 @@ module OneM2M_Functions {
v_myResource.cSEBase.resourceName := PX_TS_CSE1.cseName;
v_myResource.cSEBase.resourceType := p_resourceType;
v_myResource.cSEBase.resourceID := f_resourceIdCleaner(PX_TS_CSE1.cseResourceId);
v_myResource.cSEBase.parentID := "";//Following TS-0001, it must be NULL. Set to a value for Codec to set it to null
v_myResource.cSEBase.parentID := "";//Following TS-0001, it must be an empty string
v_myResource.cSEBase.creationTime := fx_generateTimestamp();
v_myResource.cSEBase.creationTime := "20171231T012345";
v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime;
......@@ -3527,7 +3524,7 @@ module OneM2M_Functions {
f_processRetrieveRequestPrimitive(v_request.primitive.requestPrimitive);
if(ischosen(vc_response.primitive.responsePrimitive.primitiveContent.cSEBase)) {
f_send(e_mcc_in_port, m_response(vc_response.primitive.responsePrimitive, {{"parentID", omit}}));
f_send(e_mcc_in_port, m_response(vc_response.primitive.responsePrimitive));
} else {
f_send(e_mcc_in_port, m_response(vc_response.primitive.responsePrimitive));
}
......@@ -5615,7 +5612,7 @@ module OneM2M_Functions {
v_parentIndex := f_getLocalResourceIndex(p_request.to_);
if(v_parentIndex == -1) {
setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
log(__SCOPE__&": ERROR: Target resource not found");
vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
} else {
......@@ -5644,7 +5641,7 @@ module OneM2M_Functions {
v_targetLocalResourceIndex := f_getLocalResourceIndex(p_request.to_);
if(v_targetLocalResourceIndex == -1) {
setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
log(__SCOPE__&": ERROR: Target resource not found");
vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
} else {
......@@ -5672,7 +5669,7 @@ module OneM2M_Functions {
v_targetLocalResourceIndex := f_getLocalResourceIndex(p_request.to_);
if(v_targetLocalResourceIndex == -1) {
setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
log(__SCOPE__&": ERROR: Target resource not found");
vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
} else {
......@@ -5697,7 +5694,7 @@ module OneM2M_Functions {
v_targetLocalResourceIndex := f_getLocalResourceIndex(p_request.to_);
if(v_targetLocalResourceIndex == -1) {
setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
log(__SCOPE__&": ERROR: Target resource not found");
vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
} else {
......
......@@ -2753,7 +2753,7 @@ module OneM2M_Templates {
labels := *,//O
accessControlPolicyIDs := *,//O
expirationTime := *,//O
dynamicAuthorizationConsultationIDs := omit,
dynamicAuthorizationConsultationIDs := *,//O
announceTo := *,//O
announcedAttribute := *,//O
cseType := *,//O
......@@ -2764,10 +2764,10 @@ module OneM2M_Templates {
trigger_Recipient_ID := *,//O
requestReachability := ?,//M
nodeLink := *,//O
triggerReferenceNumber := omit,//O
e2eSecInfo := omit,//O
triggerReferenceNumber := *,//O
e2eSecInfo := *,//O
supportedReleaseVersions := {"2a"}, //M
choice := omit//O
choice := *//O
};
/**
......@@ -4947,7 +4947,7 @@ module OneM2M_Templates {
resourceName := ?,//M
resourceType := ?,//M
resourceID := ?,//M
parentID := omit,//M
parentID := "",//M
creationTime := ?,//M
lastModifiedTime := ?,//M
labels := *,//O
......
......@@ -1741,16 +1741,16 @@ module OneM2M_PermutationFunctions {
group Create{
function f_CSE_REG_CRE_001(in XSD.ID v_aeIdStem) runs on AeSimu system CseSystem {
function f_CSE_REG_CRE_001(in XSD.ID p_aeIdStem) runs on AeSimu system CseSystem {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_cseBaseIndex := -1;
var ResourceType v_resourceType := int2;
var universal charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is allowed to register: " & PX_ALLOWED_C_AE_IDS[0];
var universal charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is allowed to register: " & p_aeIdStem;
//Test control
if(v_aeIdStem[0] == "S") {
if(p_aeIdStem[0] == "S") {
if(not(PICS_IN_CSE)) {
setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case");
stop;
......@@ -1765,7 +1765,7 @@ module OneM2M_PermutationFunctions {
f_sleepIgnoreDef(PX_TCONFIG_IUT);
//Test Body
v_request := valueof(m_createAe(PX_TS_AE1.appId, omit, PX_CSE_ID & "/" & v_aeIdStem));
v_request := valueof(m_createAe(PX_TS_AE1.appId, omit, PX_CSE_ID & "/" & p_aeIdStem));
v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
......@@ -2777,6 +2777,9 @@ module OneM2M_PermutationFunctions {
v_request.requestIdentifier := "Existing resource";
if(p_resourceType == int23){
if(vc_ae2.running) {
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
}
vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
}
......@@ -4244,7 +4247,6 @@ module OneM2M_PermutationFunctions {
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_ae2Index := -1;
var integer v_acpIndex := -1;
// Test control
......@@ -4269,7 +4271,7 @@ module OneM2M_PermutationFunctions {
f_cse_createAccessControlPolicyAux(-, -, -);
p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID});
p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[vc_acpIndex].resource.accessControlPolicy.resourceID});
}
if (p_resourceType!=int16){ //ResourceType != RemoteCSE
......@@ -5786,14 +5788,15 @@ module OneM2M_PermutationFunctions {
}//end f_CSE_DMR_UPD_011
function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu system CseSystem {
function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, in boolean p_acpsRequired := false) runs on AeSimu system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_ae2Index := -1;
var integer v_acp1Index := -1;
var integer v_acp2Index := -1;
// Test control
......@@ -5803,11 +5806,20 @@ module OneM2M_PermutationFunctions {
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
vc_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType);
v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
if (p_acpsRequired) {
v_acp1Index := f_cse_createResource(int1, m_createAcp("MyAcp1"), vc_aeIndex);
v_acp2Index := f_cse_createResource(int1, m_createAcp("MyAcp2"), vc_aeIndex);
p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive,{f_getResourceId(vc_resourcesList[v_acp1Index].resource)});
p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive,{f_getResourceId(vc_resourcesList[v_acp2Index].resource)});
}
v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, vc_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
......@@ -5857,24 +5869,30 @@ module OneM2M_PermutationFunctions {
// Test adapter configuration
// Preamble
if(p_resourceType != int2) {
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
}
if(p_resourceType != int1) {
f_cse_createAccessControlPolicyAux(-, -, -);
p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[vc_acpIndex].resource.accessControlPolicy.resourceID});
}
if((p_resourceType != int2) and (p_resourceType != int1)) {
v_aeIndex := f_cse_preamble_registerAe({vc_resourcesList[vc_acpIndex].resource.accessControlPolicy.resourceID});//c_CRUDNDi);
}
if(p_secondAcp) {//A second ACP is required
v_acpIndex := f_cse_createResource(int1, m_createAcpBase);
v_acpi := {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID};
p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi);
if(p_resourceType == int9){
if(ispresent(p_updateRequestPrimitive.primitiveContent.group_.membersAccessControlPolicyIDs)) {
p_updateRequestPrimitive.primitiveContent.group_.membersAccessControlPolicyIDs := v_acpi;
} else {
p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi);
}
} else {
p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi);
}
}
if (p_resourceType!=int16){ //ResourceType != RemoteCSE
......@@ -5980,6 +5998,17 @@ module OneM2M_PermutationFunctions {
v_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_aeIndex)};
}
if(p_resourceType == int9) {
vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_TS_AE2.appId, {vc_resourcesList[vc_acpIndex].resource.accessControlPolicy.resourceID}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, {f_getCompletePoA(PX_TS_AE2.mcaPortIn, "")}), -1)); // AE2 is registred
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_ae2Index := f_getResourceFromAeSimu(vc_ae2);
if(ispresent(v_request.primitiveContent.group_.memberIDs)) {
v_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_ae2Index].resource)};
}
}
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
......@@ -6449,6 +6478,13 @@ module OneM2M_PermutationFunctions {
v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex);
// Test Body
if(p_resourceType == int23) {
if (vc_ae2.running) {
vc_ae2.stop;
}
vc_ae2.start(f_cse_notifyProcedure_noNotificationHandler());
}
v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
f_send(e_mca_port, m_request(v_request));
......@@ -7682,7 +7718,6 @@ module OneM2M_PermutationFunctions {
var integer v_aeIndex := -1;
var integer v_acpIndex1 := -1;
var integer v_acpIndex2 := -1;
var RequestPrimitive v_createRequest := valueof(m_createAcpBase);
var RequestPrimitive v_updateRequest;
var AccessControlRule v_accessControlRule_1;
var SetOfAcrs v_setOfArcs;
......@@ -7695,8 +7730,8 @@ module OneM2M_PermutationFunctions {
// Test adapter configuration
// Preamble
v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource
v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource
v_acpIndex1 := f_cse_createResource(int1, m_createAcp("MyAcp1")); // CSE child resource
v_acpIndex2 := f_cse_createResource(int1, m_createAcp("MyAcp2")); // CSE child resource
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -);
......@@ -8326,9 +8361,11 @@ module OneM2M_PermutationFunctions {
f_cse_updateResource(int1, v_acpIndex, v_updateRequest);
// Test Body
v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex);
f_send(e_mca_port, m_request(valueof(v_request)));
p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex);
p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000);
f_send(e_mca_port, m_request(valueof(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
......
......@@ -2350,7 +2350,7 @@ module OneM2M_Testcases_CSE_Release_1 {
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse), {"parentID"})) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
}
......@@ -2575,11 +2575,11 @@ module OneM2M_Testcases_CSE_Release_1 {
tc_ac.start;
alt {
[PX_IN_CSE] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse_IN), {"parentID"})) -> value v_response {
[PX_IN_CSE] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse_IN))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)");
}
[PX_MN_CSE] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse_MN), {"parentID"})) -> value v_response {
[PX_MN_CSE] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse_MN))) -> value v_response {
tc_ac.stop;
if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)) {
if(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType == int2) {
......@@ -2796,7 +2796,7 @@ module OneM2M_Testcases_CSE_Release_1 {
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse), {"parentID"})) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.supportedResourceType == PX_SRT) {
......@@ -6575,7 +6575,7 @@ module OneM2M_Testcases_CSE_Release_1 {
v_createRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_1;
v_updateRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_2;
v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container
v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest, true));//Container
v_ae1.done;
......@@ -6719,7 +6719,7 @@ module OneM2M_Testcases_CSE_Release_1 {
v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_1;
v_updateRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_2;
v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription
v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest, true));//Subscription
v_ae1.done;
......@@ -7338,7 +7338,7 @@ module OneM2M_Testcases_CSE_Release_1 {
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_updateRequest.primitiveContent.group_.membersAccessControlPolicyIDs := v_membersAccessControlPolicyIDs;
v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest));//Group
v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest, true));//Group
v_ae1.done;
......@@ -8059,7 +8059,7 @@ module OneM2M_Testcases_CSE_Release_1 {
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly");
setverdict(pass, __SCOPE__ & ": Latest contentInstance deleted successfuly");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
......@@ -8067,10 +8067,10 @@ module OneM2M_Testcases_CSE_Release_1 {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
setverdict(fail, __SCOPE__ & ": Error while deleting latest contentInstance");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type latest contentInstance");
}
}
......@@ -8151,7 +8151,7 @@ module OneM2M_Testcases_CSE_Release_1 {
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly");
setverdict(pass, __SCOPE__ & ": Oldest contentInstance deleted successfuly");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
......@@ -8159,10 +8159,10 @@ module OneM2M_Testcases_CSE_Release_1 {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
setverdict(fail, __SCOPE__ & ": Error while deleting oldest contentInstance");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
setverdict(fail, __SCOPE__ & ": No answer while deleting oldest contentInstance");
}
}
......@@ -8598,8 +8598,6 @@ module OneM2M_Testcases_CSE_Release_1 {
}
};
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble
f_cse_postamble_deleteResources();
......
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