New Test Cases: TC_CSE_NBR_ASY_002_CRE, TC_CSE_NBR_ASY_002_UPD,...

New Test Cases: TC_CSE_NBR_ASY_002_CRE, TC_CSE_NBR_ASY_002_UPD, TC_CSE_NBR_ASY_002_RET, TC_CSE_NBR_ASY_002_DEL
New Permutation Function: f_CSE_NBR_ASY_002
Signed-off-by: Antonio Castillo Verdugo's avataracverdugo <acverdugo@at4wireless.com>
parent 3d9d49a6
......@@ -6825,6 +6825,101 @@ module OneM2M_PermutationFunctions {
f_cf01Down();
}//end f_CSE_NBR_ASY_001
function f_CSE_NBR_ASY_002(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu{
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_acpAuxIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
if(not PICS_NON_BLOCKING_REQUEST_SYNCH){
setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case");
stop;
}
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_contentResponse.uRI := ?;
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
if(ispresent(p_parentRequestPrimitive)) {
v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex);
p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex);
}else{
p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
}
p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch
// Test Body
mcaPort.send(m_request(valueof(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is present or not
if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){
mcaPort.send(m_request(m_retrieve(v_response.primitive.responsePrimitive.primitiveContent.uRI, f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": Request resource present");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Request resource not found");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Wrong response status code in the response");
}
[] tc_ac.timeout {
setverdict(fail, testcasename() & ": No answer while retrieving resource");
}
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_NBR_ASY_002
}//end Group Asynchronous
......
......@@ -7411,6 +7411,59 @@ module OneM2M_Testcases_CSE_Release_2 {
}
}// end group g_CSE_NBR_ASY_001
group g_CSE_NBR_ASY_002{
/**
* @desc Check that the IUT responds to a Non-Blocking Asynchronous Request with the reference of a <request> resource provided within the Content parameter of the Response
*
*/
testcase TC_CSE_NBR_ASY_002_CRE() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_NBR_ASY_002(m_createContainerBase, -)); //Create Container
v_ae1.done;
}
testcase TC_CSE_NBR_ASY_002_UPD() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var Labels v_labels_1 := {"VALUE_1"};
v_updateRequest.primitiveContent.container.labels := v_labels_1;
v_ae1.start(f_CSE_NBR_ASY_002(m_updateContainerBase, m_createContainerBase)); //Update Container
v_ae1.done;
}
testcase TC_CSE_NBR_ASY_002_RET() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_NBR_ASY_002(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase)); //Retrieve Container
v_ae1.done;
}
testcase TC_CSE_NBR_ASY_002_DEL() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_NBR_ASY_002(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase)); //Delete Container
v_ae1.done;
}
}// end group g_CSE_NBR_ASY_002
}// end group Asynchronous
}// end group Non_Blocking_Requests
......
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