From 708a4f51c5e6db315359aff6c458dac360bd19b2 Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Fri, 8 Jul 2022 13:10:20 +0300 Subject: [PATCH] [#245] Fix access tests for IR Signed-off-by: Elizaveta Chichindaeva --- .../integration/acl/acl_basic_private_container.robot | 7 +++++-- .../integration/acl/acl_basic_public_container.robot | 9 ++++++--- .../acl/acl_basic_readonly_container.robot | 7 +++++-- .../integration/acl/acl_extended_actions_system.robot | 11 ++++++++--- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/robot/testsuites/integration/acl/acl_basic_private_container.robot b/robot/testsuites/integration/acl/acl_basic_private_container.robot index 1b3bbee6..c1e38529 100644 --- a/robot/testsuites/integration/acl/acl_basic_private_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_private_container.robot @@ -10,6 +10,7 @@ Resource setup_teardown.robot *** Variables *** ${DEPOSIT} = ${30} +${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied *** Test cases *** Basic ACL Operations for Private Container @@ -53,7 +54,9 @@ Check Private Container ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PRIV_CID} Run Keyword And Expect Error * ... Put object ${WALLET_OTH} ${FILE_S} ${PRIV_CID} - ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${PRIV_CID} wallet_config=${IR_WALLET_CONFIG} + ${ERR} = Run Keyword And Expect Error * + ... Put Object ${IR_WALLET_PATH} ${FILE_S} ${PRIV_CID} wallet_config=${IR_WALLET_CONFIG} + Should Contain ${ERR} ${EACL_ERROR_MSG} ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PRIV_CID} # Get @@ -81,7 +84,7 @@ Check Private Container Get Range hash ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} Search Object ${USER_WALLET} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} Run Keyword And Expect Error * ... Search object ${WALLET_OTH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} diff --git a/robot/testsuites/integration/acl/acl_basic_public_container.robot b/robot/testsuites/integration/acl/acl_basic_public_container.robot index 85d0285f..797a1b0e 100644 --- a/robot/testsuites/integration/acl/acl_basic_public_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_public_container.robot @@ -10,6 +10,7 @@ Resource setup_teardown.robot *** Variables *** ${DEPOSIT} = ${30} +${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied *** Test cases *** @@ -46,7 +47,9 @@ Check Public Container # Put ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PUBLIC_CID} ${S_OID_OTHER} = Put Object ${WALLET_OTH} ${FILE_S} ${PUBLIC_CID} - ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${PUBLIC_CID} wallet_config=${IR_WALLET_CONFIG} + ${ERR} = Run Keyword And Expect Error * + ... Put Object ${IR_WALLET_PATH} ${FILE_S} ${PUBLIC_CID} wallet_config=${IR_WALLET_CONFIG} + Should Contain ${ERR} ${EACL_ERROR_MSG} ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PUBLIC_CID} # Get @@ -72,7 +75,7 @@ Check Public Container #Get Range Hash ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} Search object ${USER_WALLET} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} Search object ${WALLET_OTH} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} Search object ${IR_WALLET_PATH} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} wallet_config=${IR_WALLET_CONFIG} @@ -96,9 +99,9 @@ Check Public Container # Delete - Delete object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_SYS_IR} Delete Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_SYS_SN} Run Keyword And Expect Error * ... Delete object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * ... Delete object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER} + Delete object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER} diff --git a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot index 63f5a5ba..f63cf162 100644 --- a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot @@ -10,6 +10,7 @@ Resource setup_teardown.robot *** Variables *** ${DEPOSIT} = ${30} +${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied *** Test cases *** Basic ACL Operations for Read-Only Container @@ -49,7 +50,9 @@ Check Read-Only Container ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${READONLY_CID} Run Keyword And Expect Error * ... Put object ${WALLET_OTH} ${FILE_S} ${READONLY_CID} - ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${READONLY_CID} wallet_config=${IR_WALLET_CONFIG} + ${ERR} = Run Keyword And Expect Error * + ... Put Object ${IR_WALLET_PATH} ${FILE_S} ${READONLY_CID} wallet_config=${IR_WALLET_CONFIG} + Should Contain ${ERR} ${EACL_ERROR_MSG} ${S_OID_SYS_SN} = Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${READONLY_CID} # Get @@ -74,7 +77,7 @@ Check Read-Only Container #Get Range hash ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} Search Object ${USER_WALLET} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} Search Object ${WALLET_OTH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} Search Object ${IR_WALLET_PATH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} wallet_config=${IR_WALLET_CONFIG} diff --git a/robot/testsuites/integration/acl/acl_extended_actions_system.robot b/robot/testsuites/integration/acl/acl_extended_actions_system.robot index 3b763f94..d6ce7595 100644 --- a/robot/testsuites/integration/acl/acl_extended_actions_system.robot +++ b/robot/testsuites/integration/acl/acl_extended_actions_system.robot @@ -16,6 +16,7 @@ Resource eacl_tables.robot &{USER_HEADER_DEL} = key1=del key2=del &{ANOTHER_USER_HEADER} = key1=oth key2=oth ${DEPOSIT} = ${30} +${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied *** Test cases *** Extended ACL Operations @@ -56,7 +57,10 @@ Check eACL Deny and Allow All System @{S_OBJ_H} = Create List ${S_OID_USER} - Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} + ${ERR} = Run Keyword And Expect Error * + ... Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} + Should Contain ${ERR} ${EACL_ERROR_MSG} + Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} Get object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl wallet_config=${IR_WALLET_CONFIG} @@ -135,9 +139,10 @@ Check eACL Deny and Allow All System ${D_OID_USER_S} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} ${D_OID_USER_SN} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} - - Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} + ${ERR} = Run Keyword And Expect Error * + ... Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} + Should Contain ${ERR} ${EACL_ERROR_MSG} Get object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl wallet_config=${IR_WALLET_CONFIG} Get object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl