Expand description
Conformance cases for DeviceStore backends (spec 3.3 §10 K2, §11 S-I7).
| Case | Contract |
|---|---|
code_round_trip_and_take_once | A code reads back exactly as put, once: a second take finds nothing |
take_returns_expired_codes | A take returns a code past its expiry; the caller decides |
prune_removes_expired_codes | prune_codes removes the codes expired at or before the instant, and only those |
clear_removes_every_code | clear_codes removes every waiting code |
device_round_trip | A device reads back exactly as put: every field, every scope |
put_device_replaces | A second put of one device replaces it, as a revocation does |
list_devices_orders_by_pairing_then_id | list_devices orders by pairing time, then id |
unknown_ids | An unknown device and an unknown code are None |
records_survive_a_restart | Devices and codes read back through a new handle (durable backends only) |
concurrent_takes_take_once | Eight concurrent takes of one code from two handles take it once |
concurrent_writers | Concurrent puts from two handles over distinct devices and codes lose none |
claim_attempts_are_counted_once_and_shared | Concurrent claim counts from two handles each get a distinct count, a reset starts again at one, and the count survives a restart |
attachments_round_trip_per_kind | An attachment reads back exactly as put, listed under its holder and kind only, in key order |
put_attachment_replaces | A second put of one holder, kind and key replaces it |
put_attachment_if_absent_writes_once | Eight concurrent puts-if-absent of one attachment from two handles write it once |
remove_attachment_removes_one | Removing one attachment says whether it was there and leaves the rest |
remove_attachments_removes_the_holders | Removing a holder’s attachments removes every kind of it and nothing of another holder |
attachments_survive_a_restart | Attachments read back through a new handle (durable backends only) |
Every case writes under fresh ids and hashes, so a harness may point every case at one
shared database, except clear_removes_every_code, which removes every code, and
claim_attempts_are_counted_once_and_shared, which uses the one count of claims: give
each a database of its own, as the harnesses of this crate give every case.
Traits§
- Device
Store Harness - Opens a
DeviceStorebackend for the conformance suite.
Functions§
- attachments_
round_ trip_ per_ kind - An attachment reads back exactly as put, listed under its holder and kind only, in key order.
- attachments_
survive_ a_ restart - Attachments read back through a new handle (durable backends only).
- claim_
attempts_ are_ counted_ once_ and_ shared - Concurrent claim counts from two handles each get a distinct count, a reset starts the count again at one, and a durable count survives a restart, so replicas share the count of wrong codes.
- clear_
removes_ every_ code clear_codesremoves every waiting code.- code_
round_ trip_ and_ take_ once - A code reads back exactly as put, once.
- concurrent_
takes_ take_ once - Eight concurrent takes of one code from two handles take it once.
- concurrent_
writers - Concurrent puts from two handles over distinct devices and codes lose none.
- device_
round_ trip - A device reads back exactly as put.
- list_
devices_ orders_ by_ pairing_ then_ id list_devicesorders by pairing time, then id.- prune_
removes_ expired_ codes prune_codesremoves the codes expired at or before the instant, and only those.- put_
attachment_ if_ absent_ writes_ once - Eight concurrent puts-if-absent of one attachment from two handles write it once.
- put_
attachment_ replaces - A second put of one holder, kind and key replaces it.
- put_
device_ replaces - A second put of one device replaces it.
- records_
survive_ a_ restart - Devices and codes read back through a new handle.
- remove_
attachment_ removes_ one - Removing one attachment says whether it was there and leaves the rest.
- remove_
attachments_ removes_ the_ holders - Removing a holder’s attachments removes every kind of it and nothing of another holder.
- take_
returns_ expired_ codes - A take returns a code past its expiry.
- unknown_
ids - An unknown device and an unknown code are
None.