2020-12-11 11:35:02 +00:00
|
|
|
*** Settings ***
|
2021-02-08 05:05:17 +00:00
|
|
|
Variables ../../../variables/common.py
|
2020-12-11 11:35:02 +00:00
|
|
|
Library Collections
|
2021-02-08 05:05:17 +00:00
|
|
|
Library ../${RESOURCES}/neofs.py
|
|
|
|
Library ../${RESOURCES}/payment_neogo.py
|
|
|
|
Library ../${RESOURCES}/gates.py
|
2021-06-01 12:07:31 +00:00
|
|
|
Library ${KEYWORDS}/wallet_keywords.py
|
2021-06-01 12:07:31 +00:00
|
|
|
|
|
|
|
Resource ../${RESOURCES}/setup_teardown.robot
|
2020-12-11 11:35:02 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
*** Variables ***
|
|
|
|
${DEPOSIT_AMOUNT} = ${5}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
|
|
|
*** Test cases ***
|
2021-04-26 10:30:40 +00:00
|
|
|
NeoFS S3 Gateway
|
2020-12-11 11:35:02 +00:00
|
|
|
[Documentation] Execute operations via S3 Gate
|
|
|
|
[Timeout] 5 min
|
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
[Setup] Setup
|
2020-12-11 11:35:02 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
${WIF} = Form WIF from String 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb
|
2021-06-01 12:07:31 +00:00
|
|
|
${WALLET} ${ADDR} = Init Wallet from WIF ${ASSETS_DIR} ${WIF}
|
2021-06-01 12:07:31 +00:00
|
|
|
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
|
2020-12-11 11:35:02 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
|
|
|
... Transaction accepted in block ${TX_DEPOSIT}
|
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
${FILE_S3} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
|
2020-12-11 11:35:02 +00:00
|
|
|
${FILE_S3_HASH} = Get file hash ${FILE_S3}
|
2021-04-26 10:30:40 +00:00
|
|
|
${FILE_S3_NAME} = Get file name ${FILE_S3}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
${FILE_FS} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
|
2020-12-11 11:35:02 +00:00
|
|
|
${FILE_FS_HASH} = Get file hash ${FILE_FS}
|
2021-04-26 10:30:40 +00:00
|
|
|
${FILE_FS_NAME} = Get file name ${FILE_FS}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
|
|
|
${CID}
|
|
|
|
... ${BUCKET}
|
2021-04-26 10:30:40 +00:00
|
|
|
... ${ACCESS_KEY_ID}
|
|
|
|
... ${SEC_ACCESS_KEY}
|
2021-06-01 12:07:31 +00:00
|
|
|
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${WIF} keys/s3_docker_hcs.pub.key
|
2020-12-11 11:35:02 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
${CONTEINERS_LIST} = Container List ${WIF}
|
2020-12-11 11:35:02 +00:00
|
|
|
List Should Contain Value ${CONTEINERS_LIST} ${CID}
|
|
|
|
|
2021-04-26 10:30:40 +00:00
|
|
|
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}
|
|
|
|
|
|
|
|
${LIST_S3_BUCKETS} = List buckets S3 ${S3_CLIENT}
|
2020-12-11 11:35:02 +00:00
|
|
|
List Should Contain Value ${LIST_S3_BUCKETS} ${BUCKET}
|
|
|
|
|
|
|
|
Put object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3}
|
|
|
|
Head object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME}
|
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
${OID_FS} = Put object ${WIF} ${FILE_FS} ${CID} ${EMPTY} ${EMPTY}
|
|
|
|
Head object ${WIF} ${CID} ${OID_FS} ${EMPTY}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
|
|
|
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${BUCKET}
|
|
|
|
List Should Contain Value ${LIST_S3_OBJECTS} ${FILE_S3_NAME}
|
|
|
|
List Should Contain Value ${LIST_S3_OBJECTS} ${FILE_FS_NAME}
|
|
|
|
|
|
|
|
${LIST_V2_S3_OBJECTS} = List objects S3 v2 ${S3_CLIENT} ${BUCKET}
|
|
|
|
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
|
|
|
|
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
|
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
${OID_LIST_S3} = Search object ${WIF} ${CID} ${EMPTY} ${EMPTY} FileName=${FILE_S3_NAME}
|
2020-12-11 11:35:02 +00:00
|
|
|
${OID_S3} = Get From List ${OID_LIST_S3} 0
|
|
|
|
|
|
|
|
Get object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME} s3_obj_get_s3
|
|
|
|
Get object S3 ${S3_CLIENT} ${BUCKET} ${FILE_FS_NAME} fs_obj_get_s3
|
2021-04-26 10:30:40 +00:00
|
|
|
|
|
|
|
Verify file hash s3_obj_get_s3 ${FILE_S3_HASH}
|
|
|
|
Verify file hash fs_obj_get_s3 ${FILE_FS_HASH}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
Get object ${WIF} ${CID} ${OID_S3} ${EMPTY} s3_obj_get_fs
|
|
|
|
Get object ${WIF} ${CID} ${OID_FS} ${EMPTY} fs_obj_get_fs
|
2021-04-26 10:30:40 +00:00
|
|
|
|
|
|
|
Verify file hash s3_obj_get_fs ${FILE_S3_HASH}
|
|
|
|
Verify file hash fs_obj_get_fs ${FILE_FS_HASH}
|
2020-12-11 11:35:02 +00:00
|
|
|
|
|
|
|
Copy object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME} NewName
|
|
|
|
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${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} ${BUCKET}
|
|
|
|
List Should Not Contain Value ${LIST_S3_OBJECTS} FILE_S3_NAME
|
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
[Teardown] Teardown s3_gate
|