Skip to content

Commit c3f8154

Browse files
committed
scenarios test: add test for run ... --debug
1 parent d2be471 commit c3f8154

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/scenarios_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import os
4+
import re
45
from pathlib import Path
56

67
from test_base import TestBase
@@ -21,6 +22,7 @@ def run_test(self):
2122
self.setup_network()
2223
self.run_and_check_miner_scenario_from_file()
2324
self.run_and_check_scenario_from_file()
25+
self.run_and_check_scenario_from_file_debug()
2426
self.check_regtest_recon()
2527
self.check_active_count()
2628
finally:
@@ -82,6 +84,12 @@ def run_and_check_miner_scenario_from_file(self):
8284
assert "Active Scenarios: 1" in table
8385
self.stop_scenario()
8486

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+
8593
def run_and_check_scenario_from_file(self):
8694
scenario_file = self.scen_dir / "test_scenarios" / "p2p_interface.py"
8795
self.log.info(f"Running scenario from: {scenario_file}")
@@ -109,6 +117,12 @@ def two_pass_one_fail():
109117
table = self.warnet("status")
110118
assert "Active Scenarios: 0" in table
111119

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+
112126

113127
if __name__ == "__main__":
114128
test = ScenariosTest()

0 commit comments

Comments
 (0)