Update to Kurtosis 66.2

This commit is contained in:
Gusto Bacvinka 2023-02-12 23:36:16 +02:00 committed by Alberto Soutullo Rendo
parent cb81c8676b
commit 2a3b5e552d
2 changed files with 32 additions and 16 deletions

View File

@ -101,7 +101,7 @@ def prepare_nomos_service(plan, node_name, all_services, use_general_configurati
]
)
all_services[node_name]
all_services[node_name] = nomos_service_config
def instantiate_services(plan, network_topology, use_general_configuration):
@ -161,15 +161,18 @@ def _add_waku_service_information(plan, all_services_information):
return new_services_information
def _add_nomos_service_information(plan, services_information, new_service_id, service_information):
new_service_information = {}
def _add_nomos_service_information(plan, all_services_information):
nomos_peer_id = nomos.get_nomos_peer_id(plan, new_service_id, system_variables.NOMOS_HTTP_PORT_ID)
new_services_information = {}
new_service_information["peer_id"] = nomos_peer_id
new_service_information["service_info"] = service_information
for service_name in all_services_information:
node_peer_id = nomos.get_nomos_peer_id(plan, service_name, system_variables.NOMOS_HTTP_PORT_ID)
services_information[new_service_id] = new_service_information
new_services_information[service_name] = {}
new_services_information[service_name]["peer_id"] = node_peer_id
new_services_information[service_name]["service_info"] = all_services_information[service_name]
return new_services_information
service_dispatcher = {

View File

@ -5,12 +5,27 @@ system_variables = import_module("github.com/logos-co/wakurtosis/src/system_vari
files = import_module(system_variables.FILE_HELPERS_MODULE)
def send_req(plan, service_id, port_id, endpoint, method, body, extract={}):
recipe = struct(
service_id=service_id,
def get_req(plan, service_name, port_id, endpoint, extract={}):
recipe = GetHttpRequestRecipe(
service_name=service_name,
port_id=port_id,
endpoint=endpoint,
extract=extract
)
response = plan.wait(recipe=recipe,
field="code",
assertion="==",
target_value=200)
return response
def post_req(plan, service_name, port_id, endpoint, body, extract={}):
recipe = PostHttpRequestRecipe(
service_name=service_name,
port_id=port_id,
endpoint=endpoint,
method=method,
content_type="application/json",
body=body,
extract=extract
@ -24,11 +39,10 @@ def send_req(plan, service_id, port_id, endpoint, method, body, extract={}):
return response
def get_nomos_peer_id(plan, service_id, port_id):
def get_nomos_peer_id(plan, service_name, port_id):
extract = {"peer_id": '.peer_id'}
response = send_req(plan, service_id, port_id, system_variables.NOMOS_NET_INFO_URL,
"GET", "", extract)
response = get_req(plan, service_name, port_id, system_variables.NOMOS_NET_INFO_URL, extract)
plan.assert(value=response["code"], assertion="==", target_value = 200)
@ -52,8 +66,7 @@ def _merge_peer_ids(peer_ids):
def connect_nomos_to_peers(plan, service_id, port_id, peer_ids):
body = _merge_peer_ids(peer_ids)
response = send_req(plan, service_id, port_id, system_variables.NOMOS_NET_CONN_URL,
"POST", body)
response = post_req(plan, service_id, port_id, system_variables.NOMOS_NET_CONN_URL, body)
plan.assert(value=response["code"], assertion="==", target_value = 200)