forked from TrueCloudLab/frostfs-testcases
[#244] Fix test policies
This commit is contained in:
parent
ae3ace6ee1
commit
236be159db
2 changed files with 11 additions and 1 deletions
9
pytest_tests/testsuites/object/conftest.py
Normal file
9
pytest_tests/testsuites/object/conftest.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import pytest
|
||||||
|
from frostfs_testlib.storage.dataclasses.policy import PlacementPolicy
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def expected_object_copies(placement_policy: PlacementPolicy) -> int:
|
||||||
|
if placement_policy.name == "rep":
|
||||||
|
return 2
|
||||||
|
return 4
|
|
@ -147,6 +147,7 @@ class TestObjectApi(ClusterTestBase):
|
||||||
self,
|
self,
|
||||||
storage_objects: list[StorageObjectInfo],
|
storage_objects: list[StorageObjectInfo],
|
||||||
simple_object_size: ObjectSize,
|
simple_object_size: ObjectSize,
|
||||||
|
expected_object_copies: int,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Validate object storage policy
|
Validate object storage policy
|
||||||
|
@ -170,7 +171,7 @@ class TestObjectApi(ClusterTestBase):
|
||||||
shell=self.shell,
|
shell=self.shell,
|
||||||
nodes=self.cluster.storage_nodes,
|
nodes=self.cluster.storage_nodes,
|
||||||
)
|
)
|
||||||
assert copies == 2, "Expected 2 copies"
|
assert copies == expected_object_copies, f"Expected {expected_object_copies} copies"
|
||||||
|
|
||||||
@allure.title("Get object by native API (obj_size={object_size}, policy={placement_policy})")
|
@allure.title("Get object by native API (obj_size={object_size}, policy={placement_policy})")
|
||||||
def test_get_object_api(self, storage_objects: list[StorageObjectInfo]):
|
def test_get_object_api(self, storage_objects: list[StorageObjectInfo]):
|
||||||
|
|
Loading…
Reference in a new issue