Commit d7ae62ac6a03dca66f0a768baa9af9ca88eb6590

Authored by Antonio Castillo Verdugo
1 parent 3d9d49a6

New Test Cases: TC_CSE_NBR_ASY_002_CRE, TC_CSE_NBR_ASY_002_UPD, TC_CSE_NBR_ASY_0…

…02_RET, TC_CSE_NBR_ASY_002_DEL
New Permutation Function: f_CSE_NBR_ASY_002

Signed-off-by: acverdugo <acverdugo@at4wireless.com>
... ... @@ -6825,6 +6825,101 @@ module OneM2M_PermutationFunctions {
6825 6825 f_cf01Down();
6826 6826  
6827 6827 }//end f_CSE_NBR_ASY_001
  6828 +
  6829 + function f_CSE_NBR_ASY_002(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu{
  6830 +
  6831 + // Local variables
  6832 + var MsgIn v_response;
  6833 + var RequestPrimitive v_request;
  6834 + var integer v_aeIndex := -1;
  6835 + var integer v_resourceIndex := -1;
  6836 + var integer v_acpAuxIndex := -1;
  6837 + var template PrimitiveContent v_contentResponse;
  6838 +
  6839 + // Test control
  6840 + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){
  6841 + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case");
  6842 + stop;
  6843 + }
  6844 +
  6845 + // Test component configuration
  6846 + f_cf01Up(true);
  6847 +
  6848 + // Test adapter configuration
  6849 +
  6850 + // Preamble
  6851 +
  6852 + v_contentResponse.uRI := ?;
  6853 +
  6854 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  6855 +
  6856 + if(ispresent(p_parentRequestPrimitive)) {
  6857 + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex);
  6858 + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex);
  6859 + }else{
  6860 + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
  6861 + }
  6862 + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
  6863 + p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch
  6864 +
  6865 + // Test Body
  6866 +
  6867 + mcaPort.send(m_request(valueof(p_requestPrimitive)));
  6868 + tc_ac.start;
  6869 + alt {
  6870 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response {
  6871 + tc_ac.stop;
  6872 + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address");
  6873 + }
  6874 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response {
  6875 + tc_ac.stop;
  6876 + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address");
  6877 + }
  6878 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
  6879 + tc_ac.stop;
  6880 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  6881 + }
  6882 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
  6883 + tc_ac.stop;
  6884 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  6885 + }
  6886 + [] tc_ac.timeout {
  6887 + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation");
  6888 + }
  6889 + }
  6890 +
  6891 + f_checkAeSimuStatus();
  6892 +
  6893 + //Check to see if the resource is present or not
  6894 + if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){
  6895 + mcaPort.send(m_request(m_retrieve(v_response.primitive.responsePrimitive.primitiveContent.uRI, f_getOriginator(v_aeIndex))));
  6896 + tc_ac.start;
  6897 + alt {
  6898 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
  6899 + tc_ac.stop;
  6900 + setverdict(pass, testcasename() & ": Request resource present");
  6901 + }
  6902 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
  6903 + tc_ac.stop;
  6904 + setverdict(fail, testcasename() & ": Request resource not found");
  6905 + }
  6906 + [] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) {
  6907 + tc_ac.stop;
  6908 + setverdict(fail, testcasename() & ": Wrong response status code in the response");
  6909 + }
  6910 + [] tc_ac.timeout {
  6911 + setverdict(fail, testcasename() & ": No answer while retrieving resource");
  6912 + }
  6913 + }
  6914 + }
  6915 +
  6916 + // Postamble
  6917 + f_cse_postamble_deleteResources();
  6918 +
  6919 + // Tear down
  6920 + f_cf01Down();
  6921 +
  6922 + }//end f_CSE_NBR_ASY_002
6828 6923  
6829 6924 }//end Group Asynchronous
6830 6925  
... ...
... ... @@ -7411,6 +7411,59 @@ module OneM2M_Testcases_CSE_Release_2 {
7411 7411 }
7412 7412  
7413 7413 }// end group g_CSE_NBR_ASY_001
  7414 +
  7415 + group g_CSE_NBR_ASY_002{
  7416 +
  7417 + /**
  7418 + * @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
  7419 + *
  7420 + */
  7421 + testcase TC_CSE_NBR_ASY_002_CRE() runs on Tester system CseSystem {
  7422 + // Local variables
  7423 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7424 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7425 +
  7426 + v_ae1.start(f_CSE_NBR_ASY_002(m_createContainerBase, -)); //Create Container
  7427 + v_ae1.done;
  7428 +
  7429 + }
  7430 +
  7431 + testcase TC_CSE_NBR_ASY_002_UPD() runs on Tester system CseSystem {
  7432 + // Local variables
  7433 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7434 + var template RequestPrimitive v_updateRequest := m_updateContainerBase;
  7435 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7436 + var Labels v_labels_1 := {"VALUE_1"};
  7437 +
  7438 + v_updateRequest.primitiveContent.container.labels := v_labels_1;
  7439 +
  7440 + v_ae1.start(f_CSE_NBR_ASY_002(m_updateContainerBase, m_createContainerBase)); //Update Container
  7441 + v_ae1.done;
  7442 +
  7443 + }
  7444 +
  7445 + testcase TC_CSE_NBR_ASY_002_RET() runs on Tester system CseSystem {
  7446 + // Local variables
  7447 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7448 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7449 +
  7450 + v_ae1.start(f_CSE_NBR_ASY_002(m_retrieve("NotInitialized", "NotInitialized"), m_createContainerBase)); //Retrieve Container
  7451 + v_ae1.done;
  7452 +
  7453 + }
  7454 +
  7455 + testcase TC_CSE_NBR_ASY_002_DEL() runs on Tester system CseSystem {
  7456 + // Local variables
  7457 + var template RequestPrimitive v_createRequest := m_createContainerBase;
  7458 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7459 +
  7460 + v_ae1.start(f_CSE_NBR_ASY_002(m_delete("NotInitialized", "NotInitialized"), m_createContainerBase)); //Delete Container
  7461 + v_ae1.done;
  7462 +
  7463 + }
  7464 +
  7465 + }// end group g_CSE_NBR_ASY_002
  7466 +
7414 7467 }// end group Asynchronous
7415 7468  
7416 7469 }// end group Non_Blocking_Requests
... ...