Commit aef504bc2019563d5efde9f8f57fa644a3668abb

Authored by Antonio Castillo Verdugo
1 parent d7ae62ac

New function: f_cse_notifyProcedure_responsePrimitiveHandler

New template: mw_notifyResponsePrimitive
Fixed test component configuration in Non-Blocking Test Cases
New permutation functions: f_CSE_NBR_ASY_003, f_CSE_NBR_ASY_004
New Test Cases: TC_CSE_NBR_ASY_003_CRE, TC_CSE_NBR_ASY_003_UPD, TC_CSE_NBR_ASY_003_RET, TC_CSE_NBR_ASY_003_DEL, TC_CSE_NBR_ASY_004_CRE, TC_CSE_NBR_ASY_004_UPD, TC_CSE_NBR_ASY_004_RET, TC_CSE_NBR_ASY_004_DEL

Signed-off-by: acverdugo <acverdugo@at4wireless.com>
... ... @@ -1467,6 +1467,41 @@ module OneM2M_Functions {
1467 1467 }
1468 1468  
1469 1469 } //end f_cse_notifyProcedure_representationHandler
  1470 +
  1471 + /**
  1472 + * @desc Handling message exchange for the notification procedure
  1473 + * @param p_responsePrimitive Expected responsePrimitive in the notification
  1474 + * @verdict
  1475 + */
  1476 + function f_cse_notifyProcedure_responsePrimitiveHandler(template ResponsePrimitive p_responsePrimitive) runs on AeSimu {
  1477 + // Local variables
  1478 + var ResponsePrimitive v_responsePrimitive;
  1479 +
  1480 + //Activate defaults when running on a PTC
  1481 + f_cse_activateDefaults_ae();
  1482 +
  1483 + tc_ac.start;
  1484 + alt {
  1485 + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(p_responsePrimitive))) -> value vc_request {
  1486 + tc_ac.stop;
  1487 + setverdict(pass, __SCOPE__ & ":INFO: Notification received with the expected content");
  1488 + v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  1489 + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
  1490 + mcaPortIn.send(m_response(v_responsePrimitive));
  1491 + }
  1492 + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request {
  1493 + tc_ac.stop;
  1494 + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
  1495 + v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  1496 + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
  1497 + mcaPortIn.send(m_response(v_responsePrimitive));
  1498 + }
  1499 + [] tc_ac.timeout {
  1500 + setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
  1501 + }
  1502 + }
  1503 +
  1504 + } //end f_cse_notifyProcedure_representationHandler
1470 1505  
1471 1506 /**
1472 1507 * @desc Handling message exchange for the notification procedure (aggregatedNotification)
... ...
... ... @@ -1345,6 +1345,13 @@ module OneM2M_Templates {
1345 1345 primitiveContent := {notification := p_notification}
1346 1346 };
1347 1347  
  1348 + /**
  1349 + * @desc Base NOTIFY request primitive for ResponsePrimitive
  1350 + */
  1351 +
  1352 + template RequestPrimitive mw_notifyResponsePrimitive(in template (present) ResponsePrimitive p_responsePrimitive) modifies mw_notify := {
  1353 + primitiveContent := {responsePrimitive := p_responsePrimitive}
  1354 + };
1348 1355  
1349 1356  
1350 1357  
... ...
... ... @@ -6473,7 +6473,7 @@ module OneM2M_PermutationFunctions {
6473 6473 }
6474 6474  
6475 6475 // Test component configuration
6476   - f_cf01Up(true);
  6476 + f_cf01Up();
6477 6477  
6478 6478 // Test adapter configuration
6479 6479  
... ... @@ -6539,7 +6539,7 @@ module OneM2M_PermutationFunctions {
6539 6539 }
6540 6540  
6541 6541 // Test component configuration
6542   - f_cf01Up(true);
  6542 + f_cf01Up();
6543 6543  
6544 6544 // Test adapter configuration
6545 6545  
... ... @@ -6639,7 +6639,7 @@ module OneM2M_PermutationFunctions {
6639 6639 }
6640 6640  
6641 6641 // Test component configuration
6642   - f_cf01Up(true);
  6642 + f_cf01Up();
6643 6643  
6644 6644 // Test adapter configuration
6645 6645  
... ... @@ -6766,7 +6766,7 @@ module OneM2M_PermutationFunctions {
6766 6766 }
6767 6767  
6768 6768 // Test component configuration
6769   - f_cf01Up(true);
  6769 + f_cf01Up();
6770 6770  
6771 6771 // Test adapter configuration
6772 6772  
... ... @@ -6843,7 +6843,7 @@ module OneM2M_PermutationFunctions {
6843 6843 }
6844 6844  
6845 6845 // Test component configuration
6846   - f_cf01Up(true);
  6846 + f_cf01Up();
6847 6847  
6848 6848 // Test adapter configuration
6849 6849  
... ... @@ -6920,6 +6920,159 @@ module OneM2M_PermutationFunctions {
6920 6920 f_cf01Down();
6921 6921  
6922 6922 }//end f_CSE_NBR_ASY_002
  6923 +
  6924 + function f_CSE_NBR_ASY_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{
  6925 +
  6926 + // Local variables
  6927 + var MsgIn v_response;
  6928 + var RequestPrimitive v_request;
  6929 + var integer v_aeIndex := -1;
  6930 + var integer v_resourceIndex := -1;
  6931 + var integer v_acpAuxIndex := -1;
  6932 + var template PrimitiveContent v_contentResponse;
  6933 +
  6934 + // Test control
  6935 + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){
  6936 + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case");
  6937 + stop;
  6938 + }
  6939 +
  6940 + // Test component configuration
  6941 + f_cf01Up();
  6942 +
  6943 + // Test adapter configuration
  6944 +
  6945 + // Preamble
  6946 +
  6947 + v_contentResponse.uRI := ?;
  6948 +
  6949 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  6950 +
  6951 + if(ispresent(p_parentRequestPrimitive)) {
  6952 + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex);
  6953 + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex);
  6954 + }else{
  6955 + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
  6956 + }
  6957 + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
  6958 + p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch
  6959 + p_requestPrimitive.responseType.notificationURI := omit; //"...no notification target list is provided"
  6960 +
  6961 + mcaPort.send(m_request(valueof(p_requestPrimitive)));
  6962 + tc_ac.start;
  6963 + alt {
  6964 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response {
  6965 + tc_ac.stop;
  6966 + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address");
  6967 + }
  6968 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response {
  6969 + tc_ac.stop;
  6970 + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address");
  6971 + }
  6972 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
  6973 + tc_ac.stop;
  6974 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  6975 + }
  6976 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
  6977 + tc_ac.stop;
  6978 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  6979 + }
  6980 + [] tc_ac.timeout {
  6981 + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation");
  6982 + }
  6983 + }
  6984 +
  6985 + f_checkAeSimuStatus();
  6986 +
  6987 + //Test Body
  6988 +
  6989 + //Check to see if the notification is received
  6990 + f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode));
  6991 +
  6992 + // Postamble
  6993 + f_cse_postamble_deleteResources();
  6994 +
  6995 + // Tear down
  6996 + f_cf01Down();
  6997 +
  6998 + }//end f_CSE_NBR_ASY_003
  6999 +
  7000 + function f_CSE_NBR_ASY_004(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu{
  7001 +
  7002 + // Local variables
  7003 + var MsgIn v_response;
  7004 + var RequestPrimitive v_request;
  7005 + var integer v_aeIndex := -1;
  7006 + var integer v_resourceIndex := -1;
  7007 + var integer v_acpAuxIndex := -1;
  7008 + var template PrimitiveContent v_contentResponse;
  7009 +
  7010 + // Test control
  7011 + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){
  7012 + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case");
  7013 + stop;
  7014 + }
  7015 +
  7016 + // Test component configuration
  7017 + f_cf01Up();
  7018 +
  7019 + // Test adapter configuration
  7020 +
  7021 + // Preamble
  7022 +
  7023 + v_contentResponse.uRI := ?;
  7024 +
  7025 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  7026 +
  7027 + if(ispresent(p_parentRequestPrimitive)) {
  7028 + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex);
  7029 + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex);
  7030 + }else{
  7031 + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
  7032 + }
  7033 + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
  7034 + p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch
  7035 + p_requestPrimitive.responseType.notificationURI := {}; //"...an empty notification target list is provided"
  7036 +
  7037 + // Test Body
  7038 +
  7039 + mcaPort.send(m_request(valueof(p_requestPrimitive)));
  7040 + tc_ac.start;
  7041 + alt {
  7042 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response {
  7043 + tc_ac.stop;
  7044 + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address");
  7045 + }
  7046 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response {
  7047 + tc_ac.stop;
  7048 + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address");
  7049 + }
  7050 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
  7051 + tc_ac.stop;
  7052 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  7053 + }
  7054 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
  7055 + tc_ac.stop;
  7056 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  7057 + }
  7058 + [] tc_ac.timeout {
  7059 + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation");
  7060 + }
  7061 + }
  7062 +
  7063 + f_checkAeSimuStatus();
  7064 +
  7065 + //Check if Notification is sent or not
  7066 +
  7067 + f_cse_notifyProcedure_noNotificationHandler();
  7068 +
  7069 + // Postamble
  7070 + f_cse_postamble_deleteResources();
  7071 +
  7072 + // Tear down
  7073 + f_cf01Down();
  7074 +
  7075 + }//end f_CSE_NBR_ASY_004
6923 7076  
6924 7077 }//end Group Asynchronous
6925 7078  
... ...
... ... @@ -7281,7 +7281,7 @@ module OneM2M_Testcases_CSE_Release_2 {
7281 7281 v_ae1.start(f_CSE_NBR_SYN_002(m_updateContainerBase, m_createContainerBase)); //Update Container
7282 7282 v_ae1.done;
7283 7283  
7284   - }
  7284 + }
7285 7285  
7286 7286 testcase TC_CSE_NBR_SYN_002_RET() runs on Tester system CseSystem {
7287 7287 // Local variables
... ... @@ -7333,7 +7333,7 @@ module OneM2M_Testcases_CSE_Release_2 {
7333 7333 v_ae1.start(f_CSE_NBR_SYN_003(m_updateContainerBase, m_createContainerBase, int3)); //Update Container
7334 7334 v_ae1.done;
7335 7335  
7336   - }
  7336 + }
7337 7337  
7338 7338 testcase TC_CSE_NBR_SYN_003_RET() runs on Tester system CseSystem {
7339 7339 // Local variables
... ... @@ -7388,7 +7388,7 @@ module OneM2M_Testcases_CSE_Release_2 {
7388 7388 v_ae1.start(f_CSE_NBR_ASY_001(m_updateContainerBase, m_createContainerBase)); //Update Container
7389 7389 v_ae1.done;
7390 7390  
7391   - }
  7391 + }
7392 7392  
7393 7393 testcase TC_CSE_NBR_ASY_001_RET() runs on Tester system CseSystem {
7394 7394 // Local variables
... ... @@ -7440,7 +7440,7 @@ module OneM2M_Testcases_CSE_Release_2 {
7440 7440 v_ae1.start(f_CSE_NBR_ASY_002(m_updateContainerBase, m_createContainerBase)); //Update Container
7441 7441 v_ae1.done;
7442 7442  
7443   - }
  7443 + }
7444 7444  
7445 7445 testcase TC_CSE_NBR_ASY_002_RET() runs on Tester system CseSystem {
7446 7446 // Local variables
... ... @@ -7464,6 +7464,110 @@ module OneM2M_Testcases_CSE_Release_2 {
7464 7464  
7465 7465 }// end group g_CSE_NBR_ASY_002
7466 7466  
  7467 + group g_CSE_NBR_ASY_003{
  7468 +
  7469 + /**
  7470 + * @desc Check that the IUT sends the result of the requested Non-Blocking Asynchronous OPERATION as notification to the Originator when no notification target list is provided
  7471 + *
  7472 + */
  7473 + testcase TC_CSE_NBR_ASY_003_CRE() runs on Tester system CseSystem {
  7474 + // Local variables
  7475 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7476 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7477 +
  7478 + v_ae1.start(f_CSE_NBR_ASY_003(m_createContainerBase, -, int2001)); //Create Container
  7479 + v_ae1.done;
  7480 +
  7481 + }
  7482 +
  7483 + testcase TC_CSE_NBR_ASY_003_UPD() runs on Tester system CseSystem {
  7484 + // Local variables
  7485 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7486 + var template RequestPrimitive v_updateRequest := m_updateContainerBase;
  7487 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7488 + var Labels v_labels_1 := {"VALUE_1"};
  7489 +
  7490 + v_updateRequest.primitiveContent.container.labels := v_labels_1;
  7491 +
  7492 + v_ae1.start(f_CSE_NBR_ASY_003(m_updateContainerBase, m_createContainerBase, int2004)); //Update Container
  7493 + v_ae1.done;
  7494 +
  7495 + }
  7496 +
  7497 + testcase TC_CSE_NBR_ASY_003_RET() runs on Tester system CseSystem {
  7498 + // Local variables
  7499 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7500 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7501 +
  7502 + v_ae1.start(f_CSE_NBR_ASY_003(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase, int2000)); //Retrieve Container
  7503 + v_ae1.done;
  7504 +
  7505 + }
  7506 +
  7507 + testcase TC_CSE_NBR_ASY_003_DEL() runs on Tester system CseSystem {
  7508 + // Local variables
  7509 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7510 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7511 +
  7512 + v_ae1.start(f_CSE_NBR_ASY_003(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase, int2002)); //Delete Container
  7513 + v_ae1.done;
  7514 +
  7515 + }
  7516 +
  7517 + }// end group g_CSE_NBR_ASY_003
  7518 +
  7519 + group g_CSE_NBR_ASY_004{
  7520 +
  7521 + /**
  7522 + * @desc Check that the IUT does not send the result of the requested Non-Blocking Asynchronous OPERATION as notification to the Originator when an empty notification target list is provided
  7523 + *
  7524 + */
  7525 + testcase TC_CSE_NBR_ASY_004_CRE() runs on Tester system CseSystem {
  7526 + // Local variables
  7527 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7528 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7529 +
  7530 + v_ae1.start(f_CSE_NBR_ASY_004(m_createContainerBase, -)); //Create Container
  7531 + v_ae1.done;
  7532 +
  7533 + }
  7534 +
  7535 + testcase TC_CSE_NBR_ASY_004_UPD() runs on Tester system CseSystem {
  7536 + // Local variables
  7537 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7538 + var template RequestPrimitive v_updateRequest := m_updateContainerBase;
  7539 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7540 + var Labels v_labels_1 := {"VALUE_1"};
  7541 +
  7542 + v_updateRequest.primitiveContent.container.labels := v_labels_1;
  7543 +
  7544 + v_ae1.start(f_CSE_NBR_ASY_004(m_updateContainerBase, m_createContainerBase)); //Update Container
  7545 + v_ae1.done;
  7546 +
  7547 + }
  7548 +
  7549 + testcase TC_CSE_NBR_ASY_004_RET() runs on Tester system CseSystem {
  7550 + // Local variables
  7551 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7552 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7553 +
  7554 + v_ae1.start(f_CSE_NBR_ASY_004(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase)); //Retrieve Container
  7555 + v_ae1.done;
  7556 +
  7557 + }
  7558 +
  7559 + testcase TC_CSE_NBR_ASY_004_DEL() runs on Tester system CseSystem {
  7560 + // Local variables
  7561 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7562 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7563 +
  7564 + v_ae1.start(f_CSE_NBR_ASY_004(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase)); //Delete Container
  7565 + v_ae1.done;
  7566 +
  7567 + }
  7568 +
  7569 + }// end group g_CSE_NBR_ASY_004
  7570 +
7467 7571 }// end group Asynchronous
7468 7572  
7469 7573 }// end group Non_Blocking_Requests
... ...