diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 6e0f7522f0bbc5202fb5bfe2a8d4bcb774eece09..dd36e5326f3d8e66c8aa5d0032d6f7d94184b7ef 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -4000,7 +4000,8 @@ group OtherTypes { M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile, ServiceSubscribedAppRule_optional serviceSubscribedAppRule, Subscription_optional subscription, - TimeSeries_optional timeSeries + TimeSeries_optional timeSeries, + Token_optional token } with { variant "untagged"; diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn index 3506954106e1344d93c97529876eed90ef26a6b8..4bcdb862ee9e4d8dd6239570a0b86857c6c5d1d2 100644 --- a/OneM2M_Testcases_CSE_Release_3.ttcn +++ b/OneM2M_Testcases_CSE_Release_3.ttcn @@ -8922,7 +8922,79 @@ module OneM2M_Testcases_CSE_Release_3 { group Notify { + /** + * @desc Check that the IUT notifies the Originator about a token issuance associated to its role + * + */ + testcase TC_CSE_SEC_ROL_NTF_001() runs on Tester system CseSystem { + // Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + + v_cse1.start(f_CSE_SEC_ROL_NTF_001()); + v_cse1.done; + } + + function f_CSE_SEC_ROL_NTF_001() runs on CseSimu system CseSystem { + // Local variables + var template RequestPrimitive v_requestPrimitive := mw_createToken; + var PrimitiveContent v_TRRemoteCseResource, v_ORRemoteCseResource; + var XSD.ID v_tokenResourceID, v_roleResourceID; + var integer v_TRRemoteCseIndex, v_ORRemoteCseIndex, v_tokenResourceIndex; + + // Test control + if(not(PICS_ROL_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": Role Based Access Control Procedure support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf04Up(-, true); + + // Test adapter configuration + + // Preamble + vc_cse2.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); //Token Repository + vc_cse2.stop; + + v_TRRemoteCseIndex := f_getLatestResourceIndex(vc_cse2); + v_ORRemoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); //Originator + v_roleResourceID := fx_assign_originatorRole(); //Creates a role resource in Role Repository + vc_cse2.start(f_cse_createResourceHandler(v_requestPrimitive)); + v_tokenResourceIndex := f_getLatestResourceIndex(vc_cse2); + + // Test Body + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + if(ischosen(vc_request.primitive.requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.token)){ + setverdict(pass, __SCOPE__ & ":Notification containing token representation received"); + } + else{ + setverdict(fail, __SCOPE__ & ":Wrong notification received"); + } + setverdict(pass, __SCOPE__ & ": Update request containing tokenLink attribute received"); + } + [] mccPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while waiting for Notification"); + } + } + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_cse2); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + }//end f_CSE_SEC_ROL_NTF_001 + + }//end group Notify }//end group Roles