mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-03 13:43:11 +00:00
test: customized node
This commit is contained in:
parent
5b2ee81883
commit
ce3babf65f
13
cluster_config/scripts/run_customized_node.sh
Executable file
13
cluster_config/scripts/run_customized_node.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export CFG_FILE_PATH="/etc/nomos/config.yaml" \
|
||||
CFG_SERVER_ADDR="http://cfgsync:4400" \
|
||||
CFG_HOST_IP=$(hostname -i) \
|
||||
CFG_HOST_IDENTIFIER="validator-$(hostname -i)" \
|
||||
LOG_LEVEL="INFO" \
|
||||
RISC0_DEV_MODE=true
|
||||
|
||||
/usr/bin/cfgsync-client && \
|
||||
exec /usr/bin/nomos-node /etc/nomos/config.yaml
|
||||
@ -21,6 +21,7 @@ NOMOS_IMAGE = get_env_var("NOMOS_IMAGE", DEFAULT_NOMOS_IMAGE)
|
||||
DEFAULT_PROXY_IMAGE = "bitnami/configurable-http-proxy:latest"
|
||||
HTTP_PROXY_IMAGE = get_env_var("HTTP_PROXY_IMAGE", DEFAULT_PROXY_IMAGE)
|
||||
|
||||
NOMOS_CUSTOM = "nomos_custom"
|
||||
NOMOS = "nomos"
|
||||
NOMOS_EXECUTOR = "nomos_executor"
|
||||
CFGSYNC = "cfgsync"
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
from src.env_vars import NOMOS_IMAGE
|
||||
|
||||
nomos_nodes = {
|
||||
"nomos_custom": {
|
||||
"image": NOMOS_IMAGE,
|
||||
"volumes": ["cluster_config:/etc/nomos", "./kzgrs/kzgrs_test_params:/kzgrs_test_params:z"],
|
||||
"ports": ["3000/udp", "18080/tcp"],
|
||||
"entrypoint": "/etc/nomos/scripts/run_customized_node.sh",
|
||||
},
|
||||
"nomos": {
|
||||
"image": NOMOS_IMAGE,
|
||||
"volumes": ["cluster_config:/etc/nomos", "./kzgrs/kzgrs_test_params:/kzgrs_test_params:z"],
|
||||
|
||||
@ -128,6 +128,9 @@ class NomosNode:
|
||||
def name(self):
|
||||
return self._container_name
|
||||
|
||||
def get_archive(self, path):
|
||||
return self._container.get_archive(path)
|
||||
|
||||
def api_port(self):
|
||||
return self._tcp_port
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import json
|
||||
import pytest
|
||||
|
||||
from src.client.nomos_cli import NomosCli
|
||||
from src.env_vars import CONSENSUS_SLOT_TIME, NOMOS
|
||||
from src.env_vars import CONSENSUS_SLOT_TIME, NOMOS, NOMOS_CUSTOM
|
||||
from src.libs.common import delay, to_app_id, to_index
|
||||
from src.libs.custom_logger import get_custom_logger
|
||||
from src.node.nomos_node import NomosNode
|
||||
@ -27,22 +27,24 @@ class TestDataConfidentiality(StepsDataAvailability):
|
||||
decoded_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json], decode_only=True)
|
||||
|
||||
assert DATA_TO_DISPERSE[1] == decoded_data, "Retrieved data are not same with original data"
|
||||
|
||||
# Copy the config file from first node
|
||||
cfg_file = open("./cluster_config/config.yaml", "wb")
|
||||
stream, _stat = self.node2.get_archive("/config.yaml")
|
||||
for chunk in stream:
|
||||
cfg_file.write(chunk)
|
||||
cfg_file.close()
|
||||
|
||||
self.node2.stop()
|
||||
# Start new node with the same IP address
|
||||
self.nodeX = NomosNode(NOMOS, "nomos_node_0")
|
||||
|
||||
# Start new node with the same hostname and configuration
|
||||
self.nodeX = NomosNode(NOMOS_CUSTOM, "nomos_node_0")
|
||||
self.nodeX.start()
|
||||
|
||||
try:
|
||||
ensure_nodes_ready(self.nodeX)
|
||||
self.nodeX.ensure_ready()
|
||||
except Exception as ex:
|
||||
logger.error(f"REST service did not become ready in time: {ex}")
|
||||
raise
|
||||
|
||||
delay(CONSENSUS_SLOT_TIME)
|
||||
|
||||
self.disperse_data(DATA_TO_DISPERSE[2], to_app_id(2), to_index(0))
|
||||
delay(CONSENSUS_SLOT_TIME)
|
||||
try:
|
||||
rcv_data = self.get_data_range(self.nodeX, to_app_id(2), to_index(0), to_index(5))
|
||||
except AssertionError as ae:
|
||||
assert "Get data range response is empty" in str(ae), "Get data range response should be empty"
|
||||
delay(600)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user