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

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

parents 46e1e4d3 52c87af7
......@@ -376,6 +376,48 @@ module OneM2M_Functions {
f_cse_postamble_default();
}
/**
* @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
* @verdict
*/
function f_cse_postamble_deleteResourcesCSE() runs on CseTester {
var integer i;
var XSD.ID v_resourceAddress;
var RequestPrimitive v_request;
if (PX_RUN_POSTAMBLE) {
for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) {
v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]);
v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false)));
v_request.from_ := PX_SUPER_CSE_ID;
mccPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
log(__SCOPE__&" INFO: Resource " & v_request.to_ & " deleted");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
log(__SCOPE__&" INFO: Error while deleting resource " & v_request.to_);
}
[] tc_ac.timeout {
log(__SCOPE__&" INFO: No answer while deleting resource " & v_request.to_);
}
}
}
}
f_cse_postamble_default();
}
/**
* @desc Default postamble
* @verdict
......@@ -1669,6 +1711,9 @@ module OneM2M_Functions {
if(ischosen(p_contentResource.serviceSubscribedAppRule)) {
return p_contentResource.serviceSubscribedAppRule.resourceName;
}
if(ischosen(p_contentResource.remoteCSE)) {
return p_contentResource.remoteCSE.resourceName;
}
log(__SCOPE__&":WARNING: Primitive Content Kind not implemented");
return "resourceNameNotFound";
......
......@@ -204,6 +204,35 @@ module OneM2M_Templates {
}
};
/**
* @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
* @param p_targetResourceAddress Target resource address
* @param p_originator Originator (from)
* @param p_filterUsage FilterUsage
* @param p_labels Labels
*/
template (value) RequestPrimitive m_retrieveResourceFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieveResource := {
requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000),
filterCriteria := {
createdBefore := omit,
createdAfter := omit,
modifiedSince := omit,
unmodifiedSince := omit,
stateTagSmaller := omit,
stateTagBigger := omit,
expireBefore := omit,
expireAfter := omit,
labels := p_labels,
resourceType := omit,
sizeAbove := omit,
sizeBelow := omit,
contentType_list := {},
attribute_list := {},
filterUsage := p_filterUsage,
limit := omit
}
};
/**
* @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
* @param p_targetResourceAddress Target resource address
......@@ -3294,10 +3323,10 @@ module OneM2M_Templates {
eventCategory := *
};
template ResponsePrimitive mw_responseDiscovery := {
template ResponsePrimitive mw_responseDiscovery(template URIList p_uriList := ?) := {
responseStatusCode := int2000,
requestIdentifier := ?,
primitiveContent := {uRIList := ?},
primitiveContent := {uRIList := p_uriList},
to_ := *,
from_ := *,
originatingTimestamp := *,
......
......@@ -43,7 +43,7 @@ module OneM2M_TestControl {
execute(TC_CSE_REG_CRE_018());
execute(TC_CSE_REG_CRE_022());
execute(TC_CSE_REG_CRE_023());
execute(TC_CSE_REG_CRE_024());
execute(TC_CSE_REG_CRE_025());
execute(TC_CSE_REG_CRE_026());
execute(TC_CSE_REG_RET_001());
execute(TC_CSE_REG_RET_005());
......
......@@ -1293,6 +1293,8 @@ module OneM2M_Testcases {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
......@@ -1308,7 +1310,7 @@ module OneM2M_Testcases {
}
// Postamble
f_cse_postamble_deleteResources();
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
......@@ -1345,6 +1347,8 @@ module OneM2M_Testcases {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
......@@ -1356,7 +1360,7 @@ module OneM2M_Testcases {
}
// Postamble
f_cse_postamble_deleteResources();
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
......@@ -15770,6 +15774,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var Labels v_labels := {"NotFoundLabel"};
// Test control
......@@ -15783,12 +15788,14 @@ module OneM2M_Testcases {
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
//v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
v_request := valueof(m_retrieveResourceFilterUsageOptionLabel(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1, v_labels));
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
log("sizeof: " & int2str(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)));
if(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList) == 0){
setverdict(pass, __SCOPE__ & ": No Content is present");
}
......@@ -15829,6 +15836,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var integer v_i_cont := 0;
// Test control
......@@ -15848,10 +15856,13 @@ module OneM2M_Testcases {
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList representation");
while (v_i_cont<sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element");
}
v_i_cont := v_i_cont + 1;
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
......@@ -16014,7 +16025,9 @@ module OneM2M_Testcases {
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
v_request := valueof(m_retrieveResourceInvalidFormatOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
v_request.filterCriteria.expireBefore := "20171231T012345";
v_request.filterCriteria.expireAfter := "20181231T012345";
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment