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

Merge branch 'Release2-onwards' into Release2

parents 26218ff6 dbc3b5cb
......@@ -1852,6 +1852,7 @@ module OneM2M_Functions {
function f_cse_notifyProcedure_subscriptionVerificationHandler(in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var boolean v_notificationReceived := false;
var template Notification v_notificationRequest := mw_contentNotificationVerification;
//Activate defaults when running on a PTC
......@@ -1866,10 +1867,12 @@ module OneM2M_Functions {
alt {
[] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request {
tc_ac.stop;
v_notificationReceived := true;
setverdict(pass, __SCOPE__ & ":INFO: Subscription Verification Notification received");
}
[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
tc_ac.stop;
v_notificationReceived := true;
setverdict(inconc, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE");
}
[] tc_ac.timeout {
......@@ -1878,16 +1881,18 @@ module OneM2M_Functions {
}
}
//Sending response to the notification received
//Preparation of Notification response to be sent
v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict != pass) {
v_responsePrimitive.responseStatusCode := int4000;
if(v_notificationReceived) {
//Sending response to the notification received
//Preparation of Notification response to be sent
v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict != pass) {
v_responsePrimitive.responseStatusCode := int4000;
}
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
f_send(e_mca_in_port, m_response(v_responsePrimitive));
} //end f_cse_notifyProcedure_subscriptionVerificationHandler
/**
......@@ -5594,7 +5599,7 @@ module OneM2M_Functions {
//Calculate the SP-Relative-AE-ID following format defined in TS-0010 MQTT
v_aeResourceAddress := f_getResourceAddress(p_aeIndex, e_nonHierarchical, e_spRelative);
if(vc_resourcesList[p_aeIndex].resource.aE.aE_ID[0] == "S") {
v_spRelativeAeIdForMqtt := f_resourceIdCleaner(v_aeResourceAddress);
v_spRelativeAeIdForMqtt := oct2char(unichar2oct(f_resourceIdCleaner(v_aeResourceAddress)));
} else {
v_spRelativeAeIdForMqtt := f_getSpRelativeAeIdForMqtt(v_aeResourceAddress);
}
......
......@@ -1556,7 +1556,7 @@ module OneM2M_Templates {
operationExecutionTime := *,
responseType := *,
resultPersistence := omit,
resultContent := omit,
resultContent := int0 ifpresent,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
......
......@@ -2132,8 +2132,10 @@ module OneM2M_Testcases_AE_Release_1 {
v_response_rsp1.to_ := v_request_req1.primitive.requestPrimitive.from_;
//Put in the primitiveContent a Notify request (req2) (simulated) from another node CSE
v_request_req2 := valueof(m_notify(f_getLocalResourceAddress(v_pollingChannelIndex)));
v_request_req2.from_ := PX_TS_CSE1.cseId;
v_response_rsp1.primitiveContent := { requestPrimitive := v_request_req2 };
mcaPortIn.send(m_response(v_response_rsp1));
//send back responsePrimitive
f_send(e_mca_in_port, m_response(v_response_rsp1));
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel");
......
......@@ -43,7 +43,7 @@ module OneM2M_Testcases_CSE_Release_1 {
var integer i;
var XSD.ID v_resourceAddress;
var RequestPrimitive v_request;
map(self:mcaPort, system:mcaPort);
f_cf01Up();
for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {
......@@ -77,8 +77,7 @@ module OneM2M_Testcases_CSE_Release_1 {
}
}
unmap(self:mcaPort, system:mcaPort);
stop;
f_cf01Down();
}
}//end group helpingTestCases
......@@ -1244,7 +1243,7 @@ module OneM2M_Testcases_CSE_Release_1 {
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4126))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": AE creation rejected.");
}
......@@ -8327,21 +8326,30 @@ module OneM2M_Testcases_CSE_Release_1 {
// Local variables
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var RequestPrimitive v_request;
// Test control
// Test component configuration
f_cf01Up();
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription
v_request.primitiveContent.subscription.notificationURI := {"NotReachableNotificationURI"};
vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_TS_AE2.appId, -, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_ae2Index := f_getLatestResource(vc_ae2);
v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex);
v_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
// Test Body
f_send(e_mca_port, m_request(v_request));
......@@ -8421,6 +8429,7 @@ module OneM2M_Testcases_CSE_Release_1 {
v_resourceIndex := f_cse_createResource(int23, v_request, v_aeIndex);//Subscription
if(vc_ae2.running) {
setverdict(inconc, __SCOPE__ & ": Notification not received");
vc_ae2.stop;
};
......@@ -9743,10 +9752,14 @@ module OneM2M_Testcases_CSE_Release_1 {
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)){
[] mcaPort.receive(mw_response(mw_responseDiscovery({?}))){
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": URI List Representation available");
}
[] mcaPort.receive(mw_response(mw_responseDiscovery)){
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
......@@ -9935,7 +9948,6 @@ module OneM2M_Testcases_CSE_Release_1 {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var integer v_i_cont := 0;
// Test control
......@@ -9955,17 +9967,18 @@ module OneM2M_Testcases_CSE_Release_1 {
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response {
tc_ac.stop;
while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element");
}
v_i_cont := v_i_cont + 1;
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[0] element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[0] element");
}
}
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
......@@ -10005,6 +10018,7 @@ module OneM2M_Testcases_CSE_Release_1 {
var RequestPrimitive v_requestPrimitive := valueof(m_createContainerBase);
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
var RequestPrimitive v_request;
const ResourceType c_containerResourceType := int3;
......@@ -10024,9 +10038,11 @@ module OneM2M_Testcases_CSE_Release_1 {
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_aeIndex);
v_requestPrimitive := f_setAcpId(v_requestPrimitive, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)});
v_childResourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_resourceIndex);
v_resourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_aeIndex);
v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
......@@ -10366,7 +10382,6 @@ module OneM2M_Testcases_CSE_Release_1 {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var integer v_i_cont := 0;
// Test control
......@@ -10386,17 +10401,18 @@ module OneM2M_Testcases_CSE_Release_1 {
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response {
tc_ac.stop;
while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) {
setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element");
} else {
setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element");
}
v_i_cont := v_i_cont + 1;
if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[0] element");
} else {
setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[0] element");
}
}
[] mcaPort.receive(mw_response(mw_responseDiscovery)){
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
......@@ -10439,7 +10455,6 @@ module OneM2M_Testcases_CSE_Release_1 {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var integer v_i_cont := 0;
// Test control
......@@ -10459,17 +10474,18 @@ module OneM2M_Testcases_CSE_Release_1 {
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response {
tc_ac.stop;
while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) {
setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element");
} else {
setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element");
}
v_i_cont := v_i_cont + 1;
if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[0] element");
} else {
setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[0] element");
}
}
[] mcaPort.receive(mw_response(mw_responseDiscovery)){
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
......
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