2021-07-15 17:57:57 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
|
|
|
Variables wellknown_acl.py
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-04-25 09:53:20 +00:00
|
|
|
Library container.py
|
|
|
|
Library neofs_verbs.py
|
2022-05-20 11:18:14 +00:00
|
|
|
Library utility_keywords.py
|
2022-04-25 09:53:20 +00:00
|
|
|
Library Collections
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2021-12-09 10:58:51 +00:00
|
|
|
Resource setup_teardown.robot
|
|
|
|
Resource payment_operations.robot
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
*** Variables ***
|
2022-03-15 11:58:59 +00:00
|
|
|
&{ATTR_FILENAME} = FileName=new
|
|
|
|
${ATTR_DUPLICATE} = FileType=jpg,FileType=png
|
|
|
|
&{ATTR_NONE} = NoAttribute=''
|
|
|
|
&{ATTR_SINGLE} = AttrNum=one
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
Object Attrubutes
|
|
|
|
[Timeout] 10 min
|
|
|
|
[Setup] Setup
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
Check Various Object Attributes Simple
|
|
|
|
Check Various Object Attributes Complex
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
[Teardown] Teardown object_attributes
|
|
|
|
|
|
|
|
|
|
|
|
*** Keywords ***
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
Check Various Object Attributes
|
|
|
|
[Arguments] ${COMPLEXITY}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
${WALLET} ${_} ${_} = Prepare Wallet And Deposit
|
|
|
|
|
|
|
|
${PUBLIC_CID} = Create Container ${WALLET} basic_acl=${PUBLIC_ACL_F}
|
|
|
|
${OBJ_SIZE} = Run Keyword If """${COMPLEXITY}""" == """Simple"""
|
|
|
|
... Set Variable ${SIMPLE_OBJ_SIZE}
|
|
|
|
... ELSE
|
|
|
|
... Set Variable ${COMPLEX_OBJ_SIZE}
|
|
|
|
${FILE} ${_} = Generate File ${OBJ_SIZE}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
###################################################
|
|
|
|
# Checking that object attributes cannot duplicate
|
|
|
|
###################################################
|
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
${ERR} = Run Keyword And Expect Error *
|
|
|
|
... Put object ${WALLET} ${FILE} ${PUBLIC_CID} user_headers=${ATTR_FILENAME}
|
|
|
|
Should Contain ${ERR} code = 1024 message = duplication of attributes detected
|
|
|
|
# Robot doesn't allow to create a dictionary with the same keys,
|
|
|
|
# so using plain text option here
|
|
|
|
${ERR} = Run Keyword And Expect Error *
|
|
|
|
... Put object ${WALLET} ${FILE} ${PUBLIC_CID} options=--attributes ${ATTR_DUPLICATE}
|
|
|
|
Should Contain ${ERR} code = 1024 message = duplication of attributes detected
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
##################################################
|
|
|
|
# Checking that object cannot have empty attibute
|
|
|
|
##################################################
|
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
${ERR} = Run Keyword And Expect Error *
|
|
|
|
... Put object ${WALLET} ${FILE} ${PUBLIC_CID} user_headers=${ATTR_NONE}
|
|
|
|
Should Contain ${ERR} code = 1024 message = empty attribute value
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
#####################################################
|
|
|
|
# Checking a successful step with a single attribute
|
|
|
|
#####################################################
|
|
|
|
|
2022-06-06 13:47:13 +00:00
|
|
|
${OID} = Put object ${WALLET} ${FILE} ${PUBLIC_CID} user_headers=${ATTR_SINGLE}
|
|
|
|
${HEADER} = Head object ${WALLET} ${PUBLIC_CID} ${OID}
|
2022-03-15 11:58:59 +00:00
|
|
|
Dictionary Should Contain Sub Dictionary
|
|
|
|
... ${HEADER}[header][attributes]
|
|
|
|
... ${ATTR_SINGLE}
|
|
|
|
... msg="No expected User Attribute in HEAD response"
|
2022-06-06 13:47:13 +00:00
|
|
|
${FOUND_OIDS} = Search Object ${WALLET} ${PUBLIC_CID} filters=${ATTR_SINGLE}
|
|
|
|
Should Be Equal ${OID} ${FOUND_OIDS}[0]
|
|
|
|
... msg="Cannot SEARCH an object by User Attribute"
|