Commit 56eaab06 authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Merge branch 'Release1' of https://git.onem2m.org/TST/ATS into Release1

parents 656c88af 4882a091
...@@ -1691,13 +1691,19 @@ module OneM2M_Functions { ...@@ -1691,13 +1691,19 @@ module OneM2M_Functions {
* @return Internal resource index of AE or -1 in case of failure * @return Internal resource index of AE or -1 in case of failure
* @verdict inconc if no AE registration request is received * @verdict inconc if no AE registration request is received
*/ */
function f_ae_preamble_registerAe() runs on CseSimu return integer { function f_ae_preamble_registerAe(template UtTriggerPrimitive p_utRequest := m_create) runs on CseSimu return integer {
var MsgIn v_request; var MsgIn v_request;
var PrimitiveContent v_modifiedResource; var PrimitiveContent v_modifiedResource;
var integer v_resourceIndex, v_parentIndex; var integer v_resourceIndex, v_parentIndex;
var RequestPrimitive v_rp; var RequestPrimitive v_rp;
if(not(ispresent(p_utRequest.primitiveContent))) {
p_utRequest.primitiveContent.aE := m_contentCreateAe(omit, omit, omit, omit);
}
f_sendUtPrimitive(p_utRequest);
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_request(mw_createAe)) -> value v_request { [] mcaPort.receive(mw_request(mw_createAe)) -> value v_request {
...@@ -1725,7 +1731,55 @@ module OneM2M_Functions { ...@@ -1725,7 +1731,55 @@ module OneM2M_Functions {
f_checkCseSimuStatus(); f_checkCseSimuStatus();
return v_resourceIndex; return v_resourceIndex;
} }//end function f_ae_preamble_register
/**
* @desc Waits for Container create request and process it
* @return Internal resource index of Container or -1 in case of failure
* @verdict inconc if no Container create request is received
*/
function f_ae_preamble_createContainer(template UtTriggerPrimitive p_utRequest := m_create) runs on CseSimu return integer {
var MsgIn v_request;
var PrimitiveContent v_modifiedResource;
var integer v_resourceIndex, v_parentIndex;
var RequestPrimitive v_rp;
if(not(ispresent(p_utRequest.primitiveContent))) {
p_utRequest.primitiveContent.container := m_contentCreateContainer;
}
f_sendUtPrimitive(p_utRequest);
tc_ac.start;
alt {
[] mcaPort.receive(mw_request(mw_createContainer(?,?))) -> value v_request {
tc_ac.stop;
v_rp := v_request.primitive.requestPrimitive;
v_parentIndex := f_getResourceIndex(v_rp.to_);
v_resourceIndex := f_ae_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource);
if(v_resourceIndex != -1) {
mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource)));
setverdict(pass, __SCOPE__&":INFO: Container created successfuly");
}
else {
mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)));
setverdict(inconc, __SCOPE__&":INFO: Container creation failed");
}
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: Container create request not received");
stop;
}
}
f_checkCseSimuStatus();
return v_resourceIndex;
} //end function f_ae_preamble_createContainer
} // end preambleFunctions } // end preambleFunctions
...@@ -2556,6 +2610,31 @@ module OneM2M_Functions { ...@@ -2556,6 +2610,31 @@ module OneM2M_Functions {
} }
function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest) runs on Tester {
p_utRequest.from_ := "UNINITIALIZED";
p_utRequest.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000);
utPort.send(valueof(p_utRequest));
tc_wait.start;
alt{
[] utPort.receive(mw_utResponseOK) {
tc_wait.stop;
setverdict(pass, __SCOPE__, " : Triggering message is successfully received!");
}
[] utPort.receive(mw_utResponseKO) {
tc_wait.stop;
setverdict(inconc, __SCOPE__, " : Error while receiving Triggering message!");
}
[] tc_wait.timeout{
setverdict(inconc, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
}
group AltstepFunctions { group AltstepFunctions {
/** /**
......
...@@ -22,5 +22,9 @@ module OneM2M_Pics { ...@@ -22,5 +22,9 @@ module OneM2M_Pics {
modulepar boolean PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true; modulepar boolean PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true; modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_CSE_RELATIVE := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_SP_RELATIVE := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_ABSOLUTE := true;
} // end of module } // end of module
...@@ -52,4 +52,15 @@ module OneM2M_Ports { ...@@ -52,4 +52,15 @@ module OneM2M_Ports {
RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource; RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource;
} }
/**
* @desc Port to transport control commands to Upper Tester Application
*/
type port UpperTesterPort message {
in
UtTriggerAckPrimitive;
out
UtTriggerPrimitive;
}
}//end module }//end module
...@@ -120,6 +120,32 @@ module OneM2M_Templates { ...@@ -120,6 +120,32 @@ module OneM2M_Templates {
filterCriteria := omit, filterCriteria := omit,
discoveryResultType := omit discoveryResultType := omit
}; };
/**
* @desc Base Receive RETRIEVE request primitive
* @param p_targetResourceAddress Target resource address
*/
template RequestPrimitive mw_retrieveResource(XSD.ID p_targetResourceAddress) := {
operation := int2,
to_ := p_targetResourceAddress,
from_ := ?,
requestIdentifier := ?,
resourceType := ?,
primitiveContent := ?,
role := *,
originatingTimestamp := *,
requestExpirationTimestamp := *,
resultExpirationTimestamp := *,
operationExecutionTime := *,
responseType := *,
resultPersistence := *,
resultContent := *,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
filterCriteria := *,
discoveryResultType := *
};
/** /**
* @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName") * @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName")
...@@ -315,6 +341,29 @@ module OneM2M_Templates { ...@@ -315,6 +341,29 @@ module OneM2M_Templates {
filterCriteria := omit, filterCriteria := omit,
discoveryResultType := omit discoveryResultType := omit
}; };
template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
operation := int3,
to_ := p_to,
from_ := p_from,
requestIdentifier := ?,
resourceType := ?,
primitiveContent:= ?,
role := *,
originatingTimestamp := *,
requestExpirationTimestamp := *,
resultExpirationTimestamp := *,
operationExecutionTime := *,
responseType := *,
resultPersistence := *,
resultContent := *,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
filterCriteria := *,
discoveryResultType := *
};
/** /**
* @desc Base UPDATE request primitive for Ae resource * @desc Base UPDATE request primitive for Ae resource
...@@ -323,6 +372,16 @@ module OneM2M_Templates { ...@@ -323,6 +372,16 @@ module OneM2M_Templates {
requestIdentifier := "m_updateAe", requestIdentifier := "m_updateAe",
primitiveContent:= {aE := m_contentUpdateAe} primitiveContent:= {aE := m_contentUpdateAe}
}; };
/**
* @desc Reception template for update Ae resource
*/
template RequestPrimitive mw_updateAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
resourceType := int2,
primitiveContent:= {aE := ?}
};
/** /**
* @desc Base UPDATE request primitive for Container resource * @desc Base UPDATE request primitive for Container resource
...@@ -332,6 +391,14 @@ module OneM2M_Templates { ...@@ -332,6 +391,14 @@ module OneM2M_Templates {
primitiveContent:= {container := m_contentUpdateContainer} primitiveContent:= {container := m_contentUpdateContainer}
}; };
/**
* @desc Base Reception template for update Container
*/
template RequestPrimitive mw_updateContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
resourceType := int3,
primitiveContent := {container := ?}
};
/** /**
* @desc Base UPDATE request primitive for ContentInstance resource * @desc Base UPDATE request primitive for ContentInstance resource
*/ */
...@@ -505,9 +572,9 @@ module OneM2M_Templates { ...@@ -505,9 +572,9 @@ module OneM2M_Templates {
/** /**
* @desc Reception template for AE registration * @desc Reception template for AE registration
*/ */
template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := ?) modifies mw_create := {
resourceType := int2, resourceType := int2,
primitiveContent := {aE := ?} primitiveContent := {aE := p_ae}
}; };
template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := { template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
...@@ -656,7 +723,15 @@ module OneM2M_Templates { ...@@ -656,7 +723,15 @@ module OneM2M_Templates {
template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
resourceType := int10014, resourceType := int10014,
primitiveContent := {contentInstanceAnnc := ?} primitiveContent := {contentInstanceAnnc := ?}
}; };
/**
* @desc Reception template for CREATE ContentInstance
*/
template RequestPrimitive mw_createContentInstance(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
resourceType := int4,
primitiveContent := {contentInstance := ?}
};
/** /**
* @desc Base Reception template for CREATE ContentInstanceAnnc * @desc Base Reception template for CREATE ContentInstanceAnnc
...@@ -861,6 +936,14 @@ module OneM2M_Templates { ...@@ -861,6 +936,14 @@ module OneM2M_Templates {
resourceType := int23, resourceType := int23,
primitiveContent := {subscription := m_contentCreateSubscription (p_notificationURI, p_name)} primitiveContent := {subscription := m_contentCreateSubscription (p_notificationURI, p_name)}
}; };
/**
* @desc Reception template for CREATE Subscription
*/
template RequestPrimitive mw_createSubscription(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
resourceType := int23,
primitiveContent := {subscription := ?}
};
template (value) RequestPrimitive m_createSubscriptionAdvanced( XSD.ID p_parentResourceAddress, template (value) RequestPrimitive m_createSubscriptionAdvanced( XSD.ID p_parentResourceAddress,
in template (omit) XSD.String p_name := omit, in template (omit) XSD.String p_name := omit,
...@@ -967,14 +1050,86 @@ module OneM2M_Templates { ...@@ -967,14 +1050,86 @@ module OneM2M_Templates {
filterCriteria := omit, filterCriteria := omit,
discoveryResultType := omit discoveryResultType := omit
}; };
template RequestPrimitive mw_deleteRequest(template XSD.ID p_resourceAddress := ?) := {
operation := int4,
to_ := p_resourceAddress,
from_ := ?,
requestIdentifier := ?,
resourceType := *,
primitiveContent := *,
role := *,
originatingTimestamp := *,
requestExpirationTimestamp := *,
resultExpirationTimestamp := *,
operationExecutionTime := *,
responseType := *,
resultPersistence := *,
resultContent := *,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
filterCriteria := *,
discoveryResultType := *
};
}//end group Delete }//end group Delete
group Notify { group Notify {
/** /**
* @desc Base NOTIFY request primitive * @desc Base NOTIFY request primitive
*/ */
template RequestPrimitive m_notifyRequest := {
operation := int5,
to_ := "NotInitialized",
from_ := omit,
requestIdentifier := testcasename() & "-m_notifyRequest" & f_rnd(1, 1000000),
resourceType := omit,
primitiveContent := {notification := m_contentCreateNotification_allOmit},
role := omit,
originatingTimestamp := omit,
requestExpirationTimestamp := omit,
resultExpirationTimestamp := omit,
operationExecutionTime := omit,
responseType := omit,
resultPersistence := omit,
resultContent := omit,
eventCategory := omit,
deliveryAggregation := omit,
groupRequestIdentifier := omit,
filterCriteria := omit,
discoveryResultType := omit
};
/**
* @desc Base NOTIFY Aggregated request primitive
*/
template RequestPrimitive m_notifyAggregatedRequest := {
operation := int5,
to_ := "NotInitialized",
from_ := omit,
requestIdentifier := testcasename() & "-m_notifyAggregatedRequest" & f_rnd(1, 1000000),
resourceType := omit,
primitiveContent := {aggregatedNotification := {notification_list := {m_contentCreateNotification_allOmit,m_contentCreateNotification_allOmit}}},
role := omit,
originatingTimestamp := omit,
requestExpirationTimestamp := omit,
resultExpirationTimestamp := omit,
operationExecutionTime := omit,
responseType := omit,
resultPersistence := omit,
resultContent := omit,
eventCategory := omit,
deliveryAggregation := omit,
groupRequestIdentifier := omit,
filterCriteria := omit,
discoveryResultType := omit
};
/**
* @desc Base NOTIFY request primitive
*/
template RequestPrimitive mw_notifyBase := { template RequestPrimitive mw_notifyBase := {
operation := int5, operation := int5,
to_ := ?, to_ := ?,
...@@ -1038,6 +1193,22 @@ module OneM2M_Templates { ...@@ -1038,6 +1193,22 @@ module OneM2M_Templates {
group ContentCreate { group ContentCreate {
template PrimitiveContent m_primitiveContentAe(template AE_optional p_ae) := {
aE := p_ae
}
template PrimitiveContent m_primitiveContentContainer(template Container_optional p_container) := {
container := p_container
}
template PrimitiveContent m_primitiveContentContentInstance(template ContentInstance_optional p_contentInstance) := {
contentInstance := p_contentInstance
}
template PrimitiveContent m_primitiveContentCSEBase(template CSEBase_optional p_cSEBase) := {
cSEBase := p_cSEBase
}
template PrimitiveContent mw_primitiveContent := ?; template PrimitiveContent mw_primitiveContent := ?;
/** /**
...@@ -1564,9 +1735,9 @@ module OneM2M_Templates { ...@@ -1564,9 +1735,9 @@ module OneM2M_Templates {
notificationEventType_list := p_notificationEventType_list// TODO this list should be able to be omited see 9.6.8 (TS0001) notificationEventType_list := p_notificationEventType_list// TODO this list should be able to be omited see 9.6.8 (TS0001)
}; };
template (value) BatchNotify m_batchNotify (in XSD.NonNegativeInteger p_number) := { template (value) BatchNotify m_batchNotify (in XSD.NonNegativeInteger p_number, in XSD.Duration p_duration := "PT20S") := {
number := p_number, number := p_number,
duration := "PT5S" //TODO duration has to be set to 1s and match to the Duration regex duration := p_duration //TODO duration has to be set to 1s and match to the Duration regex
}; };
//normaly duration can be omited //normaly duration can be omited
...@@ -1595,7 +1766,7 @@ module OneM2M_Templates { ...@@ -1595,7 +1766,7 @@ module OneM2M_Templates {
ontologyRef := omit,//O ontologyRef := omit,//O
content := p_primitiveContent//M content := p_primitiveContent//M
}; };
/** /**
* @desc Base primitiveContent for CREATE operation for ContentInstanceAnnc resource * @desc Base primitiveContent for CREATE operation for ContentInstanceAnnc resource
* @param p_primitiveContent Content for the ContentInstanceAnnc * @param p_primitiveContent Content for the ContentInstanceAnnc
...@@ -1784,6 +1955,22 @@ module OneM2M_Templates { ...@@ -1784,6 +1955,22 @@ module OneM2M_Templates {
notificationForwardingURI := p_notifForwardingURI notificationForwardingURI := p_notifForwardingURI
}; };
template (value) Notification m_contentCreateNotification_allOmit := {
notificationEvent := {
representation := omit,
operationMonitor := {
operation := omit,
originator := omit
},
notificationEventType := omit
},
verificationRequest := omit,
subscriptionDeletion := omit,
subscriptionReference := omit,
creator := omit,
notificationForwardingURI := omit
};
/** /**
* @desc Base primitiveContent for CREATE operation for StatConfig resource * @desc Base primitiveContent for CREATE operation for StatConfig resource
* @param p_primitiveConten t Content for the StatConfig * @param p_primitiveConten t Content for the StatConfig
...@@ -2180,7 +2367,39 @@ module OneM2M_Templates { ...@@ -2180,7 +2367,39 @@ module OneM2M_Templates {
} }
}//end group ContentUpdate }//end group ContentUpdate
group RequestContent {
group CreateRequest {
}
group UpdateRequest {
template AE_optional mw_contentAeUpdateRequest modifies mw_contentAe_any := {
resourceName := omit,//NP
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
app_ID := omit,//NP
aE_ID := omit//NP
};
template Container_optional mw_contentContainerUpdateRequest modifies mw_contentContainer_any := {
resourceName := omit,//NP
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit//NP
};
}//End of group UpdateRequest
}//end of group RequestContent
group ResponseContent { group ResponseContent {
template AE_optional mw_contentAeBase := { template AE_optional mw_contentAeBase := {
...@@ -2821,6 +3040,11 @@ module OneM2M_Templates { ...@@ -2821,6 +3040,11 @@ module OneM2M_Templates {
subscriberURI := omit,//O subscriberURI := omit,//O
choice := omit//O choice := omit//O
} }
template Subscription_optional m_contentSubscription modifies m_contentSubscription_allOmit := {
resourceType := int23 //M
}
template Subscription_optional mw_contentSubscription_rc1 modifies mw_contentSubscriptionBase := { template Subscription_optional mw_contentSubscription_rc1 modifies mw_contentSubscriptionBase := {
choice := omit //O choice := omit //O
} }
...@@ -2898,6 +3122,25 @@ module OneM2M_Templates { ...@@ -2898,6 +3122,25 @@ module OneM2M_Templates {
template ContentInstance_optional mw_contentContentInstance_rc1 modifies mw_contentContentInstanceBase := { template ContentInstance_optional mw_contentContentInstance_rc1 modifies mw_contentContentInstanceBase := {
} }
template ContentInstance_optional m_contentContentInstance_allOmit := {
resourceName := omit,//M
resourceType := omit,//M
resourceID := omit,//M
parentID := omit,//M
creationTime := omit,//M
lastModifiedTime := omit,//M
labels := omit ,//O
expirationTime := omit,//M
announceTo := omit,//O
announcedAttribute := omit,//O
stateTag := omit,//M
creator := omit,//O
contentInfo := omit,//O
contentSize := omit,//M
ontologyRef := omit,//O
content := omit//M
};
template Container_optional mw_contentContainerBase := { template Container_optional mw_contentContainerBase := {
resourceName := ?,//M resourceName := ?,//M
resourceType := ?,//M resourceType := ?,//M
...@@ -3130,6 +3373,52 @@ module OneM2M_Templates { ...@@ -3130,6 +3373,52 @@ module OneM2M_Templates {
group SpecialContents { group SpecialContents {
template (value) AE_optional m_contentCreateAe_Invalid := {
resourceName := omit,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O