s3_gate_object refactoring

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2022-03-14 11:39:24 +03:00 committed by Anastasia Prasolova
parent 2b51542ca2
commit b27159b417

View file

@ -2,19 +2,17 @@
Variables common.py Variables common.py
Library Collections Library Collections
Library OperatingSystem
Library neofs.py Library neofs.py
Library payment_neogo.py Library s3_gate.py
Library gates.py
Library wallet_keywords.py
Library contract_keywords.py Library contract_keywords.py
Library utility_keywords.py
Resource setup_teardown.robot Resource setup_teardown.robot
Resource payment_operations.robot
*** Variables *** *** Variables ***
${DEPOSIT_AMOUNT} = ${5} @{INCLUDE_SVC} = s3_gate coredns
${WIF} = ${MAINNET_WALLET_WIF}
@{INCLUDE_SVC} = s3_gate
*** Test cases *** *** Test cases ***
Objects in NeoFS S3 Gateway Objects in NeoFS S3 Gateway
@ -22,17 +20,14 @@ Objects in NeoFS S3 Gateway
[Documentation] Execute operations with objects via S3 Gate [Documentation] Execute operations with objects via S3 Gate
[Timeout] 10 min [Timeout] 10 min
[Setup] Setup [Setup] Setup
Make Up ${INCLUDE_SVC} Make Up ${INCLUDE_SVC}
${WALLET} ${ADDR} = Init Wallet from WIF ${ASSETS_DIR} ${WIF} ${WALLET} ${_} ${WIF} = Prepare Wallet And Deposit
${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} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_S3_HASH} = Get file hash ${FILE_S3} ${FILE_S3_HASH} = Get file hash ${FILE_S3}
${FILE_S3_NAME} = Get file name ${FILE_S3} ${_} ${S3_OBJECT_KEY} = Split Path ${FILE_S3}
${CID} ${CID}
... ${BUCKET} ... ${BUCKET}
@ -44,39 +39,37 @@ Objects in NeoFS S3 Gateway
List Should Contain Value ${CONTEINERS_LIST} ${CID} List Should Contain Value ${CONTEINERS_LIST} ${CID}
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY} ${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}
${NEW_BUCKET} = Create Bucket S3 ${S3_CLIENT} ${NEW_BUCKET} = Create Bucket S3 ${S3_CLIENT}
${NEW_BUCKET_2} = Create Bucket S3 ${S3_CLIENT} ${NEW_BUCKET_2} = Create Bucket S3 ${S3_CLIENT}
Put object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3} Put object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3}
Head object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3_NAME} Head object S3 ${S3_CLIENT} ${NEW_BUCKET} ${S3_OBJECT_KEY}
Put object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${FILE_S3} Put object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${FILE_S3}
Head object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${FILE_S3_NAME} Head object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${S3_OBJECT_KEY}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET} ${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET}
List Should Contain Value ${LIST_S3_OBJECTS} ${FILE_S3_NAME} List Should Contain Value ${LIST_S3_OBJECTS} ${S3_OBJECT_KEY}
${LIST_S3_OBJECTS_2} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${LIST_S3_OBJECTS_2} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET_2}
List Should Contain Value ${LIST_S3_OBJECTS_2} ${FILE_S3_NAME} List Should Contain Value ${LIST_S3_OBJECTS_2} ${S3_OBJECT_KEY}
${LIST_V2_S3_OBJECTS} = List objects S3 v2 ${S3_CLIENT} ${NEW_BUCKET} ${LIST_V2_S3_OBJECTS} = List objects S3 v2 ${S3_CLIENT} ${NEW_BUCKET}
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME} List Should Contain Value ${LIST_V2_S3_OBJECTS} ${S3_OBJECT_KEY}
Get object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3_NAME} s3_obj_get_s3
Verify file hash s3_obj_get_s3 ${FILE_S3_HASH} ${OBJ_PATH} = Get object S3 ${S3_CLIENT} ${NEW_BUCKET} ${S3_OBJECT_KEY}
Verify file hash ${OBJ_PATH} ${FILE_S3_HASH}
#TODO: Solve the issue on CopyObject #260 https://github.com/nspcc-dev/neofs-s3-gw/issues/260 #TODO: Solve the issue on CopyObject #260 https://github.com/nspcc-dev/neofs-s3-gw/issues/260
Copy object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3_NAME} NewName ${COPIED_OBJ_PATH} = Copy object S3 ${S3_CLIENT} ${NEW_BUCKET} ${S3_OBJECT_KEY}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET} ${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET}
List Should Contain Value ${LIST_S3_OBJECTS} NewName List Should Contain Value ${LIST_S3_OBJECTS} ${COPIED_OBJ_PATH}
Copy object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${FILE_S3_NAME} NewName_2 ${COPIED_OBJ_PATH_2} = Copy object S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${S3_OBJECT_KEY}
${LIST_S3_OBJECTS_2} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET_2} ${LIST_S3_OBJECTS_2} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET_2}
List Should Contain Value ${LIST_S3_OBJECTS_2} NewName_2 List Should Contain Value ${LIST_S3_OBJECTS_2} ${COPIED_OBJ_PATH_2}
Delete object S3 ${S3_CLIENT} ${NEW_BUCKET} ${FILE_S3_NAME} Delete object S3 ${S3_CLIENT} ${NEW_BUCKET} ${S3_OBJECT_KEY}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET} ${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${NEW_BUCKET}
List Should Not Contain Value ${LIST_S3_OBJECTS} ${FILE_S3_NAME} List Should Not Contain Value ${LIST_S3_OBJECTS} ${S3_OBJECT_KEY}
[Teardown] Teardown s3_gate_object [Teardown] Teardown s3_gate_object