Skip to content
Snippets Groups Projects
Commit 2e5a4064 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Integration of test cases and changes applicable to Release 1 from Release 2 trunk

parent dcd4424f
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 173 2016-11-22 08:10:48Z reinaortega $ * $Id: OneM2M_Functions.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* @desc Module containing functions for oneM2M * @desc Module containing functions for oneM2M
* *
*/ */
...@@ -20,14 +20,15 @@ module OneM2M_Functions { ...@@ -20,14 +20,15 @@ module OneM2M_Functions {
import from OneM2M_TypesAndValues all; import from OneM2M_TypesAndValues all;
import from OneM2M_TestSystem all; import from OneM2M_TestSystem all;
import from OneM2M_Pixits all; import from OneM2M_Pixits all;
import from OneM2M_Pics all;
// import from OneM2M_AdditionalTypes all; // import from OneM2M_AdditionalTypes all;
group configFunctions { group configFunctions {
/** /**
@desc Ports mapping and default behaviour activation for Config 1 @desc Ports mapping and default behaviour activation for Config 1
*/ */
function f_cf01Up() runs on CseTester { function f_cf01Up() runs on CseTester {
// Variables // Variables
...@@ -60,6 +61,22 @@ module OneM2M_Functions { ...@@ -60,6 +61,22 @@ module OneM2M_Functions {
} // end f_cf02Up } // end f_cf02Up
function f_cf03Up() runs on CseTester {
// Variables
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
activate(a_default());
activate(a_cse_cf01());
// Connect
//Initialze the IUT
} // end f_cf03Up
/** /**
* @desc Ports unmapping * @desc Ports unmapping
* @verdict * @verdict
...@@ -83,139 +100,216 @@ module OneM2M_Functions { ...@@ -83,139 +100,216 @@ module OneM2M_Functions {
group cseFunctions { group cseFunctions {
group preambleFunctions { group preambleFunctions {
/**
* @desc Creation of auxiliar resources ACP for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource
* @return Internal ACP resource index
* @verdict
*/
function f_cse_preamble_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi
return f_cse_createAccessControlPolicyAux(p_acpName, p_allowedOperations);
}
/** /**
* @desc Creation of auxiliar resources ACP and AE for correct execution of the test case * @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource * @param p_allowedOperations Allowed operations for the auxiliar AE resource
* @return Internal AE resource index * @return Internal AE resource index
* @verdict * @verdict
*/ */
function f_cse_preamble_registerAe(in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi function f_cse_preamble_registerAe(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit) runs on CseTester return integer {//c_CRUDNDi
var RequestPrimitive v_request; var RequestPrimitive v_request;
var MsgIn v_response; var MsgIn v_response;
var integer v_aeAuxIndex := -1; var integer v_aeAuxIndex := -1;
var integer v_acpAuxIndex := -1;
v_request := valueof(m_createAeAux(p_accessControlPolicyIDs, p_poaList));
if(PX_ACP_SUPPORT){ v_request.to_ := f_getResourceAddress();
v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_allowedOperations := p_allowedOperations);
vc_acpAuxIndex := v_acpAuxIndex; mcaPort.send(m_request(v_request));
}
tc_ac.start;
if(v_acpAuxIndex != -1) { alt {
vc_resourcesIndexToBeDeleted := {v_acpAuxIndex}; [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
v_request := valueof(m_createAeAux(p_accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)})); tc_ac.stop;
log("Preamble: Application registered successfuly");
if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional)) {
vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional;
v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent);
vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_aeAuxIndex};
if(ispresent(vc_aeAux.aE_ID)){
f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID)));
} else {
f_sendAcPrimitive("AE-ID_changed", "0");
}
};
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(inconc, "Preamble: Error while registering application");
stop;
}
[] mcaPort.receive {
tc_ac.stop;
setverdict(inconc, "Preamble: Unexpected message received");
stop;
}
[] tc_ac.timeout {
setverdict(inconc, "Preamble: No answer while registering resource");
stop;
}
}
return v_aeAuxIndex;
}
/**
* @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource
* @return Internal AE resource index
* @verdict
*/
function f_cse_preamble_registerAeWithId(XSD.ID p_appId, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi
var RequestPrimitive v_request;
var MsgIn v_response;
var integer v_aeAuxIndex := -1;
var integer v_acpAuxIndex := -1;
if(PICS_ACP_SUPPORT){
v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_allowedOperations := p_allowedOperations);
vc_acpAuxIndex := v_acpAuxIndex;
}
if(v_acpAuxIndex != -1) {
vc_resourcesIndexToBeDeleted := {v_acpAuxIndex};
v_request := valueof(m_createAe(p_appId, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -));
//TODO Test, to be removed //TODO Test, to be removed
v_request.to_ := f_addPrefix(f_getResourceAddress()); v_request.to_ := f_getResourceAddress();
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
//mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME}))); //mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME})));
} else { } else {
mcaPort.send(m_request(m_createAeAux())); mcaPort.send(m_request(m_createAe(p_appId)));
} }
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop; tc_ac.stop;
log("Preamble: Application registered successfuly"); log("Preamble: Application registered successfuly");
if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional)) { if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional)) {
vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional; vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional;
v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent); v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent);
vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_aeAuxIndex}; vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_aeAuxIndex};
if(ispresent(vc_aeAux.aE_ID)){ if(ispresent(vc_aeAux.aE_ID)){
f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID))); f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID)));
} else { } else {
f_sendAcPrimitive("AE-ID_changed", "0"); f_sendAcPrimitive("AE-ID_changed", "0");
} }
} }
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop; tc_ac.stop;
setverdict(inconc, "Preamble: Error while registering application"); setverdict(inconc, "Preamble: Error while registering application");
stop; stop;
} }
[] mcaPort.receive { [] mcaPort.receive {
tc_ac.stop; tc_ac.stop;
setverdict(inconc, "Preamble: Unexpected message received"); setverdict(inconc, "Preamble: Unexpected message received");
stop; stop;
} }
[] tc_ac.timeout { [] tc_ac.timeout {
setverdict(inconc, "Preamble: No answer while registering resource"); setverdict(inconc, "Preamble: No answer while registering resource");
stop; stop;
} }
} }
return v_aeAuxIndex; return v_aeAuxIndex;
} }
//Added by @Naum //Added by @Naum
function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi
var MsgIn v_response; var MsgIn v_response;
var integer v_serviceSubscribedAppRuleIndex := -1; var integer v_serviceSubscribedAppRuleIndex := -1;
var RequestPrimitive v_request; var RequestPrimitive v_request;
v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {PX_APP_ID}, valueof(p_allowedAEs))); v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {PX_APP_ID}, valueof(p_allowedAEs)));
return v_serviceSubscribedAppRuleIndex; return v_serviceSubscribedAppRuleIndex;
}
} function f_cse_preamble_subscriptionVerification(out CseTester p_notifyHandler,in integer p_aeIndex, inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType ) runs on CseTester {
if(p_resourceType == int23){
p_notifyHandler := CseTester.create("NotifyHandler") alive;
p_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", {"http://" & PX_TESTER_ADDRESS & "/"}), -1); // AE2 is registred
if(ischosen(p_createRequestPrimitive.primitiveContent.any_1[0].Subscription_optional)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced
p_createRequestPrimitive.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_ae2Index)};
}
p_notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(p_aeIndex)));
}
}
}//end group preambleFunctions }//end group preambleFunctions
group postambleFunctions { group postambleFunctions {
/** /**
* @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution * @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
* @verdict * @verdict
*/ */
function f_cse_postamble_deleteResources() runs on CseTester { function f_cse_postamble_deleteResources() runs on CseTester {
var integer i; var integer i;
var XSD.ID v_resourceAddress; var XSD.ID v_resourceAddress;
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
if (PX_RUN_POSTAMBLE) { if (PX_RUN_POSTAMBLE) {
for(i := 0; i < lengthof(vc_resourcesIndexToBeDeleted); i := i + 1) { for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) {
v_resourceAddress := f_getResourceAddress(lengthof(vc_resourcesIndexToBeDeleted)-1 - i); v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]);
v_request := valueof(m_deleteRequest(v_resourceAddress));
v_request := valueof(m_deleteRequest(v_resourceAddress)); if(PX_FROM_IS_AE_ID){
if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) {
v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID;
}
}
mcaPort.send(m_request(v_request));
if(PX_FROM_IS_AE_ID){ tc_ac.start;
if(ischosen(vc_resourcesList[i].resource.any_1[0].AccessControlPolicy_optional)) { alt {
v_request.from_ := PX_AE_ID_STEM; [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
} else { tc_ac.stop;
v_request.from_ := vc_aeAux.aE_ID; log("Postamble: AE Resource deleted");
} }
} [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
mcaPort.send(m_request(v_request)); tc_ac.stop;
log("Postamble: Error while deleting resource");
tc_ac.start; }
alt { [] tc_ac.timeout {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { log("Postamble: No answer while deleting resource");
tc_ac.stop; }
log("Postamble: AE Resource deleted"); }
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { }
tc_ac.stop;
log("Postamble: Error while deleting resource");
}
[] tc_ac.timeout {
log("Postamble: No answer while deleting resource");
}
}
}
}
f_cse_postamble_default(); f_cse_postamble_default();
} }
/** /**
* @desc Default postamble * @desc Default postamble
...@@ -223,159 +317,336 @@ module OneM2M_Functions { ...@@ -223,159 +317,336 @@ module OneM2M_Functions {
*/ */
function f_cse_postamble_default() runs on CseTester { function f_cse_postamble_default() runs on CseTester {
} }
function f_is_component_done(in CseTester p_notifyHandler) runs on CseTester {
tc_ac.start(10.0);
alt {
[] p_notifyHandler.done {
tc_ac.stop;
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": Notify verification not received");
}
}
} //end f_is_component_done
}//end group postambleFunctions }//end group postambleFunctions
group helpingFunctions { group helpingFunctions {
/** /**
* @desc Creation of a resource * @desc Creation of a resource
* @param p_resourceType Resource type of the resource to be created * @param p_resourceType Resource type of the resource to be created
* @param p_requestPrimitive Template request primitive * @param p_requestPrimitive Template request primitive
* @param p_parentIndex Internal resource index which indicates the parent of the resource to be created * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
* @return Internal resource index of the created resource * @return Internal resource index of the created resource
* @verdict * @verdict
*/ */
function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, integer p_parentIndex := -1) runs on CseTester return integer { function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on CseTester return integer {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
var XSD.ID v_resourceId; var XSD.ID v_resourceId;
var integer v_resourceIndex := -1; var integer v_resourceIndex := -1;
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, "f_createResource: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly"); setverdict(pass, "f_createResource: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly");
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_parentIndex); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_parentIndex);
} if(match(int2, p_resourceType) or match(-1, p_parentIndex)) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex};
tc_ac.stop; }
setverdict(inconc, "f_createResource: Error while creating resource type " & int2str(enum2int(p_resourceType))); }
} [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
[] mcaPort.receive { tc_ac.stop;
tc_ac.stop; setverdict(inconc, "f_createResource: Error while creating resource type " & int2str(enum2int(p_resourceType)));
setverdict(inconc, "f_createResource: Unexpected message received"); }
} [] mcaPort.receive {
[] tc_ac.timeout { tc_ac.stop;
setverdict(inconc, "f_createResource: No answer while creating resource type " & int2str(enum2int(p_resourceType))); setverdict(inconc, "f_createResource: Unexpected message received");
} }
} [] tc_ac.timeout {
setverdict(inconc, "f_createResource: No answer while creating resource type " & int2str(enum2int(p_resourceType)));
return v_resourceIndex; }
}
return v_resourceIndex;
} }
/** /**
* @desc Creation of the auxiliar ACP resource * @desc Creation of the auxiliar ACP resource
* @param p_acpName ACP name * @param p_acpName ACP name
* @param p_allowedOperations Allowed operations * @param p_allowedOperations Allowed operations
* @return Internal resource index of the created auxiliar ACP resource * @return Internal resource index of the created auxiliar ACP resource
* @verdict * @verdict
*/ */
function f_cse_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer{ function f_cse_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer{
var RequestPrimitive v_request; var RequestPrimitive v_request;
var MsgIn v_response; var MsgIn v_response;
var integer v_acpAuxIndex := -1; var integer v_acpAuxIndex := -1;
v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_allowedOperations := p_allowedOperations)); v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_allowedOperations := p_allowedOperations));
v_request.to_ := f_addPrefix(f_getResourceAddress()); v_request.to_ := f_getResourceAddress();
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, "f_createAccessControlPolicy: Resource type " & int2str(1) & " created successfuly"); setverdict(pass, "f_createAccessControlPolicy: Resource type " & int2str(1) & " created successfuly");
v_acpAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent); v_acpAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent);
vc_acpAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional;//TODO To be removed vc_acpAuxIndex := v_acpAuxIndex;
} vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_acpAuxIndex};
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { }
tc_ac.stop; [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
setverdict(inconc, "f_createAccessControlPolicy: Error while creating resource type " & int2str(1)); tc_ac.stop;
} setverdict(inconc, "f_createAccessControlPolicy: Error while creating resource type " & int2str(1));
[] mcaPort.receive { }
tc_ac.stop; [] mcaPort.receive {
setverdict(inconc, "f_createAccessControlPolicy: Unexpected message received"); tc_ac.stop;
} setverdict(inconc, "f_createAccessControlPolicy: Unexpected message received");
[] tc_ac.timeout { }
setverdict(inconc, "f_createAccessControlPolicy: No answer while creating resource type " & int2str(1)); [] tc_ac.timeout {
} setverdict(inconc, "f_createAccessControlPolicy: No answer while creating resource type " & int2str(1));
} }
}
return v_acpAuxIndex;
return v_acpAuxIndex;
} }
/** /**
* @desc Creation of the auxiliar Container resource * @desc Creation of the auxiliar Container resource
* @param p_parentIndex Internal resource index which indicates the parent of the Container resource to be created * @param p_parentIndex Internal resource index which indicates the parent of the Container resource to be created
* @return Internal resource index of the created Container resource * @return Internal resource index of the created Container resource
* @verdict * @verdict
*/ */
function f_cse_createContainerResourceAux (integer p_parentIndex := -1) runs on CseTester return integer { function f_cse_createContainerResourceAux (integer p_parentIndex := -1) runs on CseTester return integer {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
var integer v_acpAuxIndex := -1; var integer v_acpAuxIndex := -1;
var integer v_containerResourceIndex := -1; var integer v_containerResourceIndex := -1;
v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_acpName := c_acpAuxName);//"MyAcp_2" v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_acpName := c_acpAuxName);//"MyAcp_2"
v_request := valueof(m_createContainerBase); v_request := valueof(m_createContainerBase);
v_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}; v_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)};
v_request.primitiveContent.any_1[0].Container_optional.resourceName := "MyContainerAux"; v_request.primitiveContent.any_1[0].Container_optional.resourceName := "MyContainerAux";
v_containerResourceIndex := f_cse_createResource(int3, v_request, p_parentIndex); v_containerResourceIndex := f_cse_createResource(int3, v_request, p_parentIndex);
return v_containerResourceIndex; return v_containerResourceIndex;
} }
/** /**
* @desc Update of the auxiliar ACP resource * @desc
* @param p_allowedOperations New allowed operations * @param p_requestPrimitive
* @verdict * @verdict
*/ */
function f_cse_updateAcpAuxResource (in template (value) AccessControlOperations p_allowedOperations) runs on CseTester { function f_cse_updateResource(in RequestPrimitive p_requestPrimitive) runs on CseTester {
var RequestPrimitive v_request; var MsgIn v_response;
v_request := valueof(m_updateAcpBase); mcaPort.send(m_request(p_requestPrimitive));
tc_ac.start;
v_request.to_ := f_addPrefix(f_getResourceAddress(vc_acpAuxIndex)); alt {
v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
{ tc_ac.stop;
accessControlOriginators := PX_ACOR, //{"admin:admin"} setverdict(pass, testcasename() & ": Attribute of resource updated successfuly");
accessControlOperations := valueof(p_allowedOperations), }
accessControlContexts_list := {} [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
} tc_ac.stop;
}; setverdict(fail, testcasename() & ": Error while updating resource");
}
[] mcaPort.receive{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, unexpected message received");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
}
}// end f_cse_updateResource
/**
* @desc Update of the auxiliar ACP resource
* @param p_allowedOperations New allowed operations
* @verdict
*/
function f_cse_updateAcpAuxResource (in template (value) AccessControlOperations p_allowedOperations) runs on CseTester {
var RequestPrimitive v_request;
v_request := valueof(m_updateAcpBase);
v_request.to_ := f_getResourceAddress(vc_acpAuxIndex);
v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := {
{
accessControlOriginators := PX_ACOR, //{"admin:admin"}
accessControlOperations := valueof(p_allowedOperations),
accessControlContexts_list := {}
}
};
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop; tc_ac.stop;
setverdict(pass, "f_updateAcpAuxResource: " & v_request.to_ & " resource updated successfuly"); setverdict(pass, "f_updateAcpAuxResource: " & v_request.to_ & " resource updated successfuly");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop; tc_ac.stop;
setverdict(fail, "f_updateAcpAuxResource: Error while updating " & v_request.to_ & " resource"); setverdict(fail, "f_updateAcpAuxResource: Error while updating " & v_request.to_ & " resource");
} }
[] tc_ac.timeout { [] tc_ac.timeout {
setverdict(inconc, "f_updateAcpAuxResource: No answer while updating " & v_request.to_ & " resource" ); setverdict(inconc, "f_updateAcpAuxResource: No answer while updating " & v_request.to_ & " resource" );
} }
} }
} }
function f_subscriptionVerificationHandler(in XSD.ID p_creator, in ResponseStatusCode v_responseStatusCode := int2001) runs on CseTester {
// Local variables
var MsgIn v_response;
var ResponsePrimitive v_responsePrimitive;
var template Notification v_notificationRequest := mw_contentNotificationBase;
var PrimitiveContent v_notificationResponse; // TODO Need to see if this parameter is required however there is a problem if it s omitted during the verification
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
v_notificationResponse.any_1 := {{Notification := valueof(mw_contentNotificationAllOmit)}};
v_notificationRequest.verificationRequest := true;
v_notificationRequest.creator := p_creator;
//v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter
v_responsePrimitive := valueof(m_responseNotification(v_responseStatusCode,v_notificationResponse));//TODO No PrimitiveContent is expected
if(v_responseStatusCode != int2001){
v_responsePrimitive.primitiveContent := omit;
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Notification received");
//mcaPort.send(m_response(p_responsePrimitive));
}
[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Notification received but verificationRequest isn't set to TRUE");
}
[] mcaPort.receive{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, unexpected message received");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No notification received");
}
}
mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
} //end f_subscriptionVerificationHandler
function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{
// Local variables
var boolean v_matchResult := false;
var integer i;
var integer v_numberOfAggregatedNotification;
if (ischosen(p_primitiveContent.any_1[0].AE_optional)){
if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource)) {
v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource.AE_optional, p_primitiveContent.any_1[0].AE_optional)
}
else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive)) {
v_matchResult :=match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].AE_optional, p_primitiveContent.any_1[0].AE_optional)
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification)) {
v_matchResult := true;
v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list);
for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){
if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.resource)) {
if(not (match(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.resource.AE_optional, p_primitiveContent.any_1[0].AE_optional))){
v_matchResult := false;
}
}
else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive)) {
if(not (match(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].AE_optional, p_primitiveContent.any_1[0].AE_optional))){
v_matchResult := false;
}
}
}
if (i == 0){
v_matchResult := false;
}
}
}
if (ischosen(p_primitiveContent.any_1[0].Container_optional)){
if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource)) {
v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource.Container_optional, p_primitiveContent.any_1[0].Container_optional)
}
else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive)) {
v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].Container_optional, p_primitiveContent.any_1[0].Container_optional)
}
}
return v_matchResult;
} //end f_check_notificationContent
function f_cse_notifyProcedure(template PrimitiveContent p_primitiveContent) runs on CseTester {
// Local variables
var MsgIn v_response;
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
tc_ac.start;
alt {
[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response {
tc_ac.stop;
if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){
setverdict(pass, testcasename() & ": Notification received");
mcaPort.send(m_response(valueof(m_responseNotification(int2001))));
}
else{
setverdict(fail, testcasename() & ": Notification received but the content doesn't match");
}
}
[] mcaPort.receive{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, unexpected message received");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No notification received");
}
}
}//end group helpingFunctions
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
} //end f_cse_notifyProcedure
}//end group helpingFunctions
group altstepFunctions { group altstepFunctions {
...@@ -439,26 +710,40 @@ module OneM2M_Functions { ...@@ -439,26 +710,40 @@ module OneM2M_Functions {
* @return Created CREATE request primitive * @return Created CREATE request primitive
* @verdict * @verdict
*/ */
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request, integer p_parentIndex) runs on CseTester return RequestPrimitive { function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on CseTester return RequestPrimitive {
var integer p_locresourceIndex := p_parentIndex;
var template ListOfURIs v_notificationURI := {"Not Initialized"};
p_request.from_ := f_getOriginator(p_parentIndex); p_request.from_ := f_getOriginator(p_parentIndex);
p_request.to_ := f_getResourceAddress(p_parentIndex);
p_request.to_ := f_addPrefix(f_getResourceAddress(p_parentIndex));
if (p_resourceType == int1) {//AccessControlPolicy if (p_resourceType == int1) {//AccessControlPolicy
} }
if (p_resourceType == int9) {//group if (p_resourceType == int9) {//group
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)}; p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
} }
if(p_resourceType == int3){//container
//when a container is created by hosting cse for storing location information, the container is seen as a location container
if(PX_IS_LOC_CONTAINER){
p_request.primitiveContent.any_1[0].Container_optional.locationID := f_getResourceId(vc_resourcesList[p_locresourceIndex].resource);//resourceID of the locationPolicy
}
}
if (p_resourceType == int15) {//pollingChannel if (p_resourceType == int15) {//pollingChannel
p_request.from_ := vc_aeAux.aE_ID; if(ischosen(vc_resourcesList[p_parentIndex].resource.any_1[0].AE_optional)) {
p_request.from_ := vc_resourcesList[p_parentIndex].resource.any_1[0].AE_optional.aE_ID;
}
}
if (p_resourceType == int18) {//schedule
} }
if (p_resourceType == int23) {//subscription if (p_resourceType == int23) {//subscription
p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_parentIndex)}; if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_notificationURI )){
p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_parentIndex)};
}
/*if(PX_FROM_IS_AE_ID) { /*if(PX_FROM_IS_AE_ID) {
if(PX_UNSTRUCTURED){ if(PX_UNSTRUCTURED){
p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {vc_aeAux.aE_ID}; p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {vc_aeAux.aE_ID};
...@@ -485,7 +770,7 @@ module OneM2M_Functions { ...@@ -485,7 +770,7 @@ module OneM2M_Functions {
p_request.from_ := f_getOriginator(p_resourceIndex); p_request.from_ := f_getOriginator(p_resourceIndex);
p_request.to_ := f_addPrefix(f_getResourceAddress(p_resourceIndex)); p_request.to_ := f_getResourceAddress(p_resourceIndex);
if (p_resourceType == int3) {//Container if (p_resourceType == int3) {//Container
...@@ -589,7 +874,7 @@ module OneM2M_Functions { ...@@ -589,7 +874,7 @@ module OneM2M_Functions {
function f_getOriginator(integer p_targetResourceIndex := -1) runs on CseTester return XSD.AnyURI { function f_getOriginator(integer p_targetResourceIndex := -1) runs on CseTester return XSD.AnyURI {
if(p_targetResourceIndex == -1) { if(p_targetResourceIndex == -1) {
return PX_AE_ID_STEM; return PX_SUPER_USER;
} }
if(PX_FROM_IS_AE_ID) { if(PX_FROM_IS_AE_ID) {
...@@ -599,7 +884,7 @@ module OneM2M_Functions { ...@@ -599,7 +884,7 @@ module OneM2M_Functions {
return f_getOriginator(vc_resourcesList[p_targetResourceIndex].parentIndex); return f_getOriginator(vc_resourcesList[p_targetResourceIndex].parentIndex);
} }
} else { } else {
return PX_AE_ID_STEM; return PX_SUPER_USER;
} }
} }
...@@ -669,15 +954,17 @@ module OneM2M_Functions { ...@@ -669,15 +954,17 @@ module OneM2M_Functions {
} else if (PX_ADDRESSING_FORMAT == e_absolute) { } else if (PX_ADDRESSING_FORMAT == e_absolute) {
if(PX_UNSTRUCTURED) { if(PX_UNSTRUCTURED) {
if(p_targetResourceIndex == -1) { if(p_targetResourceIndex == -1) {
return ""; return "//" &"SpId" & "/" & PX_CSE_ID;
} else { } else {
return ""; v_resourceAddress := f_getResourceAddress() & "/" & f_getResourceId(vc_resourcesList[p_targetResourceIndex].resource);
return v_resourceAddress;
} }
} else { } else {
if(p_targetResourceIndex == -1) { if(p_targetResourceIndex == -1) {
return ""; return "//" &"SpId" & "/" & PX_CSE_ID & "/" & PX_CSE_NAME;
} else { } else {
return ""; v_resourceAddress := f_getResourceAddress(vc_resourcesList[p_targetResourceIndex].parentIndex) & "/" & f_getResourceName(vc_resourcesList[p_targetResourceIndex].resource);
return v_resourceAddress;
} }
} }
} else { } else {
...@@ -692,7 +979,7 @@ module OneM2M_Functions { ...@@ -692,7 +979,7 @@ module OneM2M_Functions {
* @return Internal resource index of the saved resource * @return Internal resource index of the saved resource
* @verdict * @verdict
*/ */
function f_setResource(PrimitiveContent p_resource, integer p_parentIndex := -1) runs on CseTester return integer { function f_setResource(PrimitiveContent p_resource, integer p_parentIndex := -1) runs on Tester return integer {
if(isbound(vc_resourcesList)) { if(isbound(vc_resourcesList)) {
vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resource}; vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resource};
...@@ -702,6 +989,37 @@ module OneM2M_Functions { ...@@ -702,6 +989,37 @@ module OneM2M_Functions {
return lengthof(vc_resourcesList)-1; return lengthof(vc_resourcesList)-1;
} }
/**
* @desc Set Acpid into the requestPrimitive
* @param p_requestPrimitive RequestPrimitive to be modified
* @param p_accessControlPolicyIDs AcpId to be set
* @return
* @verdict
*/
function f_setAcpId(template RequestPrimitive p_requestPrimitive, template AcpType p_accessControlPolicyIDs) runs on CseTester return RequestPrimitive{
if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].AE_optional)){
p_requestPrimitive.primitiveContent.any_1[0].AE_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Container_optional)){
p_requestPrimitive.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Group_optional)){
p_requestPrimitive.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].ServiceSubscribedAppRule_optional)){
p_requestPrimitive.primitiveContent.any_1[0].ServiceSubscribedAppRule_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Subscription_optional)){
p_requestPrimitive.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].LocationPolicy_optional)){
p_requestPrimitive.primitiveContent.any_1[0].LocationPolicy_optional.accessControlPolicyIDs := p_accessControlPolicyIDs;
}
return valueof(p_requestPrimitive);
}
}//end group getSetFunctions }//end group getSetFunctions
...@@ -738,16 +1056,5 @@ module OneM2M_Functions { ...@@ -738,16 +1056,5 @@ module OneM2M_Functions {
}//end group altstepFunctions }//end group altstepFunctions
}//end of commonFunctions }//end of commonFunctions
} // end of module } // end of module
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $
* $Id: OneM2M_Pixits.ttcn 103 2016-08-30 09:39:32Z reinaortega $ * $Id: OneM2M_Pixits.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* @desc Module containing Pixits for oneM2M * @desc Module containing Pixits for oneM2M
* *
*/ */
...@@ -15,26 +15,32 @@ module OneM2M_Pixits { ...@@ -15,26 +15,32 @@ module OneM2M_Pixits {
import from XSD all; import from XSD all;
import from OneM2M_Types all; import from OneM2M_Types all;
group testAdapterParameters {}
modulepar boolean PX_DELETE_CREATED_RESOURCES := true; modulepar boolean PX_DELETE_CREATED_RESOURCES := true;
modulepar charstring PX_RESOURCE_TO_BE_DELETED := "/ae_test"; modulepar XSD.AnyURI PX_RESOURCE_TO_BE_DELETED := "/ae_test";
modulepar XSD.IDREFS PX_RESOURCES_TO_BE_DELETED := {"/ae_test", "/MyAcp"}; modulepar XSD.IDREFS PX_RESOURCES_TO_BE_DELETED := {"/ae_test", "/MyAcp"};
modulepar charstring PX_HOST_ADDRESS := "127.0.0.1:8080"; modulepar charstring PX_SUT_ADDRESS := "127.0.0.1:8080";
modulepar charstring PX_TESTER_ADDRESS := "127.0.0.1:3131";
modulepar charstring PX_XML_NAMESPACE := "om2m=""http://www.onem2m.org/xml/protocols"""; modulepar charstring PX_XML_NAMESPACE := "om2m=""http://www.onem2m.org/xml/protocols""";
modulepar charstring PX_CSE_NAME := "in-cse"; modulepar XSD.ID PX_CSE_NAME := "in-name";
modulepar charstring PX_URI_CSE := "/~/in-cse"; modulepar XSD.AnyURI PX_URI_CSE := "in-name";//TODO to be deleted
modulepar boolean PX_UNSTRUCTURED := false; modulepar boolean PX_UNSTRUCTURED := false;
modulepar charstring PX_AE_ID_STEM := "admin:admin"; modulepar XSD.ID PX_AE_ID_STEM := "";
modulepar XSD.ID PX_SUPER_USER := "admin:admin";
modulepar charstring PX_APP_ID := "myAppId"; modulepar XSD.ID PX_APP_ID := "myAppId";
modulepar boolean PX_RUN_POSTAMBLE := true; modulepar boolean PX_RUN_POSTAMBLE := true;
...@@ -42,25 +48,29 @@ module OneM2M_Pixits { ...@@ -42,25 +48,29 @@ module OneM2M_Pixits {
modulepar AddressingFormat PX_ADDRESSING_FORMAT := e_cseRelative; modulepar AddressingFormat PX_ADDRESSING_FORMAT := e_cseRelative;
modulepar charstring PX_SERIALIZATION := "JSON"; modulepar charstring PX_SERIALIZATION := "XML";
modulepar charstring PX_PROTOCOL_BINDING := "HTTP"; modulepar charstring PX_PROTOCOL_BINDING := "HTTP";
modulepar XSD.ID PX_CSE_ID := "in-cse";
modulepar boolean PX_ACP_SUPPORT := true; modulepar boolean PX_FROM_IS_AE_ID := true;
//@Martin
modulepar charstring PX_CSE_ID := "in-cse"; //for checking whether the locationPolicy creation request is originated from a ASN-AE
//NOTE: Apply to Device-based location request, and this requires Test System (TS) to activate ASN-AE mode to test IUT
modulepar boolean PX_FROM_IS_AE_ID := false; modulepar boolean PX_IUT_IS_ASN_CSE := false; //default //set it to true when running Device-based location testcases
modulepar boolean PX_IUT_IS_MN_CSE := false; //default //set it to true when running Share-based location testcases
//@Martin //@Martin
//constant parameters for LOC //constant parameters for LOC
modulepar LocationSource PX_LOCATION_SOURCE := int1;//network-defined modulepar XSD.Token PX_LOCATION_TARGET_ID := "{LOCATION-TARGET-ID}"; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER
modulepar charstring PX_LOCATION_TARGET_ID := "{LOCATION-TARGET-ID}"; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER modulepar XSD.AnyURI PX_LOCATION_SERVER_ADDRESS := "{LOCATION-SERVER-ADDRESS}";
modulepar charstring PX_LOCATION_SERVER_ADDRESS := "{LOCATION-SERVER-ADDRESS}";
modulepar charstring PX_LOCATION_UPDATE_PERIOD := "PT10M10S" ;//10 Minute 10 Seconds modulepar charstring PX_LOCATION_UPDATE_PERIOD := "PT10M10S" ;//10 Minute 10 Seconds
modulepar charstring PX_LOCATION_UPDATE_PERIOD_INVALID := "-PT30M10S" ;//duration set to invalid value (minus value) modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer";
modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer";
modulepar Labels LABELS := {"VALUE_1"}; modulepar Labels LABELS := {"VALUE_1"};
modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information
} // end of module } // end of module
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $
* $Id: OneM2M_TestSystem.ttcn 105 2016-08-31 13:01:46Z reinaortega $ * $Id: OneM2M_TestSystem.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* @desc Test System module for oneM2M * @desc Test System module for oneM2M
* *
*/ */
...@@ -47,7 +47,7 @@ module OneM2M_TestSystem { ...@@ -47,7 +47,7 @@ module OneM2M_TestSystem {
timer tc_wait; timer tc_wait;
//global variables //global variables
var MyResourcesList vc_resourcesList; var MyResourcesList vc_resourcesList;
var IntegerList vc_resourcesIndexToBeDeleted; var IntegerList vc_resourcesIndexToBeDeleted := {};
} }
type component CseTester extends Tester { type component CseTester extends Tester {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Types.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Types.ttcn $
* $Id: OneM2M_Types.ttcn 173 2016-11-22 08:10:48Z reinaortega $ * $Id: OneM2M_Types.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* @desc Test System module for oneM2M * @desc Test System module for oneM2M
* *
*/ */
...@@ -3228,11 +3228,17 @@ with { ...@@ -3228,11 +3228,17 @@ with {
variant (notification_list[-]) "name as 'notification'"; variant (notification_list[-]) "name as 'notification'";
}; };
//FIXME To be added
type union Representation {
anytype resource,
ResponsePrimitive responsePrimitive
};
type record Notification_1 type record Notification_1
{ {
record { record {
XSD.AnyType representation optional, //XSD.AnyType representation optional, To be exchanged by Representation
Representation representation optional,
record { record {
XSD.AnyType representation optional, XSD.AnyType representation optional,
record { record {
...@@ -4664,5 +4670,5 @@ with { ...@@ -4664,5 +4670,5 @@ with {
encode "XML"; encode "XML";
variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'"; variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
extension "anytype ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, ContentInstance_update_invalid, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid" extension "anytype AggregatedResponse, AggregatedNotification,Notification, ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, ContentInstance_update_invalid, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid"
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $
* $Id: OneM2M_TypesAndValues.ttcn 102 2016-08-30 09:28:49Z reinaortega $ * $Id: OneM2M_TypesAndValues.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* @desc Module containing types and values for oneM2M * @desc Module containing types and values for oneM2M
* *
*/ */
...@@ -22,6 +22,7 @@ module OneM2M_TypesAndValues { ...@@ -22,6 +22,7 @@ module OneM2M_TypesAndValues {
const XSD.String c_defaultResourceName := "MyResource"; const XSD.String c_defaultResourceName := "MyResource";
const charstring c_aeAuxName := "MyAe"; const charstring c_aeAuxName := "MyAe";
const XSD.String c_acpAuxName := "MyAcp"; const XSD.String c_acpAuxName := "MyAcp";
const charstring c_invalid_location_update_period := "-PT30M10S" ;//duration set to invalid value (minus value)
//AccessControlOperations //AccessControlOperations
const XSD.Integer c_C := 1; const XSD.Integer c_C := 1;
...@@ -89,6 +90,8 @@ module OneM2M_TypesAndValues { ...@@ -89,6 +90,8 @@ module OneM2M_TypesAndValues {
const XSD.Integer c_CRUDNDi := 63; const XSD.Integer c_CRUDNDi := 63;
type NhURI ParentID; type NhURI ParentID;
type record length(0 .. infinity) of RequestPrimitive RequestPrimitiveList;
type record length(1 .. infinity) of RequestPrimitiveList RequestPrimitiveMatrix;
} }
// end of module // end of module
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment