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

Merge branch 'Release3-onwards' into Release3

parents e9d02465 f5b57790
......@@ -14,7 +14,7 @@ module OneM2M_Functions {
import from XSD all;
import from OneM2M_Templates all;
import from OneM2M_Types all;
import from OneM2M_Ports all;
import from OneM2M_Ports all;
import from OneM2M_TypesAndValues all;
import from OneM2M_TestSystem all;
import from OneM2M_Pixits all;
......@@ -578,7 +578,48 @@ module OneM2M_Functions {
// Connect
}
function f_cf07Up(in CseTypeID p_cseType := int2) runs on CseSimu system AeSystem {
// Variables
var charstring v_binding;
var charstring v_binding_in;
var PrimitiveContent v_cSEBaseResource;
var charstring v_host;
vc_cseSimuDesc := PX_TS_CSE1;
//Initialization of component variables
vc_config := e_cf07;
vc_testSystemRole := e_cse;
vc_cseType := p_cseType;
//Creation of CSEBase
v_cSEBaseResource := f_generateLocalResource(-, -1, int5);
vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1);
// Map
map(self:mcaPort, system:mcaPort) param (vc_cseSimuDesc.mcaPort);//TODO To be consistent, we should use mcaPortIn for AE testing
map(self:mcaPortIn, system:mcaPortIn) param (vc_cseSimuDesc.mcaPortIn);//TODO To be consistent, we should use mcaPortIn for AE testing
map(self:acPort, system:acPort);
f_setProtocolBinding(vc_cseSimuDesc.mcaPort, vc_cseSimuDesc.mcaPortIn, v_binding, v_host, v_binding_in);
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcaPort))] := { mcaPort, v_host, v_binding, vc_cseSimuDesc.mcaPort.serialization };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcaPortIn))] := { mcaPortIn, v_host, v_binding_in, vc_cseSimuDesc.mcaPortIn.serialization };
if(PX_UT_IMPLEMENTED) {
map(self:utPort, system:utPort) param (PX_TS_UT);
}
activate(a_default());
vc_cseSimu := activate(a_cse_cf07());
// Connect
//Initialze the IUT
} // End of function f_cf07Up
/**
* @desc Ports unmapping
*/
......@@ -730,6 +771,18 @@ module OneM2M_Functions {
unmap(vc_ae2:acPort, system:acPort);
}// end f_cf06DownCseSimuMaster
function f_cf07Down() runs on CseSimu system AeSystem {
unmap(self:mcaPort, system:mcaPort);
unmap(self:mcaPortIn, system:mcaPortIn);
unmap(self:acPort, system:acPort);
if(PX_UT_IMPLEMENTED){
unmap(self:utPort, system:utPort);
}
} // End of function f_cfDown
}//end group configFunctions
group InfoPortCommunication {
......@@ -2148,6 +2201,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
......@@ -2162,10 +2216,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 {
......@@ -2174,16 +2230,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_mcaPortIn, m_response(v_responsePrimitive));
}
f_send(e_mcaPortIn, m_response(v_responsePrimitive));
} //end f_cse_notifyProcedure_subscriptionVerificationHandler
/**
......@@ -4039,9 +4097,15 @@ module OneM2M_Functions {
*/
altstep a_cse_cf06_das() runs on AeSimu {
[] a_cse_aeSimu();
}
}
/**
* @desc Cse altstep for config 07
*/
altstep a_cse_cf07() runs on CseSimu {
[] a_ae_cseSimu();
}
/**
* @desc Altstep for CseSimu
*/
......@@ -5331,15 +5395,23 @@ module OneM2M_Functions {
log(">>> f_getLocalPoA: ", p_portDesc);
if (ischosen(p_portDesc.binding.httpBindingDesc)) {
v_poa := "http://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress;
if (ispresent(p_portDesc.binding.httpBindingDesc.bindingDesc.useTls) and (p_portDesc.binding.httpBindingDesc.bindingDesc.useTls == true)) {
v_poa := "https://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress;
} else {
v_poa := "http://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress;
}
if (ispresent(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort)) {
v_poa := v_poa & ":" & int2str(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort);
}
v_poa := v_poa & ":" & int2str(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort);
}
} else if (ischosen(p_portDesc.binding.coapBindingDesc)) {
v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress;
if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort)) {
v_poa := v_poa & ":" & int2str(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort);
}
if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.useTls) and (p_portDesc.binding.coapBindingDesc.bindingDesc.useTls == true)) {
v_poa := "coaps://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress;
} else {
v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress;
}
if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort)) {
v_poa := v_poa & ":" & int2str(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort);
}
} else if (ischosen(p_portDesc.binding.mqttBindingDesc)) {
v_poa := "mqtt://" & p_portDesc.binding.mqttBindingDesc.bindingDesc.tsAddress;
if (ispresent(p_portDesc.binding.mqttBindingDesc.bindingDesc.localPort)) {
......@@ -6616,7 +6688,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);
}
......@@ -7047,6 +7119,11 @@ module OneM2M_Functions {
*/
external function fx_validateESCertKEMessage(XSD.Base64Binary incomingMessage, integer stage) return boolean;
/**
* @desc Retrieve the specified ontology description.
* @param p_ontology_description The ontology description (e.g. /saref).
*/
external function fx_retrieve_formal_ontology(in charstring p_ontology_description) return charstring;
} // end externalFunctions
......
......@@ -6,7 +6,7 @@
* All rights reserved.
*
* @author oneM2M/ETSI
* @desc Module containing Pixits for oneM2M
* @desc Module containing Pixits for oneM2M
*
*/
module OneM2M_Pics {
......@@ -47,7 +47,8 @@ module OneM2M_Pics {
*/
modulepar boolean PICS_IN_CSE := true;
modulepar boolean PICS_MN_CSE := true;
modulepar boolean PICS_ASN_CSE := true;
modulepar boolean PICS_ASN_CSE := true;
modulepar boolean PICS_AE_IPE := false;
/**
* @desc Resource Addressing methods
......@@ -189,6 +190,46 @@ module OneM2M_Pics {
modulepar boolean PICS_SERVICE_SUBSCRIBED_NODE := true;
modulepar boolean PICS_REMOTE_PROVISIONING := true;
}
group Onthology_based_interworking {
/**
* @desc Does the Test System provide an ontology server?
*/
modulepar boolean PICS_TS_ONTOLOGY_SERVER := true;
/**
* @desc Does the SUT support RESTfull API?
*/
modulepar boolean PICS_RESTFULL_API := true;
/**
* @desc Does the SUT support Discovery?
*/
modulepar boolean PICS_AE_IPE_DISCOVERY := true;
/**
* @desc The expected HTTP Content-type header value
*/
modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/xml";
/**
* @desc The expected HTTP server where to retrieve the formal description of the ontology
*/
modulepar charstring PICS_HEADER_HOST := "www.someOrganization.org";
/**
* @desc HTTP Authorization if required
*/
modulepar boolean PICS_USE_TOKEN_HEADER := false;
modulepar charstring PICS_TOKEN_HEADER := "";
/**
* @desc HTTP GET Uri to retrieve the formal description of the ontology
*/
modulepar charstring PICS_OBI_URI := "/someOntology"; // TODO Could it be a Pixit?
}
}
group SecurityAttributes {
......
......@@ -105,14 +105,6 @@ module OneM2M_Pixits {
*/
modulepar PrimitiveScope PX_PRIMITIVE_SCOPE := e_cseRelative;
//WebSocket parameters
modulepar charstring PX_WS_PROTOCOL := "oneM2M.R2.0.xml";
modulepar charstring PX_REQUEST_URI := "/";
//MQTT parameters
modulepar charstring PX_HOSTING_CSE_ID := "CSE-ID";
modulepar charstring PX_CREDENTIAL_ID := "admin:admin";
/**
* @desc Protocol binding to use during test execution
*/
......@@ -173,7 +165,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := 8080, // SUT CoAP/HTTP port
localPort := 3031, // Test Adapter client port (for debug purpose only)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -187,7 +180,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := omit,
localPort := 3041, // Test Adapter listener port (AeSimu acts as server)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -205,7 +199,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := 8080, // SUT CoAP/HTTP port
localPort := 3032, // Test Adapter client port (for debug purpose only)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -219,7 +214,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := omit,
localPort := 3042, // Test Adapter listener port (AeSimu acts as server)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -240,7 +236,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 3131,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -254,7 +251,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= omit,
localPort := 3141,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -268,7 +266,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 4131,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -282,7 +281,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= omit,
localPort := 4141,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -303,7 +303,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 3132,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -317,7 +318,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 3142,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -331,7 +333,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 4132,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -345,14 +348,16 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort:= 8080,
localPort := 4142,
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
serialization := "json"
}
};
modulepar UtDesc PX_TS_UT := { url := "http://127.0.0.1:43000/" };
modulepar UrlDesc PX_TS_UT := { url := "http://127.0.0.1:43000/" };
modulepar AeSimuComponentDesc PX_TS_DAS := { // DAS component settings
aeIdStem := "",
......@@ -365,7 +370,8 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := 8080, // SUT CoAP/HTTP port
localPort := 3033, // Test Adapter client port (for debug purpose only)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
......@@ -379,14 +385,20 @@ module OneM2M_Pixits {
tsAddress := "127.0.0.1",
remotePort := omit,
localPort := 3043, // Test Adapter listener port (AeSimu acts as server)
sutAddress := "127.0.0.1"
sutAddress := "127.0.0.1",
useTls := false
}
}
},
serialization := "xml"
}
};
/**
* @desc Simulated Ontology Server IP address and listening port
*/
modulepar UrlDesc PX_TS_ONTOLOGY_SERVER := { url := "http://127.0.0.1:80/" };
}
group ExecutionParameters {
......
......@@ -64,7 +64,7 @@ module OneM2M_Ports {
UtTriggerAckPrimitive;
out
UtTriggerPrimitive;
map param (in UtDesc p_utDesc)
map param (in UrlDesc p_utDesc)
}
}//end module
......@@ -209,6 +209,13 @@ module OneM2M_Templates {
vendorInformation := *
};
template RequestPrimitive mw_retrieveFormalOntology(template XSD.ID p_targetResourceAddress := ?, template XSD.ID p_originator := ?, template XSD.AnyURI p_ontologyServerUri := ?) modifies mw_retrieve := {
from_ := p_originator,
requestIdentifier := ?,
primitiveContent := { flexContainer := mw_contentFlexContainer(p_ontologyServerUri) },
releaseVersionIndicator := "3"
};
/**
* @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName")
* @param p_targetResourceAddress Target resource address (including "#AttributeName")
......@@ -2232,7 +2239,7 @@ module OneM2M_Templates {
operationExecutionTime := *,
responseType := *,
resultPersistence := omit,
resultContent := omit,
resultContent := int0 ifpresent,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
......@@ -2360,6 +2367,10 @@ module OneM2M_Templates {
notification := p_notification
};
template (present) PrimitiveContent mw_primitiveContentFlexContainer(template (present) FlexContainerResource_optional p_flexContainer := ?) := {
flexContainer := p_flexContainer
};
/**
* @desc Base primitiveContent for CREATE operation for AEAnnc resource
......@@ -7264,7 +7275,30 @@ module OneM2M_Templates {
nodeLink := omit //O
}
template (value) DeviceAirConditioner_optional m_contentDeviceAirConditioner_allOmit := {
template (present) FlexContainerResource_optional mw_contentFlexContainer(
template (present) XSD.AnyURI p_ontologyRef := ?
) := {
resourceName := *,//O
resourceType := *,//NP
resourceID := *,//NP
parentID := *,//NP
creationTime := *,//NP
lastModifiedTime := *,//NP
labels := *,//O
accessControlPolicyIDs := *,//O
expirationTime := *,//O
dynamicAuthorizationConsultationIDs := *, //O
announceTo := *,//O
announcedAttribute := *,//O
stateTag := *,//NP
creator := *,//O
containerDefinition := *, //M
ontologyRef := *, //O
contentSize := *, //NP
nodeLink := * //O
}
template DeviceAirConditioner_optional m_contentDeviceAirConditioner_allOmit := {
resourceName := omit,//O
resourceType := omit,//NP
resourceID := omit,//NP
......
......@@ -4100,13 +4100,17 @@ group OtherTypes {
e_cf03,
e_cf04,
e_cf06,
e_cf06DasSimuMaster
e_cf06DasSimuMaster,
e_cf07,
e_cf07OSSimuMaster
};
type enumerated TestSystemRole {
e_cse,
e_ae,
e_das
e_ae_ipe,
e_das,
e_os
};
type NhURI ParentID;
......@@ -4330,7 +4334,8 @@ group OtherTypes {
charstring tsAddress,
integer remotePort optional,
integer localPort optional,
charstring sutAddress
charstring sutAddress,
boolean useTls
}
/**
......@@ -4359,8 +4364,8 @@ group OtherTypes {
type record MqttBindingDesc {
ProtocolBindings bindingProtocol (e_mqtt),
BindingDesc bindingDesc,
XSD.ID originator,
XSD.ID receiver
XSD.ID originator optional,
XSD.ID receiver optional
}
/**
......@@ -4394,7 +4399,7 @@ group OtherTypes {
* @member requestId
* @member url Test System IP address
*/
type record UtDesc {
type record UrlDesc {
charstring url
}
......
......@@ -727,6 +727,346 @@ module OneM2M_PermutationFunctions {
}//end SUB subgroup
group Onthology_Based_Interworking {
group Registration {
function f_AE_OBI_REG_001() runs on CseSimu {
var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
var template RequestPrimitive v_requestPrimitive := mw_createAe;
var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device";
//primitives for mcaPortIn
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var PrimitiveContent v_resource;
var ResponsePrimitive v_responsePrimitive;
// Test control
if (not(PICS_AE_IPE)) {
setverdict(inconc, "PICS_AE_IPE shall be set");
return;
}
f_cf07Up();
//Send Trigger Message
v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED";
v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED");
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
f_ae_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(-, -, -));
//Test behavior
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_createAe)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : AE-IPE registration request is accepted!!");
v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
//send back responsePrimitive
f_send(e_mcaPortIn, m_response(vc_response.primitive.responsePrimitive));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf07Down();
}
}
group Initialization {
function f_AE_OBI_INI_001() runs on CseSimu {
var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
var template RequestPrimitive v_requestPrimitive := mw_createAe;
var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device";
// Test control
if (not(PICS_AE_IPE) or (not(PICS_TS_ONTOLOGY_SERVER))) {
setverdict(inconc, "PICS_AE_IPE and PICS_TS_ONTOLOGY_SERVER shall be set");
return;
}
f_cf07Up();
//Send Trigger Message