bdfea5990798dc94f22b069942faf89e31b8cde1
[csit.git] / docs / model / current / schema / test_case.info.schema.json
1 {
2   "$id": "https://fd.io/FIXME/CSIT/UTI/test_case/info/1.3.0",
3   "$schema": "https://json-schema.org/draft/2020-12/schema",
4   "description": "Schema for 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. 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           "minLength": 1
19         },
20         "dut_version": {
21           "description": "Version string appropriate to DUT type used.",
22           "type": "string",
23           "minLength": 1
24         },
25         "end_time": {
26           "description": "UTC date and time in RFC 3339 format, specifying calendar time just before test case ended (at the end of test case teardown).",
27           "$ref": "#/$defs/types/date_time"
28         },
29         "hosts": {
30           "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.",
31           "type": "array",
32           "minItems": 1,
33           "items": {
34             "description": "Host identifier, usually numeric IPv4 address.",
35             "type": "string"
36           }
37         },
38         "telemetry": {
39           "description": "Array of telemetry entries. Each entry represent one captured metric.",
40           "type": "array",
41           "minItems": 0,
42           "items": {
43             "description": "Telemetry entry.",
44             "type": "string"
45           }
46         },
47         "message": {
48           "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.",
49           "type": "string"
50         },
51         "passed": {
52           "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).",
53           "type": "boolean"
54         },
55         "result": {
56           "type": "object",
57           "allOf": [
58             {
59               "description": "Sub-schema common for all cases, only result type identifier defined here.",
60               "properties": {
61                 "type": {
62                   "description": "Identifier of which result type case is applied.",
63                   "type": "string"
64                 }
65               },
66               "required": [
67                 "type"
68               ]
69             },
70             {
71               "oneOf": [
72                 {
73                   "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.",
74                   "additionalProperties": false,
75                   "properties": {
76                     "type": {
77                       "const": "unknown"
78                     }
79                   }
80                 },
81                 {
82                   "description": "Result type MRR case.",
83                   "additionalProperties": false,
84                   "properties": {
85                     "type": {
86                       "const": "mrr"
87                     },
88                     "receive_rate": {
89                       "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.",
90                       "$ref": "#/$defs/types/rate_list_with_bandwidth"
91                     }
92                   },
93                   "required": [
94                     "type",
95                     "receive_rate"
96                   ]
97                 },
98                 {
99                   "description": "Result type NDRPDR case.",
100                   "additionalProperties": false,
101                   "properties": {
102                     "type": {
103                       "const": "ndrpdr"
104                     },
105                     "ndr": {
106                       "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.",
107                       "$ref": "#/$defs/macros/lower_and_upper_rate"
108                     },
109                     "pdr": {
110                       "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.",
111                       "$ref": "#/$defs/macros/lower_and_upper_rate"
112                     },
113                     "latency_forward": {
114                       "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.",
115                       "$ref": "#/$defs/macros/latency_for_loads"
116                     },
117                     "latency_reverse": {
118                       "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.",
119                       "$ref": "#/$defs/macros/latency_for_loads"
120                     }
121                   },
122                   "required": [
123                     "type",
124                     "ndr",
125                     "pdr"
126                   ]
127                 },
128                 {
129                   "description": "Result type SOAK case.",
130                   "additionalProperties": false,
131                   "properties": {
132                     "type": {
133                       "const": "soak"
134                     },
135                     "critical_rate": {
136                       "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.",
137                       "$ref": "#/$defs/macros/lower_and_upper_rate"
138                     }
139                   },
140                   "required": [
141                     "type",
142                     "critical_rate"
143                   ]
144                 },
145                 {
146                   "description": "Result type RECONF case.",
147                   "additionalProperties": false,
148                   "properties": {
149                     "type": {
150                       "const": "reconf"
151                     },
152                     "aggregate_rate": {
153                       "description": "Load used when reconfiguring, found as NDR lower bound. This is an aggregate (bidirectional) rate. Note that packets which the Traffic Generator did not send, are also counted as lost packets.",
154                       "$ref": "#/$defs/types/rate_with_bandwidth"
155                     },
156                     "loss": {
157                       "description": "Number of packets lost during reconfiguration, with the time that equals packet loss divided by packet rate.",
158                       "$ref": "#/$defs/types/packet_with_time"
159                     }
160                   },
161                   "required": [
162                     "type",
163                     "loss",
164                     "aggregate_rate"
165                   ]
166                 },
167                 {
168                   "description": "Result type HOSTSTACK case.",
169                   "additionalProperties": false,
170                   "properties": {
171                     "type": {
172                       "const": "hoststack"
173                     },
174                     "bandwidth": {
175                       "description": "Goodput measured in bits per second.",
176                       "$ref": "#/$defs/types/bandwidth"
177                     },
178                     "completed_requests": {
179                       "description": "Number of completed requests.",
180                       "$ref": "#/$defs/types/count_requests"
181                     },
182                     "failed_requests": {
183                       "description": "Number of failed requests.",
184                       "$ref": "#/$defs/types/count_requests"
185                     },
186                     "retransmits": {
187                       "description": "Number of retransmits.",
188                       "$ref": "#/$defs/types/count_packets"
189                     },
190                     "latency": {
191                       "description": "Value and unit of latency.",
192                       "$ref": "#/$defs/types/value_with_unit"
193                     },
194                     "duration": {
195                       "description": "The relative time difference (in seconds) between program start and end.",
196                       "$ref": "#/$defs/types/time_quantity"
197                     },
198                     "rate": {
199                       "description": "RPS or CPS rate, with corresponding unit, as reported by TG.",
200                       "$ref": "#/$defs/types/rate_without_bandwidth"
201                     }
202                   },
203                   "required": [
204                     "type",
205                     "bandwidth"
206                   ]
207                 }
208               ]
209             }
210           ]
211         },
212         "start_time": {
213           "description": "UTC date and time in RFC 3339 format, specifying calendar time just after test case started (at the start of test setup).",
214           "$ref": "#/$defs/types/date_time"
215         },
216         "tags": {
217           "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).",
218           "type": "array",
219           "items": {
220             "type": "string"
221           }
222         },
223         "test_documentation": {
224           "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.",
225           "type": "string"
226         },
227         "test_id": {
228           "description": "A derived quantity. 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.",
229           "type": "string",
230           "minLength": 3
231         },
232         "test_name_long": {
233           "description": "A derived quantity. 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.",
234           "type": "string",
235           "minLength": 3
236         },
237         "test_name_short": {
238           "description": "A derived quantity. 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.",
239           "type": "string",
240           "minLength": 3
241         },
242         "test_type": {
243           "description": "A derived quantity. 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.",
244           "type": "string",
245           "enum": [
246             "device",
247             "gso",
248             "hoststack",
249             "mrr",
250             "ndrpdr",
251             "reconf",
252             "soak",
253             "vsap"
254           ]
255         },
256         "tg_type": {
257           "description": "TG type used, e.g. TREX.",
258           "type": "string",
259           "minLength": 1
260         },
261         "tg_version": {
262           "description": "Version string appropriate to TG type used.",
263           "type": "string",
264           "minLength": 1
265         },
266         "version": {
267           "description": "CSIT model version (semver format) the exporting code adhered to.",
268           "type": "string",
269           "const": "1.3.0"
270         }
271       },
272       "required": [
273         "duration",
274         "dut_type",
275         "dut_version",
276         "end_time",
277         "hosts",
278         "telemetry",
279         "message",
280         "passed",
281         "result",
282         "start_time",
283         "tags",
284         "test_documentation",
285         "test_id",
286         "test_name_long",
287         "test_name_short",
288         "test_type",
289         "tg_type",
290         "tg_version",
291         "version"
292       ]
293     },
294     {
295       "description": "Subschema validating relation between status and message.",
296       "oneOf": [
297         {
298           "description": "Subschema for passing tests, message has to be empty.",
299           "type": "object",
300           "properties": {
301             "passed": {
302               "const": true
303             },
304             "message": {
305               "const": ""
306             }
307           }
308         },
309         {
310           "description": "Subschema for failing tests, mesage cannot be empty.",
311           "type": "object",
312           "properties": {
313             "passed": {
314               "const": false
315             },
316             "message": {
317               "minLength": 1
318             }
319           }
320         }
321       ]
322     }
323   ],
324   "$defs": {
325     "types": {
326       "nonnegative_number": {
327         "type": "number",
328         "minimum": 0
329       },
330       "positive_number": {
331         "type": "number",
332         "minimum": 1
333       },
334       "nonnegative_integer": {
335         "type": "integer",
336         "minimum": 0
337       },
338       "positive_integer": {
339         "type": "integer",
340         "minimum": 1
341       },
342       "date_time": {
343         "type": "string",
344         "format": "date-time"
345       },
346       "empty_array": {
347         "type": "array",
348         "maxItems": 0
349       },
350       "rate_unit": {
351         "description": "Packets per second (pps), connections per second (cps), requests per second (rps).",
352         "type": "string",
353         "enum": [
354           "pps",
355           "cps",
356           "rps"
357         ]
358       },
359       "bandwidth_unit": {
360         "description": "Unit of measurement for bandwidth values. Currently a constant, but later versions of model may allow more units.",
361         "enum": [
362           "bps"
363         ]
364       },
365       "count_packets": {
366         "description": "Type, for counting packets.",
367         "allOf": [
368           {
369             "$ref": "#/$defs/types/value_with_unit"
370           },
371           {
372             "properties": {
373               "value": {
374                 "description": "A number of packets of interest."
375               },
376               "unit": {
377                 "description": "Unit suitable for displaying packet counts.",
378                 "enum": [
379                   "packets"
380                 ]
381               }
382             }
383           }
384         ]
385       },
386       "count_requests": {
387         "description": "Type, for counting requests.",
388         "allOf": [
389           {
390             "$ref": "#/$defs/types/value_with_unit"
391           },
392           {
393             "properties": {
394               "value": {
395                 "description": "A number of requests of interest."
396               },
397               "unit": {
398                 "description": "Unit suitable for displaying request counts.",
399                 "enum": [
400                   "requests"
401                 ]
402               }
403             }
404           }
405         ]
406       },
407       "time_quantity": {
408         "description": "Reusable type, for various time quantites.",
409         "allOf": [
410           {
411             "$ref": "#/$defs/types/value_with_unit"
412           },
413           {
414             "properties": {
415               "value": {
416                 "description": "Unless specified otherwise, this is a duration between two events."
417               },
418               "unit": {
419                 "description": "Only seconds are the unit supported for time quantities.",
420                 "enum": [
421                   "s"
422                 ]
423               }
424             }
425           }
426         ]
427       },
428       "value_with_unit": {
429         "description": "Reusable composite type, value together with its unit of measurement.",
430         "type": "object",
431         "additionalProperties": false,
432         "properties": {
433           "value": {
434             "description": "Numeric value, context specified elsewhere. The only assumption is that value is not negative.",
435             "$ref": "#/$defs/types/nonnegative_number"
436           },
437           "unit": {
438             "description": "Unit of measurement for the value. Context and allowed values are specified elsewhere.",
439             "type": "string"
440           }
441         },
442         "required": [
443           "value",
444           "unit"
445         ]
446       },
447       "rate_without_bandwidth": {
448         "description": "Reusable type, for various rate quantites.",
449         "allOf": [
450           {
451             "$ref": "#/$defs/types/value_with_unit"
452           },
453           {
454             "properties": {
455               "value": {
456                 "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."
457               },
458               "unit": {
459                 "description": "A transaction rate unit the value is expressed in.",
460                 "$ref": "#/$defs/types/rate_unit"
461               }
462             }
463           }
464         ]
465       },
466       "bandwidth": {
467         "description": "Reusable type, for various bandwidth quantites.",
468         "allOf": [
469           {
470             "$ref": "#/$defs/types/value_with_unit"
471           },
472           {
473             "properties": {
474               "value": {
475                 "description": "Bandwidth value computed from the corresponding rate."
476               },
477               "unit": {
478                 "$ref": "#/$defs/types/bandwidth_unit"
479               }
480             }
481           }
482         ]
483       },
484       "rate_with_bandwidth": {
485         "description": "Reusable composite type, joining primary rate with optional derived bandwidth. Not all test types currently compute bandwidth, even if rate unit is pps.",
486         "type": "object",
487         "additionalProperties": false,
488         "properties": {
489           "rate": {
490             "$ref": "#/$defs/types/rate_without_bandwidth"
491           },
492           "bandwidth": {
493             "$ref": "#/$defs/types/bandwidth"
494           }
495         },
496         "required": [
497           "rate"
498         ]
499       },
500       "packet_with_time": {
501         "description": "Reusable composite type, joining packet count with the time quantity.",
502         "type": "object",
503         "additionalProperties": false,
504         "properties": {
505           "packet": {
506             "$ref": "#/$defs/types/count_packets"
507           },
508           "time": {
509             "$ref": "#/$defs/types/time_quantity"
510           }
511         },
512         "required": [
513           "packet",
514           "time"
515         ]
516       },
517       "value_list_with_unit_and_stats": {
518         "description": "Reusable composite type, multiple values together with their unit of measurement and derived statistics.",
519         "type": "object",
520         "additionalProperties": false,
521         "properties": {
522           "values": {
523             "description": "List of values of the same unit, useful for MRR.",
524             "type": "array",
525             "minItmes": 1,
526             "items": {
527               "description": "Numeric value, context specified elsewhere. The only assumption is that the value is nonnegative.",
528               "$ref": "#/$defs/types/nonnegative_number"
529             }
530           },
531           "avg": {
532             "description": "A derived quantity. It is the arithmetic average of the values list.",
533             "$ref": "#/$defs/types/nonnegative_number"
534           },
535           "stdev": {
536             "description": "A derived quantity. It is the standard deviation for the values list, as computed by jumpavg library.",
537             "$ref": "#/$defs/types/nonnegative_number"
538           },
539           "unit": {
540             "description": "Unit of measurement for the values. Context and allowed values are specified elsewhere.",
541             "type": "string"
542           }
543         },
544         "required": [
545           "values",
546           "avg",
547           "stdev",
548           "unit"
549         ]
550       },
551       "rate_list_without_bandwidth": {
552         "description": "Reusable composite type, multiple rate values.",
553         "allOf": [
554           {
555             "$ref": "#/$defs/types/value_list_with_unit_and_stats"
556           },
557           {
558             "properties": {
559               "values": {
560                 "items": {
561                   "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."
562                 }
563               },
564               "unit": {
565                 "$ref": "#/$defs/types/rate_unit"
566               }
567             }
568           }
569         ]
570       },
571       "bandwidth_list": {
572         "description": "Reusable composite type, multiple bandwidth values. This is a derived quantity.",
573         "allOf": [
574           {
575             "$ref": "#/$defs/types/value_list_with_unit_and_stats"
576           },
577           {
578             "properties": {
579               "values": {
580                 "items": {
581                   "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."
582                 }
583               },
584               "unit": {
585                 "$ref": "#/$defs/types/bandwidth_unit"
586               }
587             }
588           }
589         ]
590       },
591       "rate_list_with_bandwidth": {
592         "description": "Reusable composite type, joining primary rates with optional derived bandwidths (and stats). No test types currently computes the bandwidth part.",
593         "type": "object",
594         "additionalProperties": false,
595         "properties": {
596           "rate": {
597             "$ref": "#/$defs/types/rate_list_without_bandwidth"
598           },
599           "bandwidth": {
600             "$ref": "#/$defs/types/bandwidth_list"
601           }
602         },
603         "required": [
604           "rate"
605         ]
606       }
607     },
608     "macros": {
609       "lower_and_upper_rate": {
610         "type": "object",
611         "additionalProperties": false,
612         "properties": {
613           "lower": {
614             "description": "The lower bound (or min_rate) for the estimate of a particular searched value.",
615             "$ref": "#/$defs/types/rate_with_bandwidth"
616           },
617           "upper": {
618             "description": "The upper bound (or max_rate) for the estimate of a particular searched value.",
619             "$ref": "#/$defs/types/rate_with_bandwidth"
620           }
621         },
622         "required": [
623           "lower",
624           "upper"
625         ]
626       },
627       "latency_numbers": {
628         "type": "object",
629         "additionalProperties": false,
630         "properties": {
631           "min": {
632             "description": "Rounded minimal latency time measured in this trial. See unit property for the unit of measurement.",
633             "$ref": "#/$defs/types/nonnegative_integer"
634           },
635           "max": {
636             "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.",
637             "$ref": "#/$defs/types/positive_integer"
638           },
639           "avg": {
640             "description": "Rounded average latency time measured in this trial. See unit property for the unit of measurement.",
641             "$ref": "#/$defs/types/nonnegative_integer"
642           },
643           "hdrh": {
644             "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.",
645             "type": "string"
646           },
647           "unit": {
648             "description": "Unit of measurement for latency times. Currently a constant, but later versions of the model may allow more values.",
649             "type": "string",
650             "enum": [
651               "us"
652             ]
653           }
654         },
655         "required": [
656           "avg",
657           "hdrh",
658           "max",
659           "min",
660           "unit"
661         ]
662       },
663       "latency_for_loads": {
664         "type": "object",
665         "additionalProperties": false,
666         "properties": {
667           "pdr_0": {
668             "description": "Object related to latency measurement performed at minimal rate (currently 9000 pps per direction).",
669             "$ref": "#/$defs/macros/latency_numbers"
670           },
671           "pdr_10": {
672             "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).",
673             "$ref": "#/$defs/macros/latency_numbers"
674           },
675           "pdr_50": {
676             "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).",
677             "$ref": "#/$defs/macros/latency_numbers"
678           },
679           "pdr_90": {
680             "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).",
681             "$ref": "#/$defs/macros/latency_numbers"
682           }
683         },
684         "required": [
685           "pdr_0",
686           "pdr_10",
687           "pdr_50",
688           "pdr_90"
689         ]
690       }
691     }
692   }
693 }