C-Docs: New structure
[csit.git] / docs / content / overview / csit / suite_generation.md
1 ---
2 title: "Suite Generation"
3 weight: 5
4 ---
5
6 # Suite Generation
7
8 CSIT uses robot suite files to define tests. However, not all suite files
9 available for Jenkins jobs (or manually started bootstrap scripts) are present
10 in CSIT git repository. They are generated only when needed.
11
12 ## Autogen Library
13
14 There is a code generation layer implemented as Python library called "autogen",
15 called by various bash scripts.
16
17 It generates the full extent of CSIT suites, using the ones in git as templates.
18
19 ## Sources
20
21 The generated suites (and their contents) are affected by multiple information
22 sources, listed below.
23
24 ### Git Suites
25
26 The suites present in git repository act as templates for generating suites.
27 One of autogen design principles is that any template suite should also act
28 as a full suite (no placeholders).
29
30 In practice, autogen always re-creates the template suite with exactly
31 the same content, it is one of checks that autogen works correctly.
32
33 ### Regenerate Script
34
35 Not all suites present in CSIT git repository act as template for autogen.
36 The distinction is on per-directory level. Directories with
37 `regenerate_testcases.py` script usually consider all suites as templates
38 (unless possibly not included by the glob patten in the script).
39
40 The script also specifies minimal frame size, indirectly, by specifying protocol
41 (protocol "ip4" is the default, leading to 64B frame size).
42
43 ### Constants
44
45 Values in `Constants.py` are taken into consideration when generating suites.
46 The values are mostly related to different NIC models and NIC drivers.
47
48 ### Python Code
49
50 Python code in `resources/libraries/python/autogen` contains several other
51 information sources.
52
53 #### Testcase Templates
54
55 The test case part of template suite is ignored, test case lines
56 are created according to text templates in `Testcase.py` file.
57
58 #### Testcase Argument Lists
59
60 Each testcase template has different number of "arguments", e.g. values
61 to put into various placeholders. Different test types need different
62 lists of the argument values, the lists are in `regenerate_glob` method
63 in `Regenerator.py` file.
64
65 #### Iteration Over Values
66
67 Python code detects the test type (usually by substrings of suite file name),
68 then iterates over different quantities based on type.
69 For example, only ndrpdr suite templates generate other types (mrr and soak).
70
71 #### Hardcoded Exclusions
72
73 Some combinations of values are known not to work, so they are excluded.
74 Examples: Density tests for too much CPUs; IMIX for ASTF.
75
76 ## Non-Sources
77
78 Some information sources are available in CSIT repository,
79 but do not affect the suites generated by autogen.
80
81 ### Testbeds
82
83 Overall, no information visible in topology yaml files is taken into account
84 by autogen.
85
86 #### Testbed Architecture
87
88 Historically, suite files are agnostic to testbed architecture, e.g. ICX or ALT.
89
90 #### Testbed Size
91
92 Historically, 2-node and 3-node suites have diferent names, and while
93 most of the code is common, the differences are not always simple enough.
94 Autogen treat 2-node and 3-node suites as independent templates.
95
96 TRex suites are intended for a 1-node circuit of otherwise 2-node or 3-node
97 testbeds, so they support all 3 robot tags.
98 They are also detected and treated differently by autogen,
99 mainly because they need different testcase arguments (no CPU count).
100 Autogen does nothing specifically related to the fact they should run
101 only in testbeds/NICs with TG-TG line available.
102
103 #### Other Topology Info
104
105 Some bonding tests need two (parallel) links between DUTs. Autogen does not
106 care, as suites are agnostic. Robot tag marks the difference, but the link
107 presence is not explicitly checked.
108
109 ### Job specs
110
111 Information in job spec files depend on generated suites (not the other way).
112 Autogen should generate more suites, as job spec is limited by time budget.
113 More suites should be available for manually triggered verify jobs,
114 so autogen covers that.
115
116 ### Bootstrap Scripts
117
118 Historically, bootstrap scripts perform some logic,
119 perhaps adding exclusion options to Robot invocation
120 (e.g. skipping testbed+NIC combinations for tests that need parallel links).
121
122 Once again, the logic here relies on what autogen generates,
123 autogen does not look into bootstrap scripts.