Skip to content

Commit

Permalink
object: Add restart nodes lock object tests nspcc-dev#550
Browse files Browse the repository at this point in the history
The test_the_object_lock_should_be_kept_after_restarting_the_nodes
test added.
This test verifies the issue
nspcc-dev/neofs-node#1502

Signed-off-by: Oleg Kulachenko <oleg@nspcc.ru>
  • Loading branch information
vvarg229 committed Aug 30, 2023
1 parent 096e842 commit 914c3d0
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion pytest_tests/testsuites/object/test_object_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
OBJECT_NOT_FOUND,
)
from neofs_testlib.shell import Shell
from node_management import drop_object
from node_management import drop_object, restart_storage_nodes
from pytest import FixtureRequest
from python_keywords.container import create_container
from python_keywords.neofs_verbs import delete_object, head_object, lock_object
Expand Down Expand Up @@ -663,3 +663,29 @@ def test_link_object_of_complex_object_should_also_be_protected_from_deletion(
self.shell,
self.cluster.default_rpc_endpoint,
)

@allure.title("Locked object should be protected from deletion after the storage nodes are restarted")
@pytest.mark.parametrize(
# Only complex objects are required for this test
"locked_storage_object",
[pytest.lazy_fixture("complex_object_size")],
indirect=True,
)
def test_the_object_lock_should_be_kept_after_restarting_the_nodes(
self,
locked_storage_object: StorageObjectInfo,
):
"""
Lock objects should fill metabase on resync_metabase
"""
restart_storage_nodes(self.cluster.storage_nodes)

with allure.step(f"Try to delete object {locked_storage_object.oid}"):
with pytest.raises(Exception, match=OBJECT_IS_LOCKED):
delete_object(
locked_storage_object.wallet_file_path,
locked_storage_object.cid,
locked_storage_object.oid,
self.shell,
self.cluster.default_rpc_endpoint,
)

0 comments on commit 914c3d0

Please sign in to comment.