File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from warnet .k8s import delete_pod
9
9
from warnet .process import run_command
10
- from warnet .scenarios import _active as scenarios_active
10
+ from warnet .status import _get_active_scenarios as scenarios_active
11
11
12
12
13
13
class ScenariosTest (TestBase ):
@@ -36,7 +36,7 @@ def scenario_running(self, scenario_name: str):
36
36
"""Check that we are only running a single scenario of the correct name"""
37
37
active = scenarios_active ()
38
38
assert len (active ) == 1
39
- return scenario_name in active [0 ]["commander " ]
39
+ return scenario_name in active [0 ]["name " ]
40
40
41
41
def run_and_check_scenario_from_file (self ):
42
42
scenario_file = "test/data/scenario_p2p_interface.py"
@@ -80,7 +80,7 @@ def stop_scenario(self):
80
80
running = scenarios_active ()
81
81
assert len (running ) == 1 , f"Expected one running scenario, got { len (running )} "
82
82
assert running [0 ]["status" ] == "running" , "Scenario should be running"
83
- delete_pod (running [0 ]["commander " ])
83
+ delete_pod (running [0 ]["name " ])
84
84
self .wait_for_predicate (self .check_scenario_stopped )
85
85
86
86
def check_scenario_stopped (self ):
Original file line number Diff line number Diff line change 14
14
from warnet .control import get_active_scenarios
15
15
from warnet .k8s import get_pod_exit_status
16
16
from warnet .network import _connected as network_connected
17
- from warnet .network import _status as network_status
17
+ from warnet .status import _get_tank_status as network_status
18
18
19
19
20
20
class TestBase :
@@ -112,11 +112,9 @@ def check_status():
112
112
if len (tanks ) == 0 :
113
113
return True
114
114
for tank in tanks :
115
- for service in ["bitcoin" , "lightning" , "circuitbreaker" ]:
116
- status = tank .get (f"{ service } _status" )
117
- if status :
118
- stats ["total" ] += 1
119
- stats [status ] = stats .get (status , 0 ) + 1
115
+ status = tank ["status" ]
116
+ stats ["total" ] += 1
117
+ stats [status ] = stats .get (status , 0 ) + 1
120
118
self .log .info (f"Waiting for all tanks to reach '{ target } ': { stats } " )
121
119
return target in stats and stats [target ] == stats ["total" ]
122
120
You can’t perform that action at this time.
0 commit comments