test: disperse to nodes member of many subnets

This commit is contained in:
Roman 2025-02-20 16:52:53 +11:00
parent c56f25b697
commit e83e0b0b23
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
6 changed files with 54 additions and 3 deletions

View File

@ -0,0 +1,31 @@
port: 4400
n_hosts: 2
timeout: 30
# ConsensusConfig related parameters
security_param: 10
active_slot_coeff: 0.9
# DaConfig related parameters
subnetwork_size: 1024
dispersal_factor: 2
num_samples: 1
num_subnets: 2
old_blobs_check_interval_secs: 5
blobs_validity_duration_secs: 60
global_params_path: "/kzgrs_test_params"
# Tracing
tracing_settings:
logger: Stdout
tracing: !Otlp
endpoint: http://tempo:4317/
sample_ratio: 0.5
service_name: node
filter: !EnvFilter
filters:
nomos: debug
metrics: !Otlp
endpoint: http://prometheus:9090/api/v1/otlp/v1/metrics
host_identifier: node
level: INFO

View File

@ -11,10 +11,10 @@ from src.node.nomos_node import NomosNode
logger = get_custom_logger(__name__)
def prepare_cluster_config(node_count):
def prepare_cluster_config(node_count, subnetwork_size=2):
cwd = os.getcwd()
config_dir = "cluster_config"
src = f"{cwd}/{config_dir}/cfgsync-{node_count}node.yaml"
src = f"{cwd}/{config_dir}/cfgsync-{node_count}node{subnetwork_size}.yaml"
dst = f"{cwd}/{config_dir}/cfgsync.yaml"
shutil.copyfile(src, dst)
@ -38,7 +38,13 @@ class StepsCommon:
@pytest.fixture(scope="function")
def setup_2_node_cluster(self, request):
logger.debug(f"Running fixture setup: {inspect.currentframe().f_code.co_name}")
prepare_cluster_config(2)
if hasattr(request, "param"):
subnet_size = request.param
else:
subnet_size = 2
prepare_cluster_config(2, subnet_size)
self.node1 = NomosNode(CFGSYNC, "cfgsync")
self.node2 = NomosNode(NOMOS, "nomos_node_0")
self.node3 = NomosNode(NOMOS_EXECUTOR, "nomos_node_1")

View File

View File

@ -0,0 +1,14 @@
import pytest
from src.libs.common import delay, to_app_id, to_index
from src.steps.da import StepsDataAvailability
from src.test_data import DATA_TO_DISPERSE
class TestNetworkingPrivacy(StepsDataAvailability):
main_nodes = []
@pytest.mark.parametrize("setup_2_node_cluster", [1024], indirect=True)
def test_consumed_bandwidth_dispersal(self, setup_2_node_cluster):
delay(5)
self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0))