v3.22.0 (review fixes): the quota zero, the suite repair paths, the docs
Second review round on the unpushed v3.20.0-v3.22.0 batch: - install parameters: a zero memory quota (nv_quota: 0 - the vendor reference form's C7 02 0000 C8 02 0000) is composed instead of being dropped as "unset" (only None/blank leaves the TLV out); a truncated EF length in stk_params is refused instead of read as an empty EF. - test suites: a suite whose member script is gone is repairable - the update endpoint accepts pruning a dangling reference (a removal of a live script stays refused; the PWA's row Delete prunes it), and reconcile_scripts_to_suites() lists an orphan even when its suite_id write is refused by the validator, so a stored script that no longer validates stays visible in the editor and fails at run start with the message instead of disappearing. - engine/PWA: the proactive action refuses a check.data (its result data is the drained-command list - the check was silently ignored); the vestigial _testScriptDraft is gone; berLenStr emits the 2/3-byte BER long form (a >255-byte C9 composes correctly). - docs: api.md (the stop cleanup answers ok, never an automatic cancel; the server persists the counters - the PWA does not write them back; the suite bundle import always merges the scripts; the quota-0 note) and test-scripts.md (the event action covers all modelled events; the direct-create path needs a suite_id; the format history); help EN/RU counter wording. - tests: the zero quota / truncated EF, the prune path, the invalid-script listing, the proactive data-check refusal, berLenStr and the >255-byte C9. Tests: 839 frontend + 804 Python; sw cache simple-v403.
This commit is contained in:
@@ -119,6 +119,17 @@ class TestValidation(unittest.TestCase):
|
||||
T.normalise_script({'steps': [{'type': 'action', 'kind': 'proactive',
|
||||
'params': bad}]}, _resolver)
|
||||
|
||||
def test_the_proactive_action_refuses_a_data_check(self):
|
||||
# The proactive result's data is the drained-command list, not a
|
||||
# single response: a `data` check would be silently ignored, so the
|
||||
# engine refuses it (assert what was drained with `require`).
|
||||
with self.assertRaises(T.ScriptError) as cm:
|
||||
T.normalise_script({'steps': [
|
||||
{'type': 'action', 'kind': 'proactive',
|
||||
'check': {'data': 'AABB'}}]}, _resolver)
|
||||
self.assertIn('check.data is not used by the proactive action',
|
||||
str(cm.exception))
|
||||
|
||||
def test_integer_fields_accept_decimals_with_leading_zeros_and_hex(self):
|
||||
script = T.normalise_script({'steps': [
|
||||
{'type': 'action', 'kind': 'status',
|
||||
|
||||
Reference in New Issue
Block a user