Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions pytest_tests/tests/container/test_container_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def test_container_lock_update(self, default_wallet):
)
assert container_info["attributes"]["__NEOFS__LOCK_UNTIL"] == str(first_lock_time)

with allure.step("Wait 1 sec for the unix epoch tick"):
time.sleep(1)

with allure.step("Update lock to extend expiration time"):
extended_lock_time = int(time.time()) + BASIC_LOCK_TIME
set_container_attributes(
Expand Down Expand Up @@ -246,12 +249,13 @@ def test_lock_from_past(self, default_wallet):
)

with allure.step("Try to set __NEOFS__LOCK_UNTIL to past epoch value"):
set_container_attributes(
default_wallet,
cid,
self.neofs_env,
attributes={"__NEOFS__LOCK_UNTIL": int(time.time()) - 10},
)
with pytest.raises(Exception, match=r".*lock expiration time .* is not later than current .*"):
set_container_attributes(
default_wallet,
cid,
self.neofs_env,
attributes={"__NEOFS__LOCK_UNTIL": int(time.time()) - 10},
)

with allure.step("Verify container can still be deleted"):
delete_container(default_wallet.path, cid, shell=self.shell, endpoint=self.neofs_env.sn_rpc)
Expand Down
Loading