Skip to content
Snippets Groups Projects
Commit 809e09b6 authored by Enrique Sabatel's avatar Enrique Sabatel Committed by Miguel Angel Reina Ortega
Browse files

Added TC_CSE_SEC_ROL_NTF_001

parent 9c5ac04b
No related branches found
No related tags found
No related merge requests found
......@@ -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";
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment