Skip to content
Snippets Groups Projects
Commit 28d8e8ff authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Modifications and improvements to the Discovery testcases DIS/BV/001,...

Modifications and improvements to the Discovery testcases DIS/BV/001, DIS/BV/003, DIS/BV/004, DIS/BO/006 and DIS/BI/007
parent 25773bfd
No related branches found
No related tags found
2 merge requests!25Ae fixes,!15Stf531 discovery test cases
......@@ -867,7 +867,104 @@ module OneM2M_Functions {
unmap(self:acPort, system:acPort);
} //end f_cse_notifyProcedure
function f_cse_getResourceAddress_IsNonHierarchical(in template PrimitiveContent p_content) runs on CseTester return boolean {
var boolean v_IsNonHierarchical := false;
var integer i;
var integer v_NoOfSlashes:= -1;
var boolean v_CseScope := f_cse_getResourceAddress_IsScopeCseRelative();
var boolean v_SpScope:= f_cse_getResourceAddress_IsScopeSpRelative();
var boolean v_AbsScope:= f_cse_getResourceAddress_IsScopeAbsoluteRelative();
if(v_CseScope and PX_UNSTRUCTURED){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
} else if (v_SpScope and PX_UNSTRUCTURED){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
} else if (v_AbsScope and PX_UNSTRUCTURED){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
}
if ( (v_NoOfSlashes == 0) or (v_NoOfSlashes == 1) or (v_NoOfSlashes == 3)){
v_IsNonHierarchical := true;
}
return v_IsNonHierarchical;
}
function f_cse_getResourceAddress_IsHierarchical(in template PrimitiveContent p_content) runs on CseTester return boolean {
var boolean v_IsHierarchical := false;
var integer i;
var integer v_NoOfSlashes:= -1;
var boolean v_CseScope := f_cse_getResourceAddress_IsScopeCseRelative();
var boolean v_SpScope:= f_cse_getResourceAddress_IsScopeSpRelative();
var boolean v_AbsScope:= f_cse_getResourceAddress_IsScopeAbsoluteRelative();
if(v_CseScope and (not (PX_UNSTRUCTURED))){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
} else if (v_SpScope and (not(PX_UNSTRUCTURED))){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
} else if (v_AbsScope and (not (PX_UNSTRUCTURED))){
for (i := 0; i < lengthof(p_content.uRIList); i:= i+1){
if(match (p_content.uRIList[i], "/")){
v_NoOfSlashes:= v_NoOfSlashes+1;
}
}
}
if ( (v_NoOfSlashes == 1) or (v_NoOfSlashes == 2) or (v_NoOfSlashes == 4)) {
v_IsHierarchical := true;
}
return v_IsHierarchical;
}
function f_cse_getResourceAddress_IsScopeCseRelative() runs on CseTester return boolean {
var boolean v_CseScope:= false;
if (PX_ADDRESSING_FORMAT == e_cseRelative){
v_CseScope := true;
}
return v_CseScope;
}
function f_cse_getResourceAddress_IsScopeSpRelative() runs on CseTester return boolean {
var boolean v_SpScope:= false;
if (PX_ADDRESSING_FORMAT == e_spRelative){
v_SpScope := true;
}
return v_SpScope;
}
function f_cse_getResourceAddress_IsScopeAbsoluteRelative() runs on CseTester return boolean {
var boolean v_AbsScope:= false;
if(PX_ADDRESSING_FORMAT == e_absolute){
v_AbsScope := true;
}
return v_AbsScope;
}
}//end group helpingFunctions
......
......@@ -2785,6 +2785,21 @@ module OneM2M_Templates {
tokenRequestInformation := *
};
template ResponsePrimitive mw_responseDiscovery := {
responseStatusCode := int2000,
requestIdentifier := ?,
primitiveContent := ?,
to_ := *,
from_ := *,
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *,
contentStatus := *,
contentOffset := *,
assignedTokenIdentifiers := *,
tokenRequestInformation := *
};
template ResponsePrimitive m_responseNotification(ResponseStatusCode p_statusCode, in template(omit) PrimitiveContent p_notification := omit) := {
responseStatusCode := p_statusCode,
requestIdentifier := testcasename() & "-m_responseNotification" & f_rnd(1, 1000000),
......
......@@ -10324,6 +10324,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
......@@ -10337,20 +10338,15 @@ module OneM2M_Testcases {
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
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));
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responseDiscovery)){
tc_ac.stop;
if(not ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
setverdict(fail, testcasename() & ": URI List Representation not present");
}
else
{
setverdict(pass, testcasename() & ": URI List Representation available");
}
setverdict(pass, testcasename() & ": URI List Representation available");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
......@@ -10380,6 +10376,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
......@@ -10393,6 +10390,7 @@ module OneM2M_Testcases {
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
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));
mcaPort.send(m_request(v_request));
tc_ac.start;
......@@ -10435,6 +10433,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
......@@ -10448,19 +10447,18 @@ module OneM2M_Testcases {
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
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_retrieveResourceDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1));
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
if(not ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
setverdict(fail, testcasename() & ": URI List Representation containing unstructured addresses not present");
}
else
{
setverdict(pass, testcasename() & ": URI List Representation containing unstructured addresses available");
if (f_cse_getResourceAddress_IsNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent)){
setverdict(pass, testcasename() & ": Unstructured addresses present in URIList representation");
} else {
setverdict(fail, testcasename() & ": Unstructured addresses absent in URIList representation");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
......@@ -10540,6 +10538,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
......@@ -10552,7 +10551,8 @@ module OneM2M_Testcases {
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
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)));
mcaPort.send(m_request(v_request));
tc_ac.start;
......
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