diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index a31f1b71a3a59814dfa9d84706a872b97cb6961b..763e59ce5d93fac52ddf1a2c8816d9382dcaa8d0 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -2155,8 +2155,7 @@ module OneM2M_Functions { } [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: Container create request not received"); - stop; + setverdict(inconc, __SCOPE__&":INFO: Create request not received"); } } diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index d3ab79cd0857010a2aefae9cf15c2af9f44b59b2..d0a90877c7eda2883c389a215f017c636f1aab33 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1491,9 +1491,9 @@ module OneM2M_Templates { /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, template (value) Notification p_notification) modifies m_notify := { + template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, template (value) Notification p_notification, template (omit) AbsRelTimestamp p_requestExpirationTimestamp := omit) modifies m_notify := { primitiveContent := {notification := p_notification}, - requestExpirationTimestamp := {alt_1 := 10000}//Needed for polling + requestExpirationTimestamp := p_requestExpirationTimestamp//Needed for polling }; /** diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 0a8892e512f6f520e4b9cf63af03c2ac0dc84079..cd148c7f9e7cb63665be64f6fb3d37c1c3309d61 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -8984,6 +8984,10 @@ module OneM2M_PermutationFunctions { group PollingChannel { + /** + * @desc Check that the IUT rejects a <pollingChannel> OPERATION of the AE when AE-ID is not same as the AE-ID of the parent resource + * + */ function f_CSE_PCH_005(template RequestPrimitive p_requestPrimitive) runs on AeSimu { //Local variables diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 65907f3f87754910e79a738fceae1dd6c35ea225..e8f937d6566c0798b04f2d3e0519c6de04bab623 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -3303,9 +3303,9 @@ module OneM2M_Testcases_CSE_Release_2 { var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_acpAuxIndex := -1; - var RequestPrimitive v_req1; - var MsgIn v_resp1; - var RequestPrimitive v_req2; + var RequestPrimitive v_req1, v_req2, v_req3; + var MsgIn v_resp1, v_resp3; + var ResponsePrimitive v_resp2; // Test control @@ -3357,10 +3357,41 @@ module OneM2M_Testcases_CSE_Release_2 { } // Postamble + f_checkAeSimuStatus(); + + //Send response in any case + v_resp2 := valueof(m_responseNotification(int2000, omit)); + v_resp2.requestIdentifier := v_resp1.primitive.responsePrimitive.primitiveContent.requestPrimitive.requestIdentifier;//requestIdentifier of req2 + v_req3 := valueof(m_notifyResponsePrimitive(f_getResourceAddress(v_resourceIndex) & "/" & c_resourceShortNamePollingChannelUri, v_resp2)); + v_req3.from_ := f_getOriginator(v_aeIndex); + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req3))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_resp3 { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response to req3 received"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while performing notification"); + } + [] mcaPort.receive { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while performing notification"); + } + } + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); + f_cf02Down(); + } // end TC_CSE_PCH_001 /** @@ -3383,9 +3414,9 @@ module OneM2M_Testcases_CSE_Release_2 { // Local variables var integer v_aeIndex, v_acpAuxIndex := -1; var integer v_resourceIndex := -1; - var RequestPrimitive v_request; - var MsgIn v_response; - var RequestPrimitive v_requestNotify; + var RequestPrimitive v_req1, v_req2, v_req3; + var MsgIn v_resp1, v_resp3; + var ResponsePrimitive v_resp2; // Test control @@ -3404,16 +3435,17 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex); - v_requestNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_CSE1_ID))); + v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_CSE1_ID))); - vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify)); + vc_cse1.start(f_cse_notifyProcedure_notify(v_req2)); + v_req2.from_ := PX_CSE1_ID; - v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); + v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1))); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePollingResponse(v_req2))) -> value v_resp1 { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Polling response received"); } @@ -3435,6 +3467,35 @@ module OneM2M_Testcases_CSE_Release_2 { } // Postamble + f_checkAeSimuStatus(); + + //Send response in any case + v_resp2 := valueof(m_responseNotification(int2000, omit)); + v_resp2.requestIdentifier := v_resp1.primitive.responsePrimitive.primitiveContent.requestPrimitive.requestIdentifier;//requestIdentifier of req2 + v_req3 := valueof(m_notifyResponsePrimitive(f_getResourceAddress(v_resourceIndex) & "/" & c_resourceShortNamePollingChannelUri, v_resp2)); + v_req3.from_ := f_getOriginator(v_aeIndex); + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req3))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_resp3 { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response to req3 received"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while performing notification"); + } + [] mcaPort.receive { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while performing notification"); + } + } + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); f_cse_postamble_deleteResources(); // Tear down @@ -3442,7 +3503,7 @@ module OneM2M_Testcases_CSE_Release_2 { } // end TC_CSE_PCH_002 /** - * @desc Check that the IUT which hosts <pollingChannel> resource forwards the polling response message to the CSE when receiving a Notify request to the <pollingChannelURI> resource from the AE + * @desc Check that the IUT performs both forwarding the response to the CSE and sending response to AE after receiving a Notify Request sent to the <pollingChannelURI> resource * */ testcase TC_CSE_PCH_003() runs on Tester system CseSystem { @@ -3487,11 +3548,10 @@ module OneM2M_Testcases_CSE_Release_2 { v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1))); - //v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification)); - v_req2 := valueof(m_notify(f_getResourceAddress(v_aeIndex))); - v_req2.requestExpirationTimestamp := {alt_1 := 15000}; + v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_CSE1_ID))); vc_cse1.start(f_cse_notifyProcedure_notify(v_req2)); + v_req2.from_ := PX_CSE1_ID; tc_ac.start; alt { @@ -3552,7 +3612,11 @@ module OneM2M_Testcases_CSE_Release_2 { // Tear down f_cf02Down(); } - + + /** + * @desc Check that the IUT which performs polling send the Notify request to <pollingChannelURI> Hosting CSE after receiving response using polling channel + * + */ testcase TC_CSE_PCH_004() runs on Tester system CseSystem { var CseSimu v_cse1 := CseSimu.create("CSE1") alive; @@ -3687,65 +3751,62 @@ module OneM2M_Testcases_CSE_Release_2 { */ testcase TC_CSE_PCH_006() runs on Tester system CseSystem { - var CseSimu v_cse1 := CseSimu.create("CSE1") alive; - v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1)); - v_cse1.done; + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; - v_cse1.start(f_CSE_PCH_006()); - v_cse1.done; + v_ae1.start(f_CSE_PCH_006()); + v_ae1.done; } - function f_CSE_PCH_006() runs on CseSimu { + function f_CSE_PCH_006() runs on AeSimu { // Local variables - var integer v_aeIndex, v_aeIndexForResourceAddress := -1; + var integer v_aeIndex, v_acpAuxIndex := -1; var integer v_resourceIndex := -1; - var MsgIn v_response; - var RequestPrimitive v_requestNotify; + var RequestPrimitive v_req1; // Test control // Test component configuration - f_cf02UpCseSimuMaster(); + f_cf02Up(); // Test adapter configuration - // Preamble - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); - - vc_ae1.start(f_cse_preamble_registerAe());//AE1 is registred; - f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - - v_aeIndex := f_getLatestResourceIndex(vc_ae1); - - v_aeIndexForResourceAddress := f_getResourceFromAeSimu(vc_ae1); - - vc_ae1.start(f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex));//PollingChannel is created; - f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - - v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndexForResourceAddress))); - v_requestNotify.from_ := PX_CSE1_ID; - - mccPort.send(f_getMsgOutPrimitive(m_request(v_requestNotify))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int4108))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ":Response status code set to 4108 (REQUEST_TIMEOUT)"); - } - [] mccPort.receive(mw_response()) { - tc_ac.stop; - setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__&":INFO: No answer while performing notification"); - } - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); + // Preamble + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + + v_acpAuxIndex := f_cse_preamble_createAcpAux(); + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//AE1 is registred; + + v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex); + + v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_req1.requestExpirationTimestamp := { alt_1 := 10000}; + + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4008))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":Response status code set to 4008 (REQUEST_TIMEOUT)"); + } + [] mcaPort.receive(mw_response()) { + tc_ac.stop; + setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__&":INFO: No answer while performing notification"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); // Tear down - f_cf02DownCseSimuMaster(); + f_cf02Down(); } // end f_CSE_PCH_006 }//end group PollingChannel