From feb40146b780efabe9974544fc40ba97b19649d5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 13 Jan 2022 15:44:35 +0300 Subject: [PATCH] [#109] netmap: describe JSON test format Signed-off-by: Evgenii Stratonikov --- netmap/Tests.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 netmap/Tests.md diff --git a/netmap/Tests.md b/netmap/Tests.md new file mode 100644 index 00000000..1b83cedf --- /dev/null +++ b/netmap/Tests.md @@ -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. \ No newline at end of file