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

AE test cases from STF531-AE_UpperTester for Release 1


Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 5c9f35be
......@@ -1691,13 +1691,19 @@ module OneM2M_Functions {
* @return Internal resource index of AE or -1 in case of failure
* @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 PrimitiveContent v_modifiedResource;
var integer v_resourceIndex, v_parentIndex;
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;
alt {
[] mcaPort.receive(mw_request(mw_createAe)) -> value v_request {
......@@ -1725,7 +1731,55 @@ module OneM2M_Functions {
f_checkCseSimuStatus();
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
......@@ -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 {
/**
......
......@@ -22,5 +22,9 @@ module OneM2M_Pics {
modulepar boolean PICS_UNSTRUCTURED_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
......@@ -52,4 +52,15 @@ module OneM2M_Ports {
RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource;
}
/**
* @desc Port to transport control commands to Upper Tester Application
*/
type port UpperTesterPort message {
in
UtTriggerAckPrimitive;
out
UtTriggerPrimitive;
}
}//end module
......@@ -120,6 +120,32 @@ module OneM2M_Templates {
filterCriteria := 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")
......@@ -315,6 +341,29 @@ module OneM2M_Templates {
filterCriteria := 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
......@@ -323,6 +372,16 @@ module OneM2M_Templates {
requestIdentifier := "m_updateAe",
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
......@@ -332,6 +391,14 @@ module OneM2M_Templates {
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
*/
......@@ -505,9 +572,9 @@ module OneM2M_Templates {
/**
* @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,
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 := {
......@@ -656,7 +723,15 @@ module OneM2M_Templates {
template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
resourceType := int10014,
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
......@@ -861,6 +936,14 @@ module OneM2M_Templates {
resourceType := int23,
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,
in template (omit) XSD.String p_name := omit,
......@@ -967,14 +1050,86 @@ module OneM2M_Templates {
filterCriteria := 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
group Notify {
/**
/**
* @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 := {
operation := int5,
to_ := ?,
......@@ -1038,6 +1193,22 @@ module OneM2M_Templates {
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 := ?;
/**
......@@ -1595,7 +1766,7 @@ module OneM2M_Templates {
ontologyRef := omit,//O
content := p_primitiveContent//M
};
/**
* @desc Base primitiveContent for CREATE operation for ContentInstanceAnnc resource
* @param p_primitiveContent Content for the ContentInstanceAnnc
......@@ -1784,6 +1955,22 @@ module OneM2M_Templates {
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
* @param p_primitiveConten t Content for the StatConfig
......@@ -2180,7 +2367,39 @@ module OneM2M_Templates {
}
}//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 {
template AE_optional mw_contentAeBase := {
......@@ -2821,6 +3040,11 @@ module OneM2M_Templates {
subscriberURI := 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 := {
choice := omit //O
}
......@@ -2898,6 +3122,25 @@ module OneM2M_Templates {
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 := {
resourceName := ?,//M
resourceType := ?,//M
......@@ -3130,6 +3373,52 @@ module OneM2M_Templates {
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
accessControlPolicyIDs := omit,//O
expirationTime := omit,//O
announceTo := omit,//O
announcedAttribute := omit,//O
appName := omit,//O
app_ID := omit,//M
aE_ID := omit,//NP
pointOfAccess := omit, //O
ontologyRef := omit,//O
nodeLink := omit,//NP
requestReachability := omit,//M
contentSerialization := omit,//O
choice := omit//NP
};
template AE_optional mw_contentCreateAe_invalid := {
resourceName := *,//O
resourceType := *,//NP
resourceID := *,//NP
parentID := *,//NP
creationTime := *,//NP
lastModifiedTime := *,//NP
labels := *,//O
accessControlPolicyIDs := *,//O
expirationTime := *,//O
announceTo := *,//O
announcedAttribute := *,//O
appName := *,//O
app_ID := omit,//M
aE_ID := *,//NP
pointOfAccess := *, //O
ontologyRef := *,//O
nodeLink := *,//NP
requestReachability := omit,//M
contentSerialization := *,//O
choice := *//NP
};
template (value) AE_update_invalid m_contentUpdateAe_invalid := {
resourceName := omit,//M
resourceType := omit,//M
......@@ -3384,7 +3673,160 @@ module OneM2M_Templates {
}//end group InfoPortTemplates
}//end group ResponsePrimitives
group UpperTester {
template (value) UtTriggerPrimitive m_utCreate := {
operation := int1,
to_ := "NotInitialized",
from_ := "NotInitialized",
requestIdentifier := testcasename() & "-m_utCreate" & f_rnd(1, 1000000),
resourceType := omit,
primitiveContent := omit,
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
};
template (value) UtTriggerPrimitive m_utCreateContainer modifies m_utCreate := {
requestIdentifier := testcasename() & "-m_utCreateContainer" & f_rnd(1, 1000000),
resourceType := int3,
primitiveContent := {container := m_contentContainer_allOmit}
}
template (value) UtTriggerPrimitive m_utCreateContentInstance modifies m_utCreate := {
requestIdentifier := testcasename() & "-m_utCreateContentInstance" & f_rnd(1, 1000000),
resourceType := int4,
primitiveContent := {contentInstance := m_contentContentInstance_allOmit}
}
template (value) UtTriggerPrimitive m_utCreateSubscription modifies m_utCreate := {
requestIdentifier := testcasename() & "-m_utCreateSubscription" & f_rnd(1, 1000000),
resourceType := int23,
primitiveContent := {subscription := m_contentSubscription}
}
template (value) UtTriggerPrimitive m_utRetrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
operation := int2,
to_ := p_targetResourceAddress,
from_ := p_originator,
requestIdentifier := "m_utRetrieveResource" & f_rnd(1, 1000000),
resourceType := omit,
primitiveContent := omit,
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
};
template (value) UtTriggerPrimitive m_utUpdate := {