1
1
#!/usr/bin/env python3
2
2
3
3
import os
4
+ import re
4
5
from pathlib import Path
5
6
6
7
from test_base import TestBase
@@ -21,6 +22,7 @@ def run_test(self):
21
22
self .setup_network ()
22
23
self .run_and_check_miner_scenario_from_file ()
23
24
self .run_and_check_scenario_from_file ()
25
+ self .run_and_check_scenario_from_file_debug ()
24
26
self .check_regtest_recon ()
25
27
self .check_active_count ()
26
28
finally :
@@ -82,6 +84,12 @@ def run_and_check_miner_scenario_from_file(self):
82
84
assert "Active Scenarios: 1" in table
83
85
self .stop_scenario ()
84
86
87
+ def run_and_check_scenario_from_file_debug (self ):
88
+ scenario_file = self .scen_dir / "test_scenarios" / "p2p_interface.py"
89
+ self .log .info (f"Running scenario from: { scenario_file } " )
90
+ output = self .warnet (f"run { scenario_file } --source_dir={ self .scen_dir } --debug" )
91
+ self .check_for_pod_deletion_message (output )
92
+
85
93
def run_and_check_scenario_from_file (self ):
86
94
scenario_file = self .scen_dir / "test_scenarios" / "p2p_interface.py"
87
95
self .log .info (f"Running scenario from: { scenario_file } " )
@@ -109,6 +117,12 @@ def two_pass_one_fail():
109
117
table = self .warnet ("status" )
110
118
assert "Active Scenarios: 0" in table
111
119
120
+ def check_for_pod_deletion_message (self , input ):
121
+ message = "Deleting pod..."
122
+ self .log .info (f"Checking for message: '{ message } '" )
123
+ assert re .search (re .escape (message ), input , flags = re .MULTILINE )
124
+ self .log .info (f"Found message: '{ message } '" )
125
+
112
126
113
127
if __name__ == "__main__" :
114
128
test = ScenariosTest ()
0 commit comments