Commit 3d9d49a6 authored by Antonio Castillo Verdugo's avatar Antonio Castillo Verdugo
Browse files

- New PICS added for controlling Non-Blocking feature of the IUT:...

- New PICS added for controlling Non-Blocking feature of the IUT: PICS_NON_BLOCKING_REQUEST_SYNCH and PICS_NON_BLOCKING_REQUEST_ASYNCH
- New templates <request> resource related
- Fixed some typos
- New testcases related to Non-Blocking feature: TC_CSE_NBR_SYN_001_CRE, TC_CSE_NBR_SYN_001_UPD, TC_CSE_NBR_SYN_001_RET, TC_CSE_NBR_SYN_001_DEL, TC_CSE_NBR_SYN_002_CRE, TC_CSE_NBR_SYN_002_UPD, TC_CSE_NBR_SYN_002_RET, TC_CSE_NBR_SYN_002_DEL, TC_CSE_NBR_SYN_003_CRE, TC_CSE_NBR_SYN_003_UPD, TC_CSE_NBR_SYN_003_RET, TC_CSE_NBR_SYN_003_DEL, TC_CSE_NBR_ASY_001_CRE, TC_CSE_NBR_ASY_001_UPD, TC_CSE_NBR_ASY_001_RET, TC_CSE_NBR_ASY_001_DEL
parent f3752674
......@@ -140,6 +140,15 @@ module OneM2M_Pics {
modulepar boolean PICS_SUB_PSN := true;
modulepar boolean PICS_SUB_CR := true;
}
/**
* @desc Non-Blocking Requests
* @see oneM2M TS-0017 A.X.Y.Z
*/
group NonBlocking {
modulepar boolean PICS_NON_BLOCKING_REQUEST_SYNCH := true; //TO BE DEFINED IN TS-0017
modulepar boolean PICS_NON_BLOCKING_REQUEST_ASYNCH := true; //TO BE DEFINED IN TS-0017
}
}
} // end of module
......@@ -3181,6 +3181,29 @@ module OneM2M_Templates {
choice := *//O
};
template Request_optional mw_contentRequestBase := {
resourceName := ?,//M
resourceType := ?,//M
resourceID := ?,//M
parentID := ?,//M
creationTime := ?,//M
lastModifiedTime := ?,//M
labels := *,//O
accessControlPolicyIDs := *,//O
expirationTime := ?,//M
dynamicAuthorizationConsultationIDs := *,//O
stateTag := ?,//M
operation := ?,//M
target := ?,//M
originator := ?,//M
requestID := ?,//M
metaInformation := ?,//M
primitiveContent := *,//O
requestStatus := ?,//M
operationResult := ?,//M
choice := *//O
};
template Schedule_optional mw_contentScheduleBase := {
resourceName := ?,//M
resourceType := ?,//M
......
......@@ -5670,7 +5670,7 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
......@@ -6001,7 +6001,7 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
if(p_responseStatusCode == int2002) {
f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex);
}
......@@ -6122,7 +6122,7 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation");
......@@ -6239,7 +6239,7 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
if(p_responseStatusCode == int2002) {
f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex);
}
......@@ -6357,7 +6357,7 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
......@@ -6452,6 +6452,383 @@ module OneM2M_PermutationFunctions {
}//end group Basic
}// end group Announcement
group Non_Blocking_Requests{
group Synchronous{
function f_CSE_NBR_SYN_001(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;
// Test control
if(PICS_NON_BLOCKING_REQUEST_SYNCH){
setverdict(inconc, __SCOPE__ & ": It is required to not 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_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 := int1; //nonBlockingRequestSynch
// Test Body
mcaPort.send(m_request(valueof(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5206))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Operation rejected because Non-blocking access resource in synchronous mode is not supported");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without supporting Non-Blocking Requests");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation");
}
}
f_checkAeSimuStatus();
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_NBR_SYN_001
function f_CSE_NBR_SYN_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 := int1; //nonBlockingRequestSynch
// 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_SYN_002
function f_CSE_NBR_SYN_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in Operation p_operation) 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_contentResponseUri;
var template PrimitiveContent v_contentResponseRequestResource;
var RequestStatus v_requestStatus;
var URI v_requestResourceURI;
var ResponseStatusCode v_statusCode;
var template PrimitiveContent v_primitiveContent;
// 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_contentResponseUri.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 := int1; //nonBlockingRequestSynch
// Test Body
mcaPort.send(m_request(valueof(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponseUri))) -> 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)){
v_contentResponseRequestResource.request := mw_contentRequestBase;
v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI;
if (p_operation == int1){ //create
v_statusCode := int2001;
v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent);
}else if (p_operation == int2){ //retrieve
v_statusCode := int2000;
v_primitiveContent.container := mw_contentContainer_rc1;
}else if (p_operation == int3){ //update
v_statusCode := int2004;
v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent);
}else if (p_operation == int4){ //delete
v_statusCode := int2002;
v_primitiveContent := omit;
}
mcaPort.send(m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponseRequestResource))) -> value v_response{
setverdict(pass, testcasename() & ": Request resource has been received");
v_requestStatus := v_response.primitive.responsePrimitive.primitiveContent.request.requestStatus;
if (v_requestStatus==int1){ //COMPLETED
tc_ac.stop;
if (match(v_response, mw_response(mw_responsePrimitive(v_statusCode,v_primitiveContent)))){
setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and operationResult attribute correctly received");
}else{
setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and operationResult attribute not correctly received");
}
}else if (v_requestStatus==int2){ //FAILED
tc_ac.stop;
setverdict(fail, testcasename() & ": RequestStatus: FAIL");
}else{ //PENDING, FORWARDING or PARTIALLY_COMPLETED
f_sleep(PX_TAC/5.0);
mcaPort.send(m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex))));
repeat;
}
}
[] 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_SYN_003
}//end Group Synchronous
group Asynchronous{
function f_CSE_NBR_ASY_001(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;
// Test control
if(PICS_NON_BLOCKING_REQUEST_ASYNCH){
setverdict(inconc, __SCOPE__ & ": It is required to not support Non-blocking access resource in asynchronous mode to run this test case");
stop;
}
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
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(int1002, omit))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": No content provided with the right status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": No content provided with a wrong status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content provided");
}
[] 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 asynchronous mode operation");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is present or not
if (f_isResourcePresent(v_resourceIndex)){
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_NBR_ASY_001
}//end Group Asynchronous
}//end group Non_Blocking_Requests
}//end group CSE
......
......@@ -9229,7 +9229,7 @@ module OneM2M_Testcases_CSE_Release_1 {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
setverdict(fail, __SCOPE__ & ": Error operation have been accepted without having privileges");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
......
......@@ -7196,6 +7196,224 @@ module OneM2M_Testcases_CSE_Release_2 {
}//end group Basic
}//end group Announcement
group Non_Blocking_Requests{
group Synchronous{
group g_CSE_NBR_SYN_001 {
/**
* @desc Check that the IUT rejects a Non-Blocking Synchronous Request if the IUT does not support the <request> resource
*
*/
testcase TC_CSE_NBR_SYN_001_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_SYN_001(m_createContainerBase, -)); //Create Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_001_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_SYN_001(m_updateContainerBase, m_createContainerBase)); //Update Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_001_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_SYN_001(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase)); //Retrieve Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_001_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_SYN_001(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase)); //Delete Container
v_ae1.done;
}
}// end group g_CSE_NBR_SYN_001
group g_CSE_NBR_SYN_002{
/**
* @desc Check that the IUT responds to a Non-Blocking Synchronous Request with the reference of a <request> resource provided within the Content parameter of the Response
*
*/
testcase TC_CSE_NBR_SYN_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_SYN_002(m_createContainerBase, -)); //Create Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_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_SYN_002(m_updateContainerBase, m_createContainerBase)); //Update Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_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_SYN_002(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase)); //Retrieve Container
v_ae1.done;
}
testcase TC_CSE_NBR_SYN_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_SYN_002(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase)); //Delete Container
v_ae1.done;
}
}// end group g_CSE_NBR_SYN_002
group g_CSE_NBR_SYN_003{
/**