frostfs-testcases/robot/testsuites/integration/services/s3_gate.robot

77 lines
4 KiB
Text
Raw Normal View History

*** Settings ***
Variables ../../../variables/common.py
Library Collections
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/gates.py
Library ${KEYWORDS}/wallet_keywords.py
Resource ../${RESOURCES}/setup_teardown.robot
*** Variables ***
${DEPOSIT_AMOUNT} = ${5}
${WIF} = ${MAINNET_WALLET_WIF}
*** Test cases ***
NeoFS S3 Gateway
# TODO: check uploading an s3 object via neofs-cli and a neofs object via s3-gate
[Documentation] Execute operations via S3 Gate
[Timeout] 10 min
[Setup] Setup
${WALLET} ${ADDR} = Init Wallet from WIF ${ASSETS_DIR} ${WIF}
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
${FILE_S3} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_S3_HASH} = Get file hash ${FILE_S3}
${FILE_S3_NAME} = Get file name ${FILE_S3}
${FILE_FS} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_FS_HASH} = Get file hash ${FILE_FS}
${FILE_FS_NAME} = Get file name ${FILE_FS}
${CID}
... ${BUCKET}
... ${ACCESS_KEY_ID}
... ${SEC_ACCESS_KEY}
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${WALLET}
${CONTEINERS_LIST} = Container List ${WIF}
List Should Contain Value ${CONTEINERS_LIST} ${CID}
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}
${S3_BUCKET} = Create Bucket S3 ${S3_CLIENT}
${LIST_S3_BUCKETS} = List buckets S3 ${S3_CLIENT}
List Should Contain Value ${LIST_S3_BUCKETS} ${BUCKET}
List Should Contain Value ${LIST_S3_BUCKETS} ${S3_BUCKET}
${OID_S3} = Put object S3 ${S3_CLIENT} ${S3_BUCKET} ${FILE_S3}
Head object S3 ${S3_CLIENT} ${S3_BUCKET} ${FILE_S3_NAME}
${OID_FS} = Put object ${WIF} ${FILE_FS} ${CID} ${EMPTY} ${EMPTY}
Head object ${WIF} ${CID} ${OID_FS} ${EMPTY}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${S3_BUCKET}
List Should Contain Value ${LIST_S3_OBJECTS} ${FILE_S3_NAME}
${LIST_V2_S3_OBJECTS} = List objects S3 v2 ${S3_CLIENT} ${S3_BUCKET}
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
Get object S3 ${S3_CLIENT} ${S3_BUCKET} ${FILE_S3_NAME} s3_obj_get_s3
Verify file hash s3_obj_get_s3 ${FILE_S3_HASH}
Copy object S3 ${S3_CLIENT} ${S3_BUCKET} ${FILE_S3_NAME} NewName
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${S3_BUCKET}
List Should Contain Value ${LIST_S3_OBJECTS} NewName
Delete object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${S3_BUCKET}
List Should Not Contain Value ${LIST_S3_OBJECTS} FILE_S3_NAME