Enable tests for fixed functionality

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2022-11-22 17:56:58 +03:00 committed by abereziny
parent 69efc2fcce
commit 08274d4620
3 changed files with 22 additions and 16 deletions

View file

@ -207,10 +207,7 @@ def test_static_session_read(
@pytest.mark.static_session
@pytest.mark.parametrize(
"method_under_test,verb",
[
(get_range, RANGE_VERB),
# (get_range_hash, RANGEHASH_VERB), session is absent in neofs-cli object hash command (see https://github.com/nspcc-dev/neofs-node/issues/2029)
],
[(get_range, RANGE_VERB), (get_range_hash, RANGEHASH_VERB)],
)
def test_static_session_range(
user_wallet: WalletFile,
@ -487,10 +484,10 @@ def test_static_session_expiration_at_next(
request: FixtureRequest,
):
"""
Validate static session expires which at next epoch
Validate static session which expires at next epoch
"""
allure.dynamic.title(
f"Validate static session expires which at next epoch for {request.node.callspec.id}"
f"Validate static session which expires at next epoch for {request.node.callspec.id}"
)
epoch = ensure_fresh_epoch(client_shell)
@ -540,7 +537,7 @@ def test_static_session_start_at_next(
container = owner_wallet.containers[0]
object_id = storage_objects[0].oid
expiration = Lifetime(epoch + 10, epoch + 1, epoch)
expiration = Lifetime(epoch + 2, epoch + 1, epoch)
token_start_at_next_epoch = get_object_signed_token(
owner_wallet,
@ -562,6 +559,12 @@ def test_static_session_start_at_next(
user_wallet.path, container, object_id, client_shell, session=token_start_at_next_epoch
)
tick_epoch(client_shell)
with pytest.raises(Exception, match=MALFORMED_REQUEST):
head_object(
user_wallet.path, container, object_id, client_shell, session=token_start_at_next_epoch
)
@allure.title("Validate static session which is already expired")
@pytest.mark.static_session

View file

@ -35,7 +35,7 @@ neo-mamba==0.10.0
neo3crypto==0.2.1
neo3vm==0.9.0
neo3vm-stubs==0.9.0
neofs-testlib==0.5.0
neofs-testlib==0.6.0
netaddr==0.8.0
orjson==3.6.8
packaging==21.3

View file

@ -82,21 +82,23 @@ def get_range_hash(
endpoint: Optional[str] = None,
wallet_config: Optional[str] = None,
xhdr: Optional[dict] = None,
session: Optional[str] = None,
):
"""
GETRANGEHASH of given Object.
Args:
wallet (str): wallet on whose behalf GETRANGEHASH is done
cid (str): ID of Container where we get the Object from
oid (str): Object ID
wallet: wallet on whose behalf GETRANGEHASH is done
cid: ID of Container where we get the Object from
oid: Object ID
shell: executor for cli command
bearer (optional, str): path to Bearer Token file, appends to `--bearer` key
range_cut (str): Range to take hash from in the form offset1:length1,...,
bearer: path to Bearer Token file, appends to `--bearer` key
range_cut: Range to take hash from in the form offset1:length1,...,
value to pass to the `--range` parameter
endpoint (optional, str): NeoFS endpoint to send request to, appends to `--rpc-endpoint` key
wallet_config(optional, str): path to the wallet config
xhdr (optional, dict): Request X-Headers in form of Key=Value
endpoint: NeoFS endpoint to send request to, appends to `--rpc-endpoint` key
wallet_config: path to the wallet config
xhdr: Request X-Headers in form of Key=Values
session: Filepath to a JSON- or binary-encoded token of the object RANGEHASH session.
Returns:
None
"""
@ -110,6 +112,7 @@ def get_range_hash(
range=range_cut,
bearer=bearer,
xhdr=xhdr,
session=session,
)
# cutting off output about range offset and length