[#245] Fix access tests for IR

Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
Elizaveta Chichindaeva 2022-07-08 13:10:20 +03:00
parent 84230d12e3
commit 708a4f51c5
4 changed files with 24 additions and 10 deletions

View file

@ -10,6 +10,7 @@ Resource setup_teardown.robot
*** Variables *** *** Variables ***
${DEPOSIT} = ${30} ${DEPOSIT} = ${30}
${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied
*** Test cases *** *** Test cases ***
Basic ACL Operations for Private Container Basic ACL Operations for Private Container
@ -53,7 +54,9 @@ Check Private Container
${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PRIV_CID} ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PRIV_CID}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Put object ${WALLET_OTH} ${FILE_S} ${PRIV_CID} ... 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} ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PRIV_CID}
# Get # Get
@ -81,7 +84,7 @@ Check Private Container
Get Range hash ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 Get Range hash ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256
# Search # 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} Search Object ${USER_WALLET} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Search object ${WALLET_OTH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} ... Search object ${WALLET_OTH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}

View file

@ -10,6 +10,7 @@ Resource setup_teardown.robot
*** Variables *** *** Variables ***
${DEPOSIT} = ${30} ${DEPOSIT} = ${30}
${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied
*** Test cases *** *** Test cases ***
@ -46,7 +47,9 @@ Check Public Container
# Put # Put
${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PUBLIC_CID} ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PUBLIC_CID}
${S_OID_OTHER} = Put Object ${WALLET_OTH} ${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} ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PUBLIC_CID}
# Get # Get
@ -72,7 +75,7 @@ Check Public Container
#Get Range Hash ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 #Get Range Hash ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256
# Search # 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 ${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 ${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} 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
Delete object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_SYS_IR}
Delete Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_SYS_SN} Delete Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_SYS_SN}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Delete object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} ... Delete object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Delete object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER} ... Delete object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER}
Delete object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER}

View file

@ -10,6 +10,7 @@ Resource setup_teardown.robot
*** Variables *** *** Variables ***
${DEPOSIT} = ${30} ${DEPOSIT} = ${30}
${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied
*** Test cases *** *** Test cases ***
Basic ACL Operations for Read-Only Container 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} ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${READONLY_CID}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Put object ${WALLET_OTH} ${FILE_S} ${READONLY_CID} ... 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} ${S_OID_SYS_SN} = Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${READONLY_CID}
# Get # Get
@ -74,7 +77,7 @@ Check Read-Only Container
#Get Range hash ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 #Get Range hash ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256
# Search # 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 ${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 ${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} Search Object ${IR_WALLET_PATH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} wallet_config=${IR_WALLET_CONFIG}

View file

@ -16,6 +16,7 @@ Resource eacl_tables.robot
&{USER_HEADER_DEL} = key1=del key2=del &{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_USER_HEADER} = key1=oth key2=oth &{ANOTHER_USER_HEADER} = key1=oth key2=oth
${DEPOSIT} = ${30} ${DEPOSIT} = ${30}
${EACL_ERROR_MSG} = code = 2048 message = access to object operation denied
*** Test cases *** *** Test cases ***
Extended ACL Operations Extended ACL Operations
@ -56,7 +57,10 @@ Check eACL Deny and Allow All System
@{S_OBJ_H} = Create List ${S_OID_USER} @{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} 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} 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_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} ${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} 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 ${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 Get object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl