v3.22.2: the runner's TERMINAL RESPONSE inherits the terminal's own objects
Two reported gaps: - a scripted PROVIDE LOCAL INFORMATION expectation answered with an empty TR - the PLI dictionary (and the host clock for the date/time qualifier) was silently inert during runs while the poll path used it all along, so an applet waiting for its data stalled behind a passing expectation. A POLL INTERVAL expectation likewise never echoed the Duration (6.8.4). testscript.build_tr() gained `answer_tlvs` (inserted after the Result per the 6.8.0 order, before text/item/raw) and the shared _test_terminal_response() wires the expect step, the proactive-drain action and the run cleanup to it; the script's `raw` overrides, and a non-success result gets no data object. - a GP INSTALL/LOAD/DELETE step always failed the default exact-9000 check although the envelope SW 91XX is the successful answer (the re-announced SET UP MENU; XX is the pending command's length, never pinnable). Documented rather than loosening the default: a new "Driving a RAM install from a script" subsection in docs/test-scripts.md (the 9??? mask + por any, the per-step pending rule - a proactive-drain/expect after every 91XX step), a sentence at the sw-default bullet, and an scp80 default-pinning test. Docs: api.md's respond clause, help EN/RU's TR Config note. Tests: 839 frontend + 812 Python; sw cache simple-v406.
This commit is contained in:
@@ -606,16 +606,20 @@ def _encode_text(text, dcs):
|
||||
return text.encode('gsm03.38')
|
||||
|
||||
|
||||
def build_tr(cmd_num, cmd_type, dev_dst, dev_src, respond):
|
||||
def build_tr(cmd_num, cmd_type, dev_dst, dev_src, respond, answer_tlvs=None):
|
||||
"""Flat COMPREHENSION-TLV TERMINAL RESPONSE payload (TS 102 223 6.8) in the
|
||||
6.8.0 object order: command details, device identities, Result, then the
|
||||
command-specific objects (Text string for GET INKEY/GET INPUT, Item
|
||||
identifier for SELECT ITEM) and any extra raw TLVs. Matches the
|
||||
interactive menu TR layout."""
|
||||
command-specific objects (the terminal's own `answer_tlvs` - the PLI data
|
||||
of PROVIDE LOCAL INFORMATION, the echoed Duration of POLL INTERVAL - the
|
||||
Text string for GET INKEY/GET INPUT, the Item identifier for SELECT ITEM)
|
||||
and any extra raw TLVs. Matches the interactive menu TR layout; the
|
||||
runner passes the terminal objects the script did not override."""
|
||||
out = bytearray([0x81, 0x03, cmd_num & 0xFF, cmd_type & 0xFF, 0x00])
|
||||
out += bytes([0x82, 0x02, dev_dst & 0xFF, dev_src & 0xFF])
|
||||
result = int(respond.get('result', 0))
|
||||
out += bytes([0x83, 0x02, result & 0xFF, 0x00])
|
||||
if answer_tlvs:
|
||||
out += bytes.fromhex(answer_tlvs)
|
||||
if respond.get('text') is not None:
|
||||
text = str(respond['text'])
|
||||
if text == '':
|
||||
|
||||
Reference in New Issue
Block a user