v3.23.0: the start-with-reset suite option

A suite may carry `start_reset` (store schema v2, default false; the editor's
"Start with card reset" checkbox): before the run, the server physically
resets the card and runs the full re-initialization - `_card_reset_reinit`
(extracted from the eSIM profile-switch reinit) does reset_card() + equip +
_apply_equipped_card + the shell registration probe.

The reset runs in _test_suite_run_request before the preset/ADM checks:
- the run's preset must still match the post-reset ICCID (a mismatch refuses
  the start with a re-select hint),
- a require_adm suite re-verifies the ADM for the new card session (the
  latch is per session).

The suite report carries start_reset + reset {ok, iccid, ms}; the PWA shows
"started with a card reset" in the report header and a RESET badge in the
suite list.  Mid-run resets stay fatal.

Documented caveat: the init drain consumes the card's initial proactive
commands, so a script cannot catch the first command after the reset (they
stay in the proactive log).

Docs: test-scripts.md, api.md, help EN/RU, repo AGENTS.
Tests: 843 frontend + 827 Python; sw cache simple-v413.
This commit is contained in:
2026-10-07 09:22:24 +03:00
parent eee2888a2b
commit 6bea57599c
12 changed files with 277 additions and 48 deletions
+14
View File
@@ -48,6 +48,20 @@ class StoreCrudTests(unittest.TestCase):
self.assertFalse(self.store.remove(s['id']))
self.assertIsNone(self.store.get('nope'))
def test_start_reset_round_trips(self):
# v3.23.0: a suite may start with a card reset (the full re-init); the
# flag defaults false and survives add/update/reload
s = self.store.add(suite(name='reset me', start_reset=True))
self.assertTrue(s['start_reset'])
# a partial update keeps it; a reload keeps it
updated = self.store.update(s['id'], {'name': 'renamed'})
self.assertTrue(updated['start_reset'])
reloaded = make_store(self.tmp.name)
self.assertTrue(reloaded.get(s['id'])['start_reset'])
# an explicit false clears it
self.assertFalse(self.store.update(s['id'], {'start_reset': False})['start_reset'])
self.assertFalse(self.store.add(suite())['start_reset'])
def test_callers_never_mutate_the_store(self):
s = self.store.add(suite(scripts=[
{'script_id': SID_A, 'role': 'member', 'on_fail': 'stop'}]))