[#109] netmap: describe JSON test format

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-13 15:44:35 +03:00 committed by Alex Vanin
parent 2f446c8e42
commit feb40146b7

18
netmap/Tests.md Normal file
View file

@ -0,0 +1,18 @@
## Language-agnostic testing
`json_tests` sub-folder contains netmap selection algorithm tests in the following format:
### File structure
Field|Description
---|---
`name`|Human readable name for a set of related tests operating on a single netmap.
`nodes`|List of `netmap.NodeInfo` structures coressponding to a nodes in the network.
`tests`|Map from a single test name to a `test` structure.
### Single test structure
Field|Description
---|---
`policy`|JSON representation of a netmap policy.
`pivot`|Optional pivot to use in container node selection.
`result`|List of lists of node-indices corresponding to each replica in the placement policy.
`error`|Error that should be raised for this specific test. The actual strings are used in SDK, other implementation may simply check that error has occurred.
`placement`|Optional field containing another test for selecting placement nodes for an object. Can contain `pivot`, `result` and `error` fields with the same meaning as above. Note that if `pivot` is omitted, empty value should be used.