Add static session token container tests

Signed-off-by: Vladimir Avdeev <v.avdeev@yadro.com>
This commit is contained in:
Vladimir Avdeev 2022-11-30 11:26:38 +03:00 committed by Vladimir Avdeev
parent 455cafa08a
commit 9b0ac8579b
8 changed files with 444 additions and 200 deletions

View file

@ -130,7 +130,13 @@ def get_eacl(wallet_path: str, cid: str, shell: Shell) -> Optional[str]:
@allure.title("Set extended ACL")
def set_eacl(wallet_path: str, cid: str, eacl_table_path: str, shell: Shell) -> None:
def set_eacl(
wallet_path: str,
cid: str,
eacl_table_path: str,
shell: Shell,
session_token: Optional[str] = None,
) -> None:
cli = NeofsCli(shell, NEOFS_CLI_EXEC, WALLET_CONFIG)
cli.container.set_eacl(
wallet=wallet_path,
@ -138,6 +144,7 @@ def set_eacl(wallet_path: str, cid: str, eacl_table_path: str, shell: Shell) ->
cid=cid,
table=eacl_table_path,
await_mode=True,
session=session_token,
)

View file

@ -165,7 +165,9 @@ def get_container(
@allure.step("Delete Container")
# TODO: make the error message about a non-found container more user-friendly
# https://github.com/nspcc-dev/neofs-contract/issues/121
def delete_container(wallet: str, cid: str, shell: Shell, force: bool = False) -> None:
def delete_container(
wallet: str, cid: str, shell: Shell, force: bool = False, session_token: Optional[str] = None
) -> None:
"""
A wrapper for `neofs-cli container delete` call.
Args:
@ -173,11 +175,14 @@ def delete_container(wallet: str, cid: str, shell: Shell, force: bool = False) -
cid (str): ID of the container to delete
shell: executor for cli command
force (bool): do not check whether container contains locks and remove immediately
session_token: a path to session token file
This function doesn't return anything.
"""
cli = NeofsCli(shell, NEOFS_CLI_EXEC, WALLET_CONFIG)
cli.container.delete(wallet=wallet, cid=cid, rpc_endpoint=NEOFS_ENDPOINT, force=force)
cli.container.delete(
wallet=wallet, cid=cid, rpc_endpoint=NEOFS_ENDPOINT, force=force, session=session_token
)
def _parse_cid(output: str) -> str:

View file

@ -4,7 +4,7 @@ import os
import random
import re
import uuid
from typing import Optional
from typing import Any, Optional
import allure
import json_transformers
@ -406,7 +406,7 @@ def get_netmap_netinfo(
address: Optional[str] = None,
ttl: Optional[int] = None,
xhdr: Optional[dict] = None,
) -> dict[str, object]:
) -> dict[str, Any]:
"""
Get netmap netinfo output from node