Skip to content
Snippets Groups Projects

Stf531 check tpreq ttcn

Merged Miguel Angel Reina Ortega requested to merge STF531-CHECK-TPREQ-TTCN into master
+ 70
11
Compare changes
  • Side-by-side
  • Inline
Files
@@ -620,6 +620,72 @@ module OneM2M_Functions {
@@ -620,6 +620,72 @@ module OneM2M_Functions {
}// end f_cse_deleteResource
}// end f_cse_deleteResource
 
/**
 
* @desc Check that a resource is present in the IUT (resourceId is known)
 
* @param p_resourceIndex Resource index
 
* @return boolean
 
*/
 
function f_isResourcePresent (integer p_resourceIndex) runs on CseTester return boolean {
 
 
var ResponseStatusCode v_responseStatusCode;
 
 
//Check to see if the resource is present or not
 
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
 
tc_ac.start;
 
alt {
 
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
 
tc_ac.stop;
 
setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex));
 
return true;
 
}
 
[] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) {
 
tc_ac.stop;
 
setverdict(inconc, testcasename() & ": Wrong response status code in the response");
 
return false;
 
}
 
[] tc_ac.timeout {
 
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
 
return false;
 
}
 
}
 
}
 
 
/**
 
* @desc Check that a resource is not present in the IUT (resourceId is NOT known)
 
* @param p_parentIndex Index of the parent resource
 
* @param p_resourceName Resource name (Hierarchical method is used)
 
* @return boolean
 
*/
 
function f_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseTester return boolean {
 
 
var ResponseStatusCode v_responseStatusCode;
 
 
log(testcasename() & "Hierarchical method is required to check the non presence of the resource");
 
vc_addressingMethod := e_hierarchical;
 
//Check to see if the resource has NOT been created
 
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_parentIndex) & "/" & p_resourceName, f_getOriginator(p_parentIndex))));
 
tc_ac.start;
 
alt {
 
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
 
tc_ac.stop;
 
setverdict(pass, testcasename() & ": Resource not present");
 
vc_addressingMethod := PX_ADDRESSING_METHOD;
 
return true;
 
}
 
[] mcaPort.receive(mw_response(mw_responsePrimitive(?))) {
 
tc_ac.stop;
 
setverdict(inconc, testcasename() & ": Wrong response status code in the response");
 
vc_addressingMethod := PX_ADDRESSING_METHOD;
 
return false;
 
}
 
[] tc_ac.timeout {
 
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
 
vc_addressingMethod := PX_ADDRESSING_METHOD;
 
return false;
 
}
 
}
 
}
 
/**
/**
* @desc Update of the auxiliar ACP resource
* @desc Update of the auxiliar ACP resource
* @param p_allowedOperations New allowed operations
* @param p_allowedOperations New allowed operations
@@ -974,14 +1040,7 @@ module OneM2M_Functions {
@@ -974,14 +1040,7 @@ module OneM2M_Functions {
unmap(self:mcaPort, system:mcaPort);
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
unmap(self:acPort, system:acPort);
} //end f_cse_notifyProcedure_subscriptionDeletion
} //end f_cse_notifyProcedure_subscriptionDeletion
function f_isResourceNotDeleted(in integer p_resourceIndex) runs on Tester return boolean {
//TODO Call f_isResourcePresent
return false;
}
/**
/**
* @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target
* @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target
Loading