[#199] Update shards tests

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2024-02-19 16:18:28 +03:00 committed by Andrey Berezin
parent 8164d35fc8
commit 9068b96d69
2 changed files with 5 additions and 19 deletions

View file

@ -11,7 +11,7 @@ hosts:
- name: frostfs-storage_01 - name: frostfs-storage_01
attributes: attributes:
container_name: s01 container_name: s01
config_path: ../frostfs-dev-env/services/storage/.storage.env config_path: /etc/frostfs/storage/config.yml
wallet_path: ../frostfs-dev-env/services/storage/wallet01.json wallet_path: ../frostfs-dev-env/services/storage/wallet01.json
local_wallet_config_path: ./TemporaryDir/empty-password.yml local_wallet_config_path: ./TemporaryDir/empty-password.yml
local_wallet_path: ../frostfs-dev-env/services/storage/wallet01.json local_wallet_path: ../frostfs-dev-env/services/storage/wallet01.json
@ -25,7 +25,7 @@ hosts:
- name: frostfs-storage_02 - name: frostfs-storage_02
attributes: attributes:
container_name: s02 container_name: s02
config_path: ../frostfs-dev-env/services/storage/.storage.env config_path: /etc/frostfs/storage/config.yml
wallet_path: ../frostfs-dev-env/services/storage/wallet02.json wallet_path: ../frostfs-dev-env/services/storage/wallet02.json
local_wallet_config_path: ./TemporaryDir/empty-password.yml local_wallet_config_path: ./TemporaryDir/empty-password.yml
local_wallet_path: ../frostfs-dev-env/services/storage/wallet02.json local_wallet_path: ../frostfs-dev-env/services/storage/wallet02.json
@ -39,7 +39,7 @@ hosts:
- name: frostfs-storage_03 - name: frostfs-storage_03
attributes: attributes:
container_name: s03 container_name: s03
config_path: ../frostfs-dev-env/services/storage/.storage.env config_path: /etc/frostfs/storage/config.yml
wallet_path: ../frostfs-dev-env/services/storage/wallet03.json wallet_path: ../frostfs-dev-env/services/storage/wallet03.json
local_wallet_config_path: ./TemporaryDir/empty-password.yml local_wallet_config_path: ./TemporaryDir/empty-password.yml
local_wallet_path: ../frostfs-dev-env/services/storage/wallet03.json local_wallet_path: ../frostfs-dev-env/services/storage/wallet03.json
@ -53,7 +53,7 @@ hosts:
- name: frostfs-storage_04 - name: frostfs-storage_04
attributes: attributes:
container_name: s04 container_name: s04
config_path: ../frostfs-dev-env/services/storage/.storage.env config_path: /etc/frostfs/storage/config.yml
wallet_path: ../frostfs-dev-env/services/storage/wallet04.json wallet_path: ../frostfs-dev-env/services/storage/wallet04.json
local_wallet_config_path: ./TemporaryDir/empty-password.yml local_wallet_config_path: ./TemporaryDir/empty-password.yml
local_wallet_path: ../frostfs-dev-env/services/storage/wallet04.json local_wallet_path: ../frostfs-dev-env/services/storage/wallet04.json

View file

@ -75,20 +75,6 @@ class TestControlShard(ClusterTestBase):
) )
delete_container(wallet=default_wallet, cid=cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint) delete_container(wallet=default_wallet, cid=cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint)
@staticmethod
def get_shards_from_config(node: StorageNode) -> list[Shard]:
config_file = node.get_shard_config_path()
file_type = pathlib.Path(config_file).suffix
parser_method = {
".env": node.get_shards_from_env,
".yaml": node.get_shards,
".yml": node.get_shards,
}
shards = parser_method[file_type]()
return shards
@staticmethod @staticmethod
def get_shards_from_cli(node: StorageNode) -> list[Shard]: def get_shards_from_cli(node: StorageNode) -> list[Shard]:
wallet_path = node.get_remote_wallet_path() wallet_path = node.get_remote_wallet_path()
@ -120,7 +106,7 @@ class TestControlShard(ClusterTestBase):
@allure.title("All shards are available") @allure.title("All shards are available")
def test_control_shard(self, cluster: Cluster): def test_control_shard(self, cluster: Cluster):
for storage_node in cluster.storage_nodes: for storage_node in cluster.storage_nodes:
shards_from_config = self.get_shards_from_config(storage_node) shards_from_config = storage_node.get_shards()
shards_from_cli = self.get_shards_from_cli(storage_node) shards_from_cli = self.get_shards_from_cli(storage_node)
assert set(shards_from_config) == set(shards_from_cli) assert set(shards_from_config) == set(shards_from_cli)