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