time.sleep(0.01)
ksft_eq(outq, exp_len)
+
+def _get_stat(cfg, key):
+ return cfg.pspnl.get_stats({'dev-id': cfg.psp_dev_id})[key]
+
#
# Test case boiler plate
#
""" Test key rotation """
_init_psp_dev(cfg)
+ prev_rotations = _get_stat(cfg, 'key-rotations')
+
rot = cfg.pspnl.key_rotate({"id": cfg.psp_dev_id})
ksft_eq(rot['id'], cfg.psp_dev_id)
rot = cfg.pspnl.key_rotate({"id": cfg.psp_dev_id})
ksft_eq(rot['id'], cfg.psp_dev_id)
+ cur_rotations = _get_stat(cfg, 'key-rotations')
+ ksft_eq(cur_rotations, prev_rotations + 2)
+
def dev_rotate_spi(cfg):
""" Test key rotation and SPI check """
""" Test send on a double-rotated key """
_init_psp_dev(cfg)
+ prev_stale = _get_stat(cfg, 'stale-events')
s = _make_psp_conn(cfg)
try:
rx_assoc = cfg.pspnl.rx_assoc({"version": 0,
cfg.pspnl.key_rotate({"id": cfg.psp_dev_id})
cfg.pspnl.key_rotate({"id": cfg.psp_dev_id})
+ cur_stale = _get_stat(cfg, 'stale-events')
+ ksft_gt(cur_stale, prev_stale)
+
s.send(b'0123456789' * 200)
_check_data_outq(s, 2000, force_wait=True)
finally: