Implemented new test case TC_CSE_SEC_ACP_016 according to TDE-2020-0028R02

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 2b5752b5
......@@ -8912,7 +8912,7 @@ module OneM2M_PermutationFunctions {
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container");
setverdict(pass, __SCOPE__ & ": Successful operation on AE");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
......@@ -8920,10 +8920,10 @@ module OneM2M_PermutationFunctions {
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)");
setverdict(fail, __SCOPE__ & ": Error while operation on resource AE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)");
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource AE");
}
}
......@@ -8934,6 +8934,75 @@ module OneM2M_PermutationFunctions {
f_cf01Down();
} //end f_CSE_SEC_ACP_015
function f_CSE_SEC_ACP_016(template RequestPrimitive p_request) runs on AeSimu system CseSystem {
// Local variables
var integer v_aeIndex := -1;
var integer v_ae3Index := -1;
var integer v_acpIndex := -1;
var integer v_groupIndex := -1;
var XSD.AnyURI v_ae2ResourceAddress;
var template RequestPrimitive v_groupRequest := m_createGroup(1, -, omit, int2, -, -, -);
var template RequestPrimitive v_createRequest := valueof(m_createAcpBase);
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe(-, -);
v_ae3Index := f_cse_createResource(int2, m_createAe("NMyApp3Id", -, "", "MyAe3", omit), -1); // AE3 is registred
v_groupRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_ae3Index].resource)};
v_groupIndex := f_cse_createResource(int9, v_groupRequest, -);
v_createRequest := m_createAcp(-, {f_getResourceId(vc_resourcesList[v_groupIndex].resource)} , -);
v_acpIndex := f_cse_createResource(int1, v_createRequest, -);
vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, omit), -1)); // AE2 is registred
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_ae2ResourceAddress := f_getLatestResourceAddress(vc_ae2);
// Test Body
p_request.to_ := v_ae2ResourceAddress;
p_request.from_ := f_getOriginator(v_aeIndex);
p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000);
f_send(e_mcaPort, m_request(valueof(p_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on AE");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, successful operation response when having no privilege on AE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource AE");
}
}
//Postamble
f_cse_postamble_deleteResources();
//Tear down
f_cf01Down();
} //end f_CSE_SEC_ACP_016
}// end of Basic_Operations
}//end group AccessControlPolicy
......
......@@ -9099,6 +9099,46 @@ module OneM2M_Testcases_CSE_Release_3 {
}//end TC_CSE_SEC_ACP_015_DEL
} //end g_CSE_SEC_ACP_015
group g_CSE_SEC_ACP_016 {
/**
* @desc Check that the IUT responds with an error when an AE tries an OPERATION on the AE1 resource whose accessControlPolicyIDs attribute is set.
*
*/
testcase TC_CSE_SEC_ACP_016_CRE() runs on Tester system CseSystem { //Create
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SEC_ACP_016(m_createContainerBase));
v_ae1.done;
}//end TC_CSE_SEC_ACP_016_CRE
testcase TC_CSE_SEC_ACP_016_UPD() runs on Tester system CseSystem { //Update
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_updateRequest := m_updateAeBase;
var Labels v_labels_1:= {"VALUE_1"};
v_updateRequest.primitiveContent.aE.labels := v_labels_1;
v_ae1.start(f_CSE_SEC_ACP_016(v_updateRequest));
v_ae1.done;
}//end TC_CSE_SEC_ACP_016_UPD
testcase TC_CSE_SEC_ACP_016_RET() runs on Tester system CseSystem { //Retrieve
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SEC_ACP_016(m_retrieve("Temporary", "Temporary")));
v_ae1.done;
}//end TC_CSE_SEC_ACP_016_RET
testcase TC_CSE_SEC_ACP_016_DEL() runs on Tester system CseSystem { //Delete
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SEC_ACP_016(m_delete("Temporary", "Temporary")));
v_ae1.done;
}//end TC_CSE_SEC_ACP_016_DEL
} //end g_CSE_SEC_ACP_016
}// end of Basic_Operations
}//end group AccessControlPolicy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment