2022-07-05 21:35:32 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
2022-09-20 15:03:52 +00:00
|
|
|
import allure
|
2022-07-07 21:31:58 +00:00
|
|
|
import neofs_verbs
|
2022-07-05 21:35:32 +00:00
|
|
|
from neo3 import wallet
|
|
|
|
|
2022-09-20 15:03:52 +00:00
|
|
|
@allure.step("Verify Head Tombstone")
|
2022-08-25 10:57:55 +00:00
|
|
|
def verify_head_tombstone(wallet_path: str, cid: str, oid_ts: str, oid: str):
|
|
|
|
header = neofs_verbs.head_object(wallet_path, cid, oid_ts)
|
2022-09-20 15:03:52 +00:00
|
|
|
header = header["header"]
|
|
|
|
assert header["containerID"] == cid, "Tombstone Header CID is wrong"
|
2022-07-05 21:35:32 +00:00
|
|
|
|
|
|
|
wlt_data = dict()
|
2022-09-20 15:03:52 +00:00
|
|
|
with open(wallet_path, "r") as fout:
|
2022-07-05 21:35:32 +00:00
|
|
|
wlt_data = json.loads(fout.read())
|
2022-09-20 15:03:52 +00:00
|
|
|
wlt = wallet.Wallet.from_json(wlt_data, password="")
|
2022-07-05 21:35:32 +00:00
|
|
|
addr = wlt.accounts[0].address
|
|
|
|
|
2022-09-20 15:03:52 +00:00
|
|
|
assert header["ownerID"] == addr, "Tombstone Owner ID is wrong"
|
|
|
|
assert header["objectType"] == "TOMBSTONE", "Header Type isn't Tombstone"
|
|
|
|
assert (
|
|
|
|
header["sessionToken"]["body"]["object"]["verb"] == "DELETE"
|
|
|
|
), "Header Session Type isn't DELETE"
|
|
|
|
assert (
|
2022-10-11 12:02:53 +00:00
|
|
|
header["sessionToken"]["body"]["object"]["target"]["container"] == cid
|
2022-09-20 15:03:52 +00:00
|
|
|
), "Header Session ID is wrong"
|
|
|
|
assert (
|
2022-10-11 12:02:53 +00:00
|
|
|
header["sessionToken"]["body"]["object"]["target"]["objects"][0] == oid
|
2022-09-20 15:03:52 +00:00
|
|
|
), "Header Session OID is wrong"
|