358a3e7582a82eb4ac66395fe5e8f5ad634c5f10
[csit.git] / docs / model / current / schema / test_case.info.schema.json
1 {
2   "$id": "https://fd.io/FIXME/CSIT/UTI/test_case/info/0.2.0",
3   "$schema": "https://json-schema.org/draft/2020-12/schema",
4   "description": "Schema for info output of test case.",
5   "allOf": [
6     {
7       "description": "The main structure, without conditional relations between fields yet.",
8       "type": "object",
9       "additionalProperties": false,
10       "properties": {
11         "duration": {
12           "description": "A derived quantity, present only in info output files. Difference between start_time and end_time, in seconds.",
13           "$ref": "#/$defs/types/nonnegative_number"
14         },
15         "dut_type": {
16           "description": "DUT type used, e.g. VPP or DPDK.",
17           "type": "string"
18         },
19         "dut_version": {
20           "description": "Version string appropriate to DUT type used.",
21           "type": "string"
22         },
23         "end_time": {
24           "description": "UTC date and time in RFC 3339 format, specifying calendar time just before test case ended (at the end of test case teardown).",
25           "$ref": "#/$defs/types/date_time"
26         },
27         "hosts": {
28           "description": "Array of hosts this test interacted with. This can be used for identifying testbed number. Valid tests shoud interact with at least one DUT or TG. The array is usually sorted, but that is not a requirement.",
29           "type": "array",
30           "minItems": 1,
31           "items": {
32             "description": "Host identifier, usually numeric IPv4 address.",
33             "type": "string"
34           }
35         },
36         "log": {
37           "description": "No log items are implemented in the current version, but the (empty) list is present to simplify logic in multi-version importers.",
38           "$ref": "#/$defs/types/empty_array"
39         },
40         "message": {
41           "description": "If passed is true, this value is empty. Otherwise, value taken directly from TEST_MESSAGE Robot variable, read at the end of test case (in test teardown, before export and validation). It contains information from the exception that caused the failure, probably with additional exceptions from teardown keywords.",
42           "type": "string"
43         },
44         "passed": {
45           "description": "Value set accordingly to TEST_STATUS Robot variable, true if and only if the status is \"PASS\". The status is read at the end of test case (in test teardown, before export and validation).",
46           "type": "boolean"
47         },
48         "result": {
49           "type": "object",
50           "allOf": [
51             {
52               "description": "Sub-schema common for all cases, only result type identifier defined here.",
53               "properties": {
54                 "type": {
55                   "description": "Identifier of which result type case is applied.",
56                   "type": "string"
57                 }
58               },
59               "required": [
60                 "type"
61               ]
62             },
63             {
64               "oneOf": [
65                 {
66                   "description": "Result type for unknown case. This case represents a test with no specific result (outside message), e.g. device test; or a test with result not parsed into this version of model yet, e.g. GSO test.",
67                   "additionalProperties": false,
68                   "properties": {
69                     "type": {
70                       "const": "unknown"
71                     }
72                   }
73                 },
74                 {
75                   "description": "Result type MRR case.",
76                   "additionalProperties": false,
77                   "properties": {
78                     "type": {
79                       "const": "mrr"
80                     },
81                     "receive_rate": {
82                       "description": "The results refer to receive rates for multiple MRR trials. For PPS, these are aggregate (bidirectional) rates. Currently, the tests are exporting approximated receive rates. That means the actual trial duration is measured (as opposed to trusting traffic generator to honor its target duration), so the resulting values contain noise from time measurement, and can be lower than the real performance (due to various time overheads). Bandwidth values are supported, but currently Robot does not export them.",
83                       "$ref": "#/$defs/types/rate_list_with_bandwidth"
84                     }
85                   },
86                   "required": [
87                     "type",
88                     "receive_rate"
89                   ]
90                 },
91                 {
92                   "description": "Result type NDRPDR case.",
93                   "additionalProperties": false,
94                   "properties": {
95                     "type": {
96                       "const": "ndrpdr"
97                     },
98                     "ndr": {
99                       "description": "The results refer to search for NDR (Non Drop Rate). For PPS, this is aggregate (bidirectional) rate. Each bound was used as the target load value in a full-duration trial measurement. The accepted loss ratio for NDR is exact zero. Note that packets the Traffic Generator did not send are also counted as lost packets.",
100                       "$ref": "#/$defs/macros/lower_and_upper_rate"
101                     },
102                     "pdr": {
103                       "description": "The results refer to search for PDR (Partial Drop Rate). For PPS, this is aggregate (bidirectional) rate. Each bound was used as the target load value in a full-duration trial measurement. The accepted loss ratio for PDR is 0.5%. Note that packets the Traffic Generator did not send are also counted as lost packets.",
104                       "$ref": "#/$defs/macros/lower_and_upper_rate"
105                     },
106                     "latency_forward": {
107                       "description": "Object with results related to latency part of NDRPDR test, for forward traffic direction. It is the direction used in unidirectional traffic profiles. ASTF profiles and IMIX STL profiles do not support latency information, so for those tests this object is missing. It is also missing if Traffic Generator fails to return valid latency results for any other reasons, e.g. latency rate is too high for CPU/NIC used.",
108                       "$ref": "#/$defs/macros/latency_for_loads"
109                     },
110                     "latency_reverse": {
111                       "description": "Object with results related to latency part of NDRPDR test, for reverse traffic diration. This object is not present when unidirectional traffic profiles are used. ASTF profiles and IMIX STL profiles do not support latency information, so for those tests this object is missing. It is also missing if Traffic Generator fails to return valid latency results for any other reasons, e.g. latency rate is too high for CPU/NIC used.",
112                       "$ref": "#/$defs/macros/latency_for_loads"
113                     }
114                   },
115                   "required": [
116                     "type",
117                     "ndr",
118                     "pdr"
119                   ]
120                 },
121                 {
122                   "description": "Result type SOAK case.",
123                   "additionalProperties": false,
124                   "properties": {
125                     "type": {
126                       "const": "soak"
127                     },
128                     "critical_rate": {
129                       "description": "The results refer to bayesian estimate of critical rate corresponding to average loss ratio of 10^-7. For PPS, this is aggregate (bidirectional) rate. The bounds are computed from trial measurement results, but are not equal to any target load used. Note that packets the Traffic Generator did not send are also counted as lost packets.",
130                       "$ref": "#/$defs/macros/lower_and_upper_rate"
131                     }
132                   },
133                   "required": [
134                     "type",
135                     "critical_rate"
136                   ]
137                 }
138               ]
139             }
140           ]
141         },
142         "start_time": {
143           "description": "UTC date and time in RFC 3339 format, specifying calendar time just after test case started (at the start of test setup).",
144           "$ref": "#/$defs/types/date_time"
145         },
146         "tags": {
147           "description": "The list of strings comes directly from Robot variable TEST_TAGS. The content should include both static and dynamic tags at the end of test case (teardown).",
148           "type": "array",
149           "items": {
150             "type": "string"
151           }
152         },
153         "test_documentation": {
154           "description": "Value taken directly from TEST_DOCUMENTATION Robot variable. The content is what you see in suite file at test case definition, which is usually empty as CSIT uses data driven test cases.",
155           "type": "string"
156         },
157         "test_id": {
158           "description": "A derived quantity, present only in info output files. It is the most complete and unique identifier for a test case. This property has a value, of the following form: {suite_name}.{test_name} Here, suite name comes from SUITE_NAME robot variable, test name comes from TEST_NAME robot variable, but both are converted to lower case, and spaces are replaced by underscores.",
159           "type": "string",
160           "minLength": 3
161         },
162         "test_name_long": {
163           "description": "A derived quantity, present only in info output files. This property has a value, of the following form: {nic_short_name}-{frame_size}-{threads_and_cores}-{suite_part} Here, suite part is very similar to suite tag, but additionally may contain a prefix describing NIC driver used (if it is not the default one, drv_vfio_pci for VPP tests). Any space is replaced by underscore and letters are lower case.",
164           "type": "string",
165           "minLength": 3
166         },
167         "test_name_short": {
168           "description": "A derived quantity, present only in info output files. This property has a value very similar to suite tag, but additionally may contain a prefix describing NIC driver used (if it is not the default one, drv_vfio_pci for VPP tests). Any space is replaced by underscore and letters are lower case.",
169           "type": "string",
170           "minLength": 3
171         },
172         "test_type": {
173           "description": "A derived quantity, present only in info output files. Test type identifier, PAL uses it to group similar tests, e.g. for comparison tables. Ideally, this information should be parseable from test name, but the current naming scheme is not simple/consistent enough. The current implementation queries the robot test tags. The resulting value is frequently identical to result type, but this schema version does not require any relation there, as PAL may want to group tests differently.",
174           "type": "string",
175           "enum": [
176             "device",
177             "gso",
178             "hoststack",
179             "mrr",
180             "ndrpdr",
181             "reconf",
182             "soak",
183             "vsap"
184           ]
185         },
186         "version": {
187           "description": "CSIT model version (semver format) the exporting code adhered to.",
188           "type": "string",
189           "const": "1.0.0"
190         }
191       },
192       "required": [
193         "duration",
194         "dut_type",
195         "dut_version",
196         "end_time",
197         "hosts",
198         "log",
199         "message",
200         "passed",
201         "result",
202         "start_time",
203         "tags",
204         "test_documentation",
205         "test_id",
206         "test_name_long",
207         "test_name_short",
208         "test_type",
209         "version"
210       ]
211     },
212     {
213       "description": "Subschema validating relation between status and message.",
214       "oneOf": [
215         {
216           "description": "Subschema for passing tests, message has to be empty.",
217           "type": "object",
218           "properties": {
219             "passed": {
220               "const": true
221             },
222             "message": {
223               "const": ""
224             }
225           }
226         },
227         {
228           "description": "Subschema for failing tests, mesage cannot be empty.",
229           "type": "object",
230           "properties": {
231             "passed": {
232               "const": false
233             },
234             "message": {
235               "minLength": 1
236             }
237           }
238         }
239       ]
240     },
241     {
242       "description": "Subschema validating relation between dut_type and dut_version.",
243       "oneOf": [
244         {
245           "description": "Subschema for tests with no DUT, e.g. TRex self-test.",
246           "type": "object",
247           "properties": {
248             "dut_type": {
249               "const": "none"
250             },
251             "dut_version": {
252               "const": ""
253             }
254           }
255         },
256         {
257           "description": "Subschema for DUT type VPP.",
258           "type": "object",
259           "properties": {
260             "dut_type": {
261               "const": "VPP"
262             },
263             "dut_version": {
264               "minLength": 1
265             }
266           }
267         },
268         {
269           "description": "Subschema for DUT type DPDK.",
270           "type": "object",
271           "properties": {
272             "dut_type": {
273               "const": "DPDK"
274             },
275             "dut_version": {
276               "minLength": 1
277             }
278           }
279         }
280       ]
281     }
282   ],
283   "$defs": {
284     "types": {
285       "nonnegative_number": {
286         "type": "number",
287         "minimum": 0
288       },
289       "positive_number": {
290         "type": "number",
291         "minimum": 1
292       },
293       "nonnegative_integer": {
294         "type": "integer",
295         "minimum": 0
296       },
297       "positive_integer": {
298         "type": "integer",
299         "minimum": 1
300       },
301       "date_time": {
302         "type": "string",
303         "format": "date-time"
304       },
305       "empty_array": {
306         "type": "array",
307         "maxItems": 0
308       },
309       "rate_unit": {
310         "description": "Packets per second (pps) or connections per second (cps).",
311         "type": "string",
312         "enum": [
313           "pps",
314           "cps"
315         ]
316       },
317       "bandwidth_unit": {
318         "description": "Unit of measurement for bandwidth values. Currently a constant, but later versions of model may allow more units.",
319         "enum": [
320           "bps"
321         ]
322       },
323       "value_with_unit": {
324         "description": "Reusable composite type, value together with its unit of measurement.",
325         "type": "object",
326         "additionalProperties": false,
327         "properties": {
328           "value": {
329             "description": "Numeric value, context specified elsewhere. The only assumption is that value is not negative.",
330             "$ref": "#/$defs/types/nonnegative_number"
331           },
332           "unit": {
333             "description": "Unit of measurement for the value. Context and allowed values are specified elsewhere.",
334             "type": "string"
335           }
336         },
337         "required": [
338           "value",
339           "unit"
340         ]
341       },
342       "rate_without_bandwidth": {
343         "description": "Reusable type, for various rate quantites.",
344         "allOf": [
345           {
346             "$ref": "#/$defs/types/value_with_unit"
347           },
348           {
349             "properties": {
350               "value": {
351                 "description": "Unless specified otherwise, this is the aggregated rate (sum of both traffic directions). Depending on the usage, the value can express intended load, offered load, receive rate, and various approximations or estimated bounds thereof."
352               },
353               "unit": {
354                 "description": "A transaction rate unit the value is expressed in.",
355                 "$ref": "#/$defs/types/rate_unit"
356               }
357             }
358           }
359         ]
360       },
361       "bandwidth": {
362         "description": "Reusable type, for various bandwidth quantites.",
363         "allOf": [
364           {
365             "$ref": "#/$defs/types/value_with_unit"
366           },
367           {
368             "properties": {
369               "value": {
370                 "description": "Bandwidth value computed from the corresponding rate."
371               },
372               "unit": {
373                 "$ref": "#/$defs/types/bandwidth_unit"
374               }
375             }
376           }
377         ]
378       },
379       "rate_with_bandwidth": {
380         "description": "Reusable composite type, joining primary rate with optional derived bandwidth. Not all test types currently compute bandwidth, even if rate unit is pps.",
381         "type": "object",
382         "additionalProperties": false,
383         "properties": {
384           "rate": {
385             "$ref": "#/$defs/types/rate_without_bandwidth"
386           },
387           "bandwidth": {
388             "$ref": "#/$defs/types/bandwidth"
389           }
390         },
391         "required": [
392           "rate"
393         ]
394       },
395       "value_list_with_unit_and_stats": {
396         "description": "Reusable composite type, multiple values together with their unit of measurement and derived statistics.",
397         "type": "object",
398         "additionalProperties": false,
399         "properties": {
400           "values": {
401             "description": "List of values of the same unit, useful for MRR.",
402             "type": "array",
403             "minItmes": 1,
404             "items": {
405               "description": "Numeric value, context specified elsewhere. The only assumption is that the value is nonnegative.",
406               "$ref": "#/$defs/types/nonnegative_number"
407             }
408           },
409           "avg": {
410             "description": "A derived quantity, present only in info output files. It is the arithmetic average of the values list.",
411             "$ref": "#/$defs/types/nonnegative_number"
412           },
413           "stdev": {
414             "description": "A derived quantity, present only in info output files. It is the standard deviation for the values list, as computed by jumpavg library.",
415             "$ref": "#/$defs/types/nonnegative_number"
416           },
417           "unit": {
418             "description": "Unit of measurement for the values. Context and allowed values are specified elsewhere.",
419             "type": "string"
420           }
421         },
422         "required": [
423           "values",
424           "avg",
425           "stdev",
426           "unit"
427         ]
428       },
429       "rate_list_without_bandwidth": {
430         "description": "Reusable composite type, multiple rate values.",
431         "allOf": [
432           {
433             "$ref": "#/$defs/types/value_list_with_unit_and_stats"
434           },
435           {
436             "properties": {
437               "values": {
438                 "items": {
439                   "description": "Unless specified otherwise, this is the aggregated rate (sum of both traffic directions). Depending on the usage, the value can express intended load, offered load, receive rate, and various approximations or estimated bounds thereof."
440                 }
441               },
442               "unit": {
443                 "$ref": "#/$defs/types/rate_unit"
444               }
445             }
446           }
447         ]
448       },
449       "bandwidth_list": {
450         "description": "Reusable composite type, multiple bandwidth values. This is a derived entity, thus it only appears in info output, and only if rate unit is pps.",
451         "allOf": [
452           {
453             "$ref": "#/$defs/types/value_list_with_unit_and_stats"
454           },
455           {
456             "properties": {
457               "values": {
458                 "items": {
459                   "description": "Unless specified otherwise, this is the aggregated bandwidth (sum of both traffic directions). Depending on the usage, the value can express intended load, offered load, receive rate, and various approximations or estimated bounds thereof."
460                 }
461               },
462               "unit": {
463                 "$ref": "#/$defs/types/bandwidth_unit"
464               }
465             }
466           }
467         ]
468       },
469       "rate_list_with_bandwidth": {
470         "description": "Reusable composite type, joining primary rates with optional derived bandwidths (and stats). No test types currently computes the bandwidth part.",
471         "type": "object",
472         "additionalProperties": false,
473         "properties": {
474           "rate": {
475             "$ref": "#/$defs/types/rate_list_without_bandwidth"
476           },
477           "bandwidth": {
478             "$ref": "#/$defs/types/bandwidth_list"
479           }
480         },
481         "required": [
482           "rate"
483         ]
484       }
485     },
486     "macros": {
487       "lower_and_upper_rate": {
488         "type": "object",
489         "additionalProperties": false,
490         "properties": {
491           "lower": {
492             "description": "The lower bound (or min_rate) for the estimate of a particular searched value.",
493             "$ref": "#/$defs/types/rate_with_bandwidth"
494           },
495           "upper": {
496             "description": "The upper bound (or max_rate) for the estimate of a particular searched value.",
497             "$ref": "#/$defs/types/rate_with_bandwidth"
498           }
499         },
500         "required": [
501           "lower",
502           "upper"
503         ]
504       },
505       "latency_numbers": {
506         "type": "object",
507         "additionalProperties": false,
508         "properties": {
509           "min": {
510             "description": "Rounded minimal latency time measured in this trial. See unit property for the unit of measurement.",
511             "$ref": "#/$defs/types/nonnegative_integer"
512           },
513           "max": {
514             "description": "Rounded maximal latency time measured in this trial. See unit property for the unit of measurement. Zero value is not allowed, as that is one of symptoms of Traffic Generator failing to get proper latency.",
515             "$ref": "#/$defs/types/positive_integer"
516           },
517           "avg": {
518             "description": "Rounded average latency time measured in this trial. See unit property for the unit of measurement.",
519             "$ref": "#/$defs/types/nonnegative_integer"
520           },
521           "hdrh": {
522             "description": "Base64-encoded compressed representation of HDRHistogram of all latency sample times encountered in this latency trial. See unit property for the unit of measurement. Note that some bins can be several units wide.",
523             "type": "string"
524           },
525           "unit": {
526             "description": "Unit of measurement for latency times. Currently a constant, but later versions of the model may allow more values.",
527             "type": "string",
528             "enum": [
529               "us"
530             ]
531           }
532         },
533         "required": [
534           "avg",
535           "hdrh",
536           "max",
537           "min",
538           "unit"
539         ]
540       },
541       "latency_for_loads": {
542         "type": "object",
543         "additionalProperties": false,
544         "properties": {
545           "pdr_0": {
546             "description": "Object related to latency measurement performed at minimal rate (currently 9000 pps per direction).",
547             "$ref": "#/$defs/macros/latency_numbers"
548           },
549           "pdr_10": {
550             "description": "Object related to latency measurement performed at 10% of PDR lower bound, if needed rounded up to minimal rate (currently 9000 pps per direction).",
551             "$ref": "#/$defs/macros/latency_numbers"
552           },
553           "pdr_50": {
554             "description": "Object related to latency measurement performed at 50% of PDR lower bound, if needed rounded up to minimal rate (currently 9000 pps per direction).",
555             "$ref": "#/$defs/macros/latency_numbers"
556           },
557           "pdr_90": {
558             "description": "Object related to latency measurement performed at 90% of PDR lower bound, if needed rounded up to minimal rate (currently 9000 pps per direction).",
559             "$ref": "#/$defs/macros/latency_numbers"
560           }
561         },
562         "required": [
563           "pdr_0",
564           "pdr_10",
565           "pdr_50",
566           "pdr_90"
567         ]
568       }
569     }
570   }
571 }