mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-02 13:13:08 +00:00
test: reconstruct command
This commit is contained in:
parent
a5a04b2671
commit
3ee98528c2
@ -1,5 +1,5 @@
|
||||
port: 4400
|
||||
n_hosts: 5
|
||||
n_hosts: 2
|
||||
timeout: 30
|
||||
|
||||
# ConsensusConfig related parameters
|
||||
|
||||
@ -19,7 +19,7 @@ NOMOS = "nomos"
|
||||
NOMOS_EXECUTOR = "nomos_executor"
|
||||
CFGSYNC = "cfgsync"
|
||||
|
||||
DEFAULT_IMAGE = "ghcr.io/logos-co/nomos-node:testnet"
|
||||
DEFAULT_IMAGE = "nomos:latest"
|
||||
|
||||
NODE_1 = get_env_var("NODE_1", NOMOS)
|
||||
NODE_2 = get_env_var("NODE_2", NOMOS_EXECUTOR)
|
||||
@ -27,7 +27,7 @@ NODE_3 = get_env_var("NODE_3", CFGSYNC)
|
||||
|
||||
NOMOS_IMAGE = get_env_var("NOMOS_IMAGE", DEFAULT_IMAGE)
|
||||
|
||||
NOMOS_CLI = ["docker", "run", "--rm", "--entrypoint", "", NOMOS_IMAGE]
|
||||
NOMOS_CLI = 'docker run --rm --entrypoint "" ' + NOMOS_IMAGE + " /usr/bin/nomos-cli"
|
||||
|
||||
ADDITIONAL_NODES = get_env_var("ADDITIONAL_NODES", f"{NOMOS},{NOMOS}")
|
||||
# more nodes need to follow the NODE_X pattern
|
||||
|
||||
@ -1,8 +1,16 @@
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
from src.env_vars import NOMOS_CLI
|
||||
from src.libs.common import delay
|
||||
from src.libs.custom_logger import get_custom_logger
|
||||
from src.steps.da import StepsDataAvailability
|
||||
from src.test_data import DATA_TO_DISPERSE
|
||||
|
||||
logger = get_custom_logger(__name__)
|
||||
|
||||
|
||||
class TestDataIntegrity(StepsDataAvailability):
|
||||
main_nodes = []
|
||||
@ -24,5 +32,20 @@ class TestDataIntegrity(StepsDataAvailability):
|
||||
@pytest.mark.usefixtures("setup_2_node_cluster")
|
||||
def test_da_sampling_determines_data_presence(self):
|
||||
self.disperse_data(DATA_TO_DISPERSE[0], [0] * 31 + [1], [0] * 8)
|
||||
delay(10)
|
||||
received_data = self.get_data_range(self.node2, [0] * 31 + [1], [0] * 8, [0] * 7 + [5])
|
||||
assert DATA_TO_DISPERSE[0] == bytes(received_data[0][1]).decode("utf-8")
|
||||
rcv_data_json = json.dumps(received_data)
|
||||
cmd = str(NOMOS_CLI + " reconstruct --app-blobs " + "'" + str(rcv_data_json) + "'")
|
||||
|
||||
logger.debug(f"Command to run {cmd}")
|
||||
|
||||
cmd_type = type(cmd)
|
||||
logger.debug(f"Command type {cmd_type}")
|
||||
|
||||
try:
|
||||
completed_cmd = subprocess.run(cmd, shell=True, capture_output=True, text=True, check=True)
|
||||
logger.debug(f"Command finished with output {completed_cmd.stdout}")
|
||||
except subprocess.CalledProcessError as e:
|
||||
logger.error(f"Error occurred while running nomos-cli {e.stderr}")
|
||||
|
||||
# assert DATA_TO_DISPERSE[0] == bytes(received_data[0][1]).decode("utf-8")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user