2020-07-01 02:28:31 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-03-15 11:58:59 +00:00
|
|
|
Library neofs_verbs.py
|
2022-04-07 18:48:03 +00:00
|
|
|
Library complex_object_actions.py
|
2021-09-27 20:41:21 +00:00
|
|
|
Library neofs.py
|
|
|
|
Library contract_keywords.py
|
2022-03-15 11:58:59 +00:00
|
|
|
Library Collections
|
2022-05-20 11:18:14 +00:00
|
|
|
Library utility_keywords.py
|
2021-06-01 12:07:31 +00:00
|
|
|
|
2021-02-10 18:53:26 +00:00
|
|
|
Resource common_steps_object.robot
|
2021-09-27 20:41:21 +00:00
|
|
|
Resource setup_teardown.robot
|
|
|
|
Resource payment_operations.robot
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-07-20 11:10:13 +00:00
|
|
|
*** Variables ***
|
|
|
|
${CLEANUP_TIMEOUT} = 10s
|
2022-03-15 11:58:59 +00:00
|
|
|
&{FILE_USR_HEADER} = key1=1 key2=abc
|
|
|
|
&{FILE_USR_HEADER_OTH} = key1=2
|
2022-04-07 18:48:03 +00:00
|
|
|
${ALREADY_REMOVED_ERROR} = code = 1024 message = object already removed
|
2022-03-15 11:58:59 +00:00
|
|
|
|
2020-07-01 02:28:31 +00:00
|
|
|
|
|
|
|
*** Test cases ***
|
2020-12-01 21:48:20 +00:00
|
|
|
NeoFS Complex Object Operations
|
2022-03-15 11:58:59 +00:00
|
|
|
[Documentation] Testcase to validate NeoFS operations with complex object.
|
|
|
|
[Tags] Object
|
2020-11-27 00:33:11 +00:00
|
|
|
[Timeout] 20 min
|
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
[Setup] Setup
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
${WALLET} ${ADDR} ${WIF} = Prepare Wallet And Deposit
|
2022-02-01 13:42:41 +00:00
|
|
|
${CID} = Prepare container ${WIF} ${WALLET}
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-05-20 11:18:14 +00:00
|
|
|
${FILE} ${FILE_HASH} = Generate file ${COMPLEX_OBJ_SIZE}
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${S_OID} = Put object ${WALLET} ${FILE} ${CID}
|
|
|
|
${H_OID} = Put object ${WALLET} ${FILE} ${CID} user_headers=${FILE_USR_HEADER}
|
|
|
|
${H_OID_OTH} = Put object ${WALLET} ${FILE} ${CID} user_headers=${FILE_USR_HEADER_OTH}
|
2020-12-23 22:38:16 +00:00
|
|
|
|
|
|
|
Should Be True '${S_OID}'!='${H_OID}' and '${H_OID}'!='${H_OID_OTH}'
|
2020-11-27 00:33:11 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Validate storage policy for object ${WALLET} 2 ${CID} ${S_OID}
|
|
|
|
Validate storage policy for object ${WALLET} 2 ${CID} ${H_OID}
|
|
|
|
Validate storage policy for object ${WALLET} 2 ${CID} ${H_OID_OTH}
|
2020-11-27 00:33:11 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
@{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH}
|
|
|
|
@{S_OBJ_H} = Create List ${H_OID}
|
|
|
|
@{S_OBJ_H_OTH} = Create List ${H_OID_OTH}
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Search Object ${WALLET} ${CID} --root expected_objects_list=${S_OBJ_ALL}
|
2022-03-15 11:58:59 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${GET_OBJ_S} = Get object ${WALLET} ${CID} ${S_OID}
|
|
|
|
${GET_OBJ_H} = Get object ${WALLET} ${CID} ${H_OID}
|
2020-12-01 21:48:20 +00:00
|
|
|
|
2022-03-15 11:58:59 +00:00
|
|
|
${FILE_HASH_S} = Get file hash ${GET_OBJ_S}
|
|
|
|
${FILE_HASH_H} = Get file hash ${GET_OBJ_H}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-03-15 11:58:59 +00:00
|
|
|
Should Be Equal ${FILE_HASH_S} ${FILE_HASH}
|
|
|
|
Should Be Equal ${FILE_HASH_H} ${FILE_HASH}
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Range Hash ${WALLET} ${CID} ${S_OID} ${EMPTY} 0:10
|
|
|
|
Get Range Hash ${WALLET} ${CID} ${H_OID} ${EMPTY} 0:10
|
2020-11-27 00:33:11 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Range ${WALLET} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10
|
|
|
|
Get Range ${WALLET} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10
|
2020-11-27 00:33:11 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Search object ${WALLET} ${CID} --root expected_objects_list=${S_OBJ_ALL}
|
|
|
|
Search object ${WALLET} ${CID} --root filters=${FILE_USR_HEADER} expected_objects_list=${S_OBJ_H}
|
|
|
|
Search object ${WALLET} ${CID} --root filters=${FILE_USR_HEADER_OTH} expected_objects_list=${S_OBJ_H_OTH}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
&{S_RESPONSE} = Head object ${WALLET} ${CID} ${S_OID}
|
|
|
|
&{H_RESPONSE} = Head object ${WALLET} ${CID} ${H_OID}
|
2022-03-15 11:58:59 +00:00
|
|
|
Dictionary Should Contain Sub Dictionary
|
2022-04-07 18:48:03 +00:00
|
|
|
... ${H_RESPONSE}[header][attributes]
|
2022-03-15 11:58:59 +00:00
|
|
|
... ${FILE_USR_HEADER}
|
|
|
|
... msg="There are no User Headers in HEAD response"
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-04-07 18:48:03 +00:00
|
|
|
${PAYLOAD_LENGTH} ${SPLIT_ID} ${SPLIT_OBJECTS} = Restore Large Object By Last
|
2022-02-01 13:42:41 +00:00
|
|
|
... ${WALLET} ${CID} ${S_OID}
|
2022-04-07 18:48:03 +00:00
|
|
|
${H_PAYLOAD_LENGTH} ${H_SPLIT_ID} ${H_SPLIT_OBJECTS} = Restore Large Object By Last
|
2022-02-01 13:42:41 +00:00
|
|
|
... ${WALLET} ${CID} ${H_OID}
|
2022-04-07 18:48:03 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Compare With Link Object ${WALLET} ${CID} ${S_OID} ${SPLIT_ID} ${SPLIT_OBJECTS}
|
|
|
|
Compare With Link Object ${WALLET} ${CID} ${H_OID} ${H_SPLIT_ID} ${H_SPLIT_OBJECTS}
|
2022-04-07 18:48:03 +00:00
|
|
|
|
|
|
|
Should Be Equal As Numbers ${S_RESPONSE.header.payloadLength} ${PAYLOAD_LENGTH}
|
|
|
|
Should Be Equal As Numbers ${H_RESPONSE.header.payloadLength} ${H_PAYLOAD_LENGTH}
|
2020-12-23 22:38:16 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${TOMBSTONE_S} = Delete object ${WALLET} ${CID} ${S_OID}
|
|
|
|
${TOMBSTONE_H} = Delete object ${WALLET} ${CID} ${H_OID}
|
2020-12-23 22:38:16 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Verify Head tombstone ${WALLET} ${CID} ${TOMBSTONE_S} ${S_OID} ${ADDR}
|
|
|
|
Verify Head tombstone ${WALLET} ${CID} ${TOMBSTONE_H} ${H_OID} ${ADDR}
|
2020-12-02 23:08:05 +00:00
|
|
|
|
2021-07-20 11:10:13 +00:00
|
|
|
Tick Epoch
|
|
|
|
# we assume that during this time objects must be deleted
|
|
|
|
Sleep ${CLEANUP_TIMEOUT}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-04-07 18:48:03 +00:00
|
|
|
${ERR_MSG} = Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Get object ${WALLET} ${CID} ${S_OID}
|
2022-04-07 18:48:03 +00:00
|
|
|
Should Contain ${ERR_MSG} ${ALREADY_REMOVED_ERROR}
|
|
|
|
${ERR_MSG} = Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Get object ${WALLET} ${CID} ${H_OID}
|
2022-04-07 18:48:03 +00:00
|
|
|
Should Contain ${ERR_MSG} ${ALREADY_REMOVED_ERROR}
|
2020-12-04 12:28:59 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
[Teardown] Teardown object_complex
|
2022-04-07 18:48:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
|
|
|
Restore Large Object By Last
|
|
|
|
[Documentation] In this keyword we assemble Large Object from its parts. First, we search for the
|
|
|
|
... Last Object; then, we try to restore the Large Object using Split Chain. We check
|
|
|
|
... that all Object Parts have identical SplitID, accumulate total payload length and
|
|
|
|
... compile a list of Object Parts. For the first part of split we also check if is
|
|
|
|
... has the only `splitID` field in the split header.
|
|
|
|
... The keyword returns total payload length, SplitID and list of Part Objects for
|
|
|
|
... these data might be verified by other keywords.
|
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${CID} ${LARGE_OID}
|
2022-04-07 18:48:03 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${LAST_OID} = Get Last Object ${WALLET} ${CID} ${LARGE_OID}
|
|
|
|
&{LAST_OBJ_HEADER} = Head Object ${WALLET} ${CID} ${LAST_OID} is_raw=True
|
2022-04-07 18:48:03 +00:00
|
|
|
Should Be Equal ${LARGE_OID} ${LAST_OBJ_HEADER.header.split.parent}
|
|
|
|
|
|
|
|
${SPLIT_ID} = Set Variable ${LAST_OBJ_HEADER.header.split.splitID}
|
|
|
|
${PART_OID} = Set Variable ${LAST_OBJ_HEADER.objectID}
|
|
|
|
${PAYLOAD_LENGTH} = Set Variable 0
|
|
|
|
@{PART_OBJECTS} = Create List
|
|
|
|
|
|
|
|
FOR ${i} IN RANGE 1000
|
2022-02-01 13:42:41 +00:00
|
|
|
&{SPLIT_HEADER} = Head object ${WALLET} ${CID} ${PART_OID} is_raw=True
|
2022-04-07 18:48:03 +00:00
|
|
|
|
|
|
|
${PAYLOAD_LENGTH} = Evaluate ${PAYLOAD_LENGTH} + ${SPLIT_HEADER.header.payloadLength}
|
|
|
|
|
|
|
|
# Every Object of the given split contains the same SplitID
|
|
|
|
Should Be Equal ${SPLIT_HEADER.header.split.splitID} ${SPLIT_ID}
|
|
|
|
Should Be Equal ${SPLIT_HEADER.header.objectType} REGULAR
|
|
|
|
|
|
|
|
Append To List ${PART_OBJECTS} ${PART_OID}
|
|
|
|
|
|
|
|
# If we have reached the First Object, it has no `previous` field.
|
|
|
|
# Asserting this condition and exiting the loop.
|
|
|
|
${PASSED} = Run Keyword And Return Status
|
|
|
|
... Should Be Equal
|
|
|
|
... ${SPLIT_HEADER.header.split.previous} ${None}
|
|
|
|
|
|
|
|
Exit For Loop If ${PASSED}
|
|
|
|
${PART_OID} = Set Variable ${SPLIT_HEADER.header.split.previous}
|
|
|
|
END
|
|
|
|
|
|
|
|
[Return] ${PAYLOAD_LENGTH} ${SPLIT_ID} ${PART_OBJECTS}
|
|
|
|
|
|
|
|
|
|
|
|
Compare With Link Object
|
|
|
|
[Documentation] The keyword accepts Large Object SplitID and its Part Objects as
|
|
|
|
... a parameters. Then it requests the Link Object and verifies that
|
|
|
|
... a Split Chain which it stores is equal to the Part Objects list.
|
|
|
|
... In this way we check that Part Objects list restored from Last
|
|
|
|
... Object and the Split Chain from Link Object are equal and the
|
|
|
|
... system is able to restore the Large Object using any of these ways.
|
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${CID} ${LARGE_OID} ${SPLIT_ID} ${SPLIT_OBJECTS}
|
2022-04-07 18:48:03 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${LINK_OID} = Get Link Object ${WALLET} ${CID} ${LARGE_OID}
|
|
|
|
&{LINK_HEADER} = Head Object ${WALLET} ${CID} ${LINK_OID} is_raw=True
|
2022-04-07 18:48:03 +00:00
|
|
|
|
|
|
|
Reverse List ${SPLIT_OBJECTS}
|
|
|
|
Lists Should Be Equal
|
|
|
|
... ${LINK_HEADER.header.split.children}
|
|
|
|
... ${SPLIT_OBJECTS}
|
|
|
|
|
|
|
|
Should Be Equal As Numbers
|
|
|
|
... ${LINK_HEADER.header.payloadLength} 0
|
|
|
|
|
|
|
|
Should Be Equal
|
|
|
|
... ${LINK_HEADER.header.objectType} REGULAR
|
|
|
|
|
|
|
|
Should Be Equal
|
|
|
|
... ${LINK_HEADER.header.split.splitID} ${SPLIT_ID}
|