18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 16:14:58 +01:00
Files
maszyna/tests/scenarios/cases/en57_2000_automatic_coupler_crash.json
jerrrrycho 85119cc110 test(scenarios): automatic coupler cases (#86)
Re-lands #288, which was merged into feat/exe-test-mode after that
branch had already gone to master, so master never got it.

Two EN57-2000 units on td.scn, one standing, the other rolling into it
without a driver. At 50 km/h their automatic couplers mustn't catch: the
log has to show the collision and the derailment. At 4 km/h they couple
and nothing collides. Nothing reports a result, so both cases end on the
60 s test timeout.

run.py gets log_contains / log_lacks checks on the run's log.txt, and an
"ini" case key for extra eu07.ini lines (here crashdamage yes). The log
checks fail when log.txt is missing or empty: with no log text log_lacks
would pass without checking anything.
2026-11-11 11:35:43 +01:00

18 lines
659 B
JSON

{
"description": "Issue #86: an EN57-2000 unit without a driver runs at 50 km/h into a standing one on td.scn. Their automatic couplers mustn't catch at that speed: the units collide and derail; the run ends on the 60 s test timeout.",
"base_scenery": "td.scn",
"ini": ["crashdamage yes"],
"fragment": "td_automatic_coupler_hit.scn",
"vars": {
"velocity": "50",
"offset": "0"
},
"expect": "timeout",
"duration": 60,
"timeout": 300,
"checks": [
{ "type": "log_contains", "pattern": "Bad driving: autotest_\\S+ and autotest_\\S+ collided" },
{ "type": "log_contains", "pattern": "Bad driving: autotest_\\S+ derailed" }
]
}