TC_CSE_ACP_005_xxx - configuring correctly accessControlWindow in the test case. Closing #26

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 9d5f42b8
......@@ -3950,16 +3950,35 @@ module OneM2M_Functions {
*/
function f_getYear(charstring p_timestamp) runs on Tester return charstring {
var charstring v_year;
var charstring v_year := "";
var integer i;
for(i := 0; i < 3; i := i+1){
for(i := 0; i <= 3; i := i+1){
v_year := v_year & p_timestamp[i];
}
return v_year;
} // end f_getYear
/**
* @desc Retrieve Month from a given timestamp
* @param p_timestamp Given timestamp
* @return Year
*/
function f_getMonth(charstring p_timestamp) runs on Tester return charstring {
var charstring v_month := "";
var integer i;
for(i := 4; i <= 5; i := i+1){
if(p_timestamp[i] != "0") {
v_month := v_month & p_timestamp[i];
}
}
return v_month;
} // end f_getYear
/**
* @desc Retrieve IP address from a given address which includes port information separated by :
* @param p_addressPort Given address
......@@ -3967,7 +3986,7 @@ module OneM2M_Functions {
*/
function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring {
var charstring v_ipv4Address;
var charstring v_ipv4Address := "";
var integer i:= 0;
while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){
......
......@@ -5874,7 +5874,6 @@ module OneM2M_PermutationFunctions {
// Local variables
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_acpIndex := -1;
var charstring v_currentTime;
var RequestPrimitive v_createRequest;
var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63));
......@@ -5889,11 +5888,11 @@ module OneM2M_PermutationFunctions {
// Preamble
v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
v_currentTime := fx_generateTimestamp();
v_accessControlRule.accessControlContexts_list := {{{"* * * * * " & f_getYear(v_currentTime)}, omit, omit}};
v_accessControlRule.accessControlContexts_list := {{{"* * * * " & f_getMonth(v_currentTime) & " *"}, omit, omit}};
v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, -);
// Test Body
p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
......@@ -5922,6 +5921,8 @@ module OneM2M_PermutationFunctions {
//Postamble
f_cse_updateAcpAuxResource(int63);
f_cse_postamble_deleteResources();
//Tear down
......@@ -5932,8 +5933,9 @@ module OneM2M_PermutationFunctions {
function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{
// Local variables
var MsgIn v_response;
var charstring v_month;
var charstring v_currentTime;
var integer v_aeIndex := -1;
var integer v_acpIndex := -1;
var RequestPrimitive v_createRequest;
var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63));
......@@ -5946,11 +5948,18 @@ module OneM2M_PermutationFunctions {
// Preamble
v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
v_accessControlRule.accessControlContexts_list := {{{"* * * * * 3000"}, omit, omit}};
v_currentTime := fx_generateTimestamp();
v_month := f_getMonth(v_currentTime);
if(v_month =="12") {
v_month := "1";
} else {
v_month := int2char(char2int(v_month) + 1);
}
v_accessControlRule.accessControlContexts_list := {{{"* * * * " & v_month & " *"}, omit, omit}};
v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, -);
// Test Body
p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
......@@ -5979,6 +5988,8 @@ module OneM2M_PermutationFunctions {
//Postamble
f_cse_updateAcpAuxResource(int63);
f_cse_postamble_deleteResources();
//Tear down
......
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