Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/warnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def scenarios_list_running(self) -> list[dict]:
"pid": sc["pid"],
"cmd": sc["cmd"],
"active": sc["proc"].poll() is None,
"return_code": sc["proc"].returncode,
"network": sc["network"],
}
for sc in self.running_scenarios
Expand Down
3 changes: 3 additions & 0 deletions test/ln_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def run_ln_init_scenario(self):
self.warcli("rpc 0 getblockcount")
self.warcli("scenarios run ln_init")
self.wait_for_all_scenarios()
scenario_return_code = self.get_scenario_return_code("ln_init")
if scenario_return_code != 0:
raise Exception("LN Init scenario failed")

def test_channel_policies(self):
self.log.info("Ensuring node-level channel policy settings")
Expand Down
7 changes: 7 additions & 0 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,10 @@ def check_scenarios():
return all(not scn["active"] for scn in scns)

self.wait_for_predicate(check_scenarios)

def get_scenario_return_code(self, scenario_name):
scns = self.rpc("scenarios_list_running")
scns = [scn for scn in scns if scn["cmd"].strip() == scenario_name]
if len(scns) == 0:
raise Exception(f"Scenario {scenario_name} not found in running scenarios")
return scns[0]["return_code"]