2828import allure
2929import jinja2
3030import psutil
31+ import pytest
3132import requests
3233import yaml
3334from helpers .common import (
4344 get_assets_dir_path ,
4445)
4546from helpers .neofs_verbs import get_netmap_netinfo
47+ from helpers .utility import parse_version
4648from tenacity import retry , stop_after_attempt , wait_fixed
4749
4850from neofs_testlib .cli import NeofsAdm , NeofsCli , NeofsLens , NeoGo
@@ -171,13 +173,16 @@ def generate_neo_go_config(self, wallet: NodeWallet):
171173 return neo_go_config_path
172174
173175 @allure .step ("Deploy inner ring nodes" )
174- def deploy_inner_ring_nodes (self , count = 1 , with_main_chain = False , chain_meta_data = False , sn_validator_url = None ):
176+ def deploy_inner_ring_nodes (
177+ self , count = 1 , with_main_chain = False , chain_meta_data = False , sn_validator_url = None , allow_ec = False
178+ ):
175179 for _ in range (count ):
176180 new_inner_ring_node = InnerRing (
177181 self ,
178182 len (self .inner_ring_nodes ) + 1 ,
179183 chain_meta_data = chain_meta_data ,
180184 sn_validator_url = sn_validator_url ,
185+ allow_ec = allow_ec ,
181186 )
182187 new_inner_ring_node .generate_network_config ()
183188 self .inner_ring_nodes .append (new_inner_ring_node )
@@ -664,6 +669,7 @@ def deploy(
664669 request = None ,
665670 chain_meta_data = False ,
666671 sn_validator_url = None ,
672+ allow_ec = False ,
667673 fschain_endpoints : Optional [list [str ]] = None ,
668674 shards_count = 2 ,
669675 gc_remover_batch_size = 200 ,
@@ -675,11 +681,17 @@ def deploy(
675681 neofs_env = NeoFSEnv (neofs_env_config = neofs_env_config )
676682 neofs_env .download_binaries ()
677683 try :
684+ if allow_ec and parse_version (neofs_env .get_binary_version (neofs_env .neofs_node_path )) <= parse_version (
685+ "0.49.1"
686+ ):
687+ pytest .skip ("EC is not supported in versions <= 0.49.1" )
688+
678689 neofs_env .deploy_inner_ring_nodes (
679690 count = inner_ring_nodes_count ,
680691 with_main_chain = with_main_chain ,
681692 chain_meta_data = chain_meta_data ,
682693 sn_validator_url = sn_validator_url ,
694+ allow_ec = allow_ec ,
683695 )
684696
685697 if storage_nodes_count :
@@ -1052,11 +1064,7 @@ def _wait_until_ready(self):
10521064
10531065class InnerRing (ResurrectableProcess ):
10541066 def __init__ (
1055- self ,
1056- neofs_env : NeoFSEnv ,
1057- ir_number : int ,
1058- chain_meta_data = False ,
1059- sn_validator_url = None ,
1067+ self , neofs_env : NeoFSEnv , ir_number : int , chain_meta_data = False , sn_validator_url = None , allow_ec = False
10601068 ):
10611069 self .neofs_env = neofs_env
10621070 self .ir_number = ir_number
@@ -1083,6 +1091,7 @@ def __init__(
10831091 self .ir_state_file = self .neofs_env ._generate_temp_file (self .inner_ring_dir , prefix = "ir_state_file" )
10841092 self .chain_meta_data = chain_meta_data
10851093 self .sn_validator_url = sn_validator_url
1094+ self .allow_ec = allow_ec
10861095 self .stdout = "Not initialized"
10871096 self .stderr = "Not initialized"
10881097 self .process = None
@@ -1178,6 +1187,7 @@ def start(
11781187 prometheus_address = self .prometheus_address ,
11791188 chain_meta_data = self .chain_meta_data ,
11801189 sn_validator_url = self .sn_validator_url ,
1190+ allow_ec = self .allow_ec ,
11811191 )
11821192 logger .info (f"Launching Inner Ring Node:{ self } " )
11831193 self ._launch_process ()
@@ -1449,6 +1459,7 @@ def _wait_until_not_ready(self):
14491459 result = neofs_cli .control .healthcheck (endpoint = self .control_endpoint )
14501460 except Exception as e :
14511461 with allure .step (f"Exception caught: { e } , node is not ready" ):
1462+ time .sleep (2 )
14521463 return
14531464 assert "Health status: READY" not in result .stdout , "Health is ready"
14541465 assert "Network status: ONLINE" not in result .stdout , "Network is online"
0 commit comments