From 3e4ac859cd8d360d0f820b007a5c65b96dae07ac Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Fri, 23 Feb 2018 16:37:42 +0100 Subject: [PATCH] New TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL added into IN and MN profile Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org> --- OneM2M_TestControl_IN_profile.ttcn | 2 +- OneM2M_TestControl_MN_profile.ttcn | 2 +- OneM2M_Testcases_CSE_Release_1.ttcn | 64 +++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/OneM2M_TestControl_IN_profile.ttcn b/OneM2M_TestControl_IN_profile.ttcn index ca83bff..b092d21 100644 --- a/OneM2M_TestControl_IN_profile.ttcn +++ b/OneM2M_TestControl_IN_profile.ttcn @@ -215,7 +215,7 @@ module OneM2M_TestControl_IN_profile { if(true) {execute (TC_CSE_DMR_UPD_001_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_002_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_003_ACP_LBL());} - if(PICS_ACP_AT and PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL());} + if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_ACP_CT());} if(true) {execute (TC_CSE_DMR_UPD_008_ACP_PVS());} if(true) {execute (TC_CSE_DMR_UPD_009_ACP_EXC());} diff --git a/OneM2M_TestControl_MN_profile.ttcn b/OneM2M_TestControl_MN_profile.ttcn index ed1cf99..955d385 100644 --- a/OneM2M_TestControl_MN_profile.ttcn +++ b/OneM2M_TestControl_MN_profile.ttcn @@ -238,7 +238,7 @@ module OneM2M_TestControl_MN_profile { if(true) {execute (TC_CSE_DMR_UPD_001_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_002_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_003_ACP_LBL());} - if(true) {execute (TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL());} + if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_ACP_CT());} if(true) {execute (TC_CSE_DMR_UPD_008_ACP_PVS());} if(true) {execute (TC_CSE_DMR_UPD_009_ACP_EXC());} diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 8a1a247..5453229 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -5034,6 +5034,70 @@ module OneM2M_Testcases_CSE_Release_1 { } } + testcase TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var SetOfAcrs v_privileges_1 := {accessControlRule_list := {valueof(m_createAcr({"all"}, int63))}}; + var SetOfAcrs v_selfprivileges_2 := {accessControlRule_list := {valueof(m_createAcr({"all"}, int62))}}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for * + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3 + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {};//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfprivileges_2; //Attribute 1 + v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1;//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_ae1.start(f_CSE_DMR_UPD_004(int1, v_createRequest, v_updateRequest, v_nullFields));//AccessControlPolicy + v_ae1.done; + + + + if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + //Check attribute 1 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations, v_selfprivileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") + } + //Check attribute 2 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges, valueof(v_updateRequest.primitiveContent.accessControlPolicy.privileges))){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not added correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + //Check attribute 1 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations, v_selfprivileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") + } + //Check attribute 2 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.privileges, valueof(v_updateRequest.primitiveContent.accessControlPolicy.privileges))){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not added correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + testcase TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; -- GitLab