fix: CAP compatibility test review fixes (v3.6.49)
Review of v3.6.48 found six issues; the two that matter in use:
- ramProbeParse('') errored, so the basic 'is this CAP compatible with
this card at all?' run (no overrides) was refused by an alert. An empty
list is valid now: the test runs with the CAP's own versions.
- ramCompatVerdict said 'Import list rejected' for every failure. It now
distinguishes: a request error (no steps), a failed format probe (the
card not answering), an INSTALL [for load] refusal, and only then the
import list - each with its own headline.
Plus:
- the result line shows the applied probe (ramCompatProbeNote: 'probe:
7 imports -> 0.0 · +1 appended', unmatched AIDs included);
- #ram-compat-block validates 1..240 like the install's block size;
- the server reports probe_unmatched (override AIDs matching no entry,
previously silent when another override matched) and logs them;
- tests: the endpoint's probe-400 path (a mini CAP + a dummy scc),
_cap_import_aids, the verdict cases and the probe note.
sw cache simple-v322; tests: 540 Python / 687 Node.
This commit is contained in:
@@ -9,8 +9,8 @@ import zipfile
|
||||
|
||||
from pysim_simple_server import capmem
|
||||
from pysim_simple_server.server import (
|
||||
_ber_len, _cap_apdu_sequence, _cap_compat_blocks, _cap_import_end,
|
||||
_cap_info_body, _cap_parse, _probe_import_versions)
|
||||
_ber_len, _cap_apdu_sequence, _cap_compat_blocks, _cap_import_aids,
|
||||
_cap_import_end, _cap_info_body, _cap_parse, _probe_import_versions)
|
||||
|
||||
|
||||
# ─── synthetic CAP builder ───────────────────────────────────────────────
|
||||
@@ -272,6 +272,10 @@ class ImportProbeTests(unittest.TestCase):
|
||||
self.assertEqual(data[3 + 3 * 2:3 + 3 * 2 + 2], import_size.to_bytes(2, 'big'))
|
||||
self.assertTrue(self._walk_ok(patched))
|
||||
|
||||
def test_cap_import_aids(self):
|
||||
self.assertEqual(_cap_import_aids(self._load_file()),
|
||||
[JAVACARD_FRAMEWORK.hex().upper(), self.OTHER_AID.hex().upper()])
|
||||
|
||||
def test_probe_rejects_bad_additions(self):
|
||||
load = self._load_file()
|
||||
with self.assertRaises(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user