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:
@@ -314,6 +314,16 @@ test('genBerRowValue wraps a C-APDU row in the 22 command TLV', () => {
|
||||
assert.strictEqual(genBerRowValue(cmdRow('hex', '')), '');
|
||||
});
|
||||
|
||||
test('berLenStr uses the BER long form for 2- and 3-byte lengths', () => {
|
||||
assert.strictEqual(berLenStr(0), '00');
|
||||
assert.strictEqual(berLenStr(127), '7F');
|
||||
assert.strictEqual(berLenStr(128), '8180');
|
||||
assert.strictEqual(berLenStr(255), '81FF');
|
||||
assert.strictEqual(berLenStr(256), '820100');
|
||||
assert.strictEqual(berLenStr(65535), '82FFFF');
|
||||
assert.strictEqual(berLenStr(65536), '83010000');
|
||||
});
|
||||
|
||||
test('the embedded pickers offer the RFM/RAM command sets without GET RESPONSE', () => {
|
||||
assert.ok(chainCommands('ber-sim-1').some(c => c.value === 'select'));
|
||||
assert.ok(chainCommands('ber-usim-1').some(c => c.value === 'create-file'));
|
||||
|
||||
@@ -147,6 +147,10 @@ test('composeRamInstallParams composes C9 + EF (C7/C8) like the vendor scripts',
|
||||
// extra raw TLVs follow the generated prefix
|
||||
assert.strictEqual(composeRamInstallParams('', '', '', 'CB02AABB', '').install_params,
|
||||
'C900CB02AABB');
|
||||
// a C9 above 255 bytes uses the 2-byte BER length (0x12C = 300)
|
||||
const longC9 = 'AA'.repeat(300);
|
||||
assert.strictEqual(composeRamInstallParams(longC9, '', '', '', '').install_params,
|
||||
'C982012C' + longC9);
|
||||
});
|
||||
|
||||
test('an EF-form STK part takes the quotas into its own EF (one EF, TS 102 226 8.2.1.3.2.1)', () => {
|
||||
|
||||
Reference in New Issue
Block a user