frostfs-testcases/robot/resources/lib/robot/common_steps_acl_bearer.robot
Elizaveta Chichindaeva e5d6662905 [#162] eACL: Create eACL with neofs-cli
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-03-25 14:57:01 +03:00

48 lines
2.1 KiB
Text

*** Settings ***
Variables common.py
Variables wellknown_acl.py
*** Keywords ***
Create Container Public
[Arguments] ${USER_KEY}
${PUBLIC_CID_GEN} = Create container ${USER_KEY} ${PUBLIC_ACL} ${COMMON_PLACEMENT_RULE}
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PUBLIC_CID_GEN}
[Return] ${PUBLIC_CID_GEN}
Create Container Inaccessible
[Arguments] ${USER_KEY}
${INACCESSIBLE_CID_GEN} = Create container ${USER_KEY} ${INACCESSIBLE_ACL} ${COMMON_PLACEMENT_RULE}
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${INACCESSIBLE_CID_GEN}
[Return] ${INACCESSIBLE_CID_GEN}
Generate file
[Arguments] ${SIZE}
${FILE_S_GEN} = Generate file of bytes ${SIZE}
[Return] ${FILE_S_GEN}
Prepare eACL Role rules
[Arguments] ${CID}
Log Set eACL for different Role cases
# eACL rules for all operations and similar permissions
@{Roles} = Create List others user system
FOR ${role} IN @{Roles}
${rule1} = Set Variable deny get ${role}
${rule2} = Set Variable deny head ${role}
${rule3} = Set Variable deny put ${role}
${rule4} = Set Variable deny delete ${role}
${rule5} = Set Variable deny search ${role}
${rule6} = Set Variable deny getrange ${role}
${rule7} = Set Variable deny getrangehash ${role}
${eACL_gen} = Create List ${rule1} ${rule2} ${rule3} ${rule4} ${rule5} ${rule6} ${rule7}
${EACL_FILE} = Create eACL ${CID} ${eACL_gen}
Set Global Variable ${EACL_DENY_ALL_${role}} ${EACL_FILE}
END
[Return] gen_eacl_deny_all_${role}