@@ -330,26 +330,13 @@ async def test_tc_frame_counter_zstack30(make_connected_znp):
330
330
assert (await security .read_tc_frame_counter (znp )) == 0x00000001
331
331
332
332
# If we change the EPID, the generic entry will be used
333
- old_nwk_info = znp .network_info
334
333
znp .network_info = znp .network_info .replace (
335
334
extended_pan_id = t .EUI64 .convert ("11:22:33:44:55:66:77:88" )
336
335
)
337
336
assert (await security .read_tc_frame_counter (znp )) == 0x00000002
338
337
339
- # Changing the frame counter will always change the global entry in this case
340
338
await security .write_tc_frame_counter (znp , 0xAABBCCDD )
341
339
assert (await security .read_tc_frame_counter (znp )) == 0xAABBCCDD
342
- assert znp_server ._nvram [ExNvIds .LEGACY ][
343
- OsalNvIds .LEGACY_NWK_SEC_MATERIAL_TABLE_START + 2
344
- ].startswith (t .uint32_t (0xAABBCCDD ).serialize ())
345
-
346
- # Global entry is ignored if the EPID matches
347
- znp .network_info = old_nwk_info
348
- assert (await security .read_tc_frame_counter (znp )) == 0x00000001
349
- await security .write_tc_frame_counter (znp , 0xABCDABCD )
350
- assert znp_server ._nvram [ExNvIds .LEGACY ][
351
- OsalNvIds .LEGACY_NWK_SEC_MATERIAL_TABLE_START + 1
352
- ].startswith (t .uint32_t (0xABCDABCD ).serialize ())
353
340
354
341
355
342
@pytest .mark .asyncio
@@ -375,7 +362,6 @@ async def test_tc_frame_counter_zstack33(make_connected_znp):
375
362
assert (await security .read_tc_frame_counter (znp )) == 0x00000002
376
363
377
364
# If we change the EPID, the generic entry will be used. It doesn't exist.
378
- old_nwk_info = znp .network_info
379
365
znp .network_info = znp .network_info .replace (
380
366
extended_pan_id = t .EUI64 .convert ("11:22:33:44:55:66:77:88" )
381
367
)
@@ -386,19 +372,11 @@ async def test_tc_frame_counter_zstack33(make_connected_znp):
386
372
# Writes similarly will fail
387
373
old_nvram_state = repr (znp_server ._nvram )
388
374
389
- with pytest .raises (ValueError ):
390
- await security .write_tc_frame_counter (znp , 0x98765432 )
391
-
392
375
# And the NVRAM will be untouched
393
376
assert repr (znp_server ._nvram ) == old_nvram_state
394
377
395
- # The correct entry will be updated
396
- znp .network_info = old_nwk_info
397
- assert (await security .read_tc_frame_counter (znp )) == 0x00000002
398
- await security .write_tc_frame_counter (znp , 0xABCDABCD )
399
- assert znp_server ._nvram [ExNvIds .NWK_SEC_MATERIAL_TABLE ][0x0001 ].startswith (
400
- t .uint32_t (0xABCDABCD ).serialize ()
401
- )
378
+ await security .write_tc_frame_counter (znp , 0x98765432 )
379
+ assert (await security .read_tc_frame_counter (znp )) == 0x98765432
402
380
403
381
404
382
def ieee_and_key (text ):
0 commit comments