blob: f4e08b3d8c79c411839c164188c88747f3cfaf83 [file] [log] [blame]
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02001== Configuration
2
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +02003[[config]]
4=== Configuration files and directories
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01005
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +02006Find in below sub-sections all user-defined files and directories used by
7{app-name} to run tests on a given setup.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01008
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +02009[[config_main]]
10==== 'main.conf'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010011
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020012The main configuration file is basically a placeholder for {app-name} to find
13paths to all other files and directories used to operate and run tests.
14
15{app-name} looks for the main configuration file in various standard paths in
16this order:
17
18- './main.conf' (Current Working Directory)
19- '$HOME/.config/osmo-gsm-tester/main.conf'
20- '/usr/local/etc/osmo-gsm-tester/main.conf'
21- '/etc/osmo-gsm-tester/main.conf'
22
23The config file location can also be set through '-c' command line argument, which
Pau Espin Pedrol06c82ae2020-05-07 18:15:53 +020024then overrides the above locations.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010025
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020026{app-name} expects to find the following configuration settings in 'main.conf':
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010027
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020028- 'state_dir': Path to <<state_dir,state_dir>> directory
Pau Espin Pedrole972c9c2020-05-12 15:06:55 +020029- 'trial_dir': Path to <<trials,trial>> directory to test against (overridden by cmdline argument)
Pau Espin Pedrol66ef9452020-05-25 13:26:41 +020030- 'suites_dir': List of paths to <<suites_dir,suites_dir>> directories.
31- 'scenarios_dir': List of paths to <<scenarios_dir,scenarios_dir>> directories (optional)
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020032- 'default_suites_conf_path': Path to <<default_suites_conf,default-suites.conf>> file (optional)
33- 'defaults_conf_path': Path to <<defaults_conf,defaults.conf>> file (optional)
34- 'resource_conf_path': Path to <<resource_conf,resources.conf>> file (optional)
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010035
Pau Espin Pedrol66ef9452020-05-25 13:26:41 +020036Configuration settings holding a list of paths, such as 'suites_dir' or
37'scenarios_dir', are used to look up for paths in regular list of order, meaning
38first paths in list take preference over last ones. As a result, if a suite
39named 'A' is found in several paths, the one on the first path in the list will
40be used.
41
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020042These are described in detail in the following sections. If no value is provided
43for a given setting, sane default paths are used: For 'state_dir',
44'/var/tmp/osmo-gsm-tester/state/' is used. All other files and directories are
45expected, by default, to be in the same directory as <<config_main,main.conf>>
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010046
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020047IMPORTANT: Relative paths provided in 'main.conf' are parsed as being relative
48to the directory of that 'main.conf' file itself, and not relative to the CWD
49of the {app-name} process parsing it.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010050
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020051.Sample main.conf file:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010052----
53state_dir: '/var/tmp/osmo-gsm-tester/state'
Pau Espin Pedrol66ef9452020-05-25 13:26:41 +020054suites_dir: [ '/usr/local/src/osmo-gsm-tester/suites' ]
55scenarios_dir: [ './scenarios' ]
Pau Espin Pedrole972c9c2020-05-12 15:06:55 +020056trial_dir: './trial'
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020057default_suites_conf_path: './default-suites.conf'
58defaults_conf_path: './defaults.conf'
59resource_conf_path: './resources.conf'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010060----
61
62[[state_dir]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020063==== 'state_dir'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010064
65It contains global or system-wide state for osmo-gsm-tester. In a typical state
66dir you can find the following files:
67
68'last_used_*.state'::
69 Contains stateful content spanning accross {app-name} instances and
70 runs. For instance, 'last used msisdn number.state' is automatically
71 (and atomically) increased every time osmo-gsm-tester needs to assign a
72 new subscriber in a test, ensuring tests get unique msisdn numbers.
73'reserved_resources.state'::
74 File containing a set of reserved resources by any number of
75 osmo-gsm-tester instances (aka pool of allocated resources). Each
76 osmo-gsm-tester instance is responsible to clear its resources from the
77 list once it is done using them and are no longer reserved.
78'lock'::
79 Lock file used to implement a mutual exclusion zone around any state
80 files in the 'state_dir', to prevent race conditions between different
81 {app-name} instances running in parallel.
82
83This way, several concurrent users of osmo-gsm-tester (ie. several
84osmo-gsm-tester processes running in parallel) can run without interfering with
85each other (e.g. using same ARFCN, same IP or same ofono modem path).
86
87If you would like to set up several separate configurations (not typical), note
88that the 'state_dir' is used to reserve resources, which only works when all
89configurations that share resources also use the same 'state_dir'. It's also
90important to notice that since resources are stored in YAML dictionary form, if
91same physical device is described differently in several
92<<resource_conf,resources.conf>> files (used by different {app-name} instances),
93resource allocation may not work as expected.
94
95[[suites_dir]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +020096==== 'suites_dir'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010097
98Suites contain a set of tests which are designed to be run together to test a
99set of features given a specific set of resources. As a result, resources are
100allocated per suite and not per test.
101
102Tests for a given suite are located in the form of '.py' python scripts in the
103same directory where the <<suite_conf,suite.conf>> lays.
104
105Tests in the same testsuite willing to use some shared code can do so by putting
106it eg. in '$suites_dir/$suitename/lib/testlib.py':
107----
108#!/usr/bin/env python3
109from osmo_gsm_tester.testenv import *
110
111def my_shared_code(foo):
112 return foo.bar()
113----
114
115and then in the test itself use it this way:
116----
117#!/usr/bin/env python3
118from osmo_gsm_tester.testenv import *
119
120import testlib
121suite.test_import_modules_register_for_cleanup(testlib)
122from testlib import my_shared_code
123
124bar = my_shared_code(foo)
125----
126
127.Sample 'suites_dir' directory tree:
128----
129suites_dir/
130|-- suiteA
131| |-- suite.conf
132| '-- testA.py
133|-- suiteB
134| |-- testB.py
135| |-- testC.py
136| |-- lib
137| | '-- testlib.py
138| '-- suite.conf
139----
140
141[[suite_conf]]
142===== 'suite.conf'
143
144This file content is parsed using the <<schema_want,Want>> schema.
145
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200146On the <<schema_want,resources>> section, it provides {app-name} with the base restrictions
147(later to be further filtered by <<scenario_conf,scenario>> files) to apply when
148allocating resources.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100149
150It can also override attributes for the allocated resources through the
151<<schema_want,modifiers>> section (to be further modified by
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200152<<scenario_conf,scenario>> files later on). Similarly it can do the same for
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100153general configuration options (no per-resource) through the
154<<schema_want,config>> section.
155
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200156The _schema_ section allows defining a suite's own schema used to validate
157parameters passed to it later on through <<scenario_conf,scenario>> files (See
158<<scenario_suite_params>>), and which can be retrieved by tests using the
159_tenv.config_suite_specific()_ and _tenv.config_test_specific()_ APIs. The first
160one will provide the whole dictionary under schema, while the later will return
161the dictionary immediatelly inside the former and matching the test name being
162run. For instance, if _tenv.config_test_specific()_ is called from test
163_a_suite_test_foo.py_, the method will return the contents under dictionary with
164key _a_suite_test_foo_.
165
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100166.Sample 'suite.conf' file:
167----
168resources:
169 ip_address:
170 - times: 9 # msc, bsc, hlr, stp, mgw*2, sgsn, ggsn, iperf3srv
171 bts:
172 - times: 1
173 modem:
174 - times: 2
175 features:
176 - gprs
177 - voice
178 - times: 2
179 features:
180 - gprs
181
182config:
183 bsc:
184 net:
185 codec_list:
186 - fr1
187
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200188schema:
189 some_suite_parameter: 'uint'
190 a_suite_test_foo:
191 one_test_parameter_for_test_foo: 'str'
192 another_test_parameter_for_test_foo: ['bool_str']
Pau Espin Pedrolc3cf6822020-06-12 17:54:55 +0200193
194config:
195 suite:
196 <suite_name>:
197 some_suite_parameter: 3
198 a_suite_test_foo:
199 one_test_parameter_for_test_foo: 'hello'
200 timeout: 30 <1>
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100201----
Pau Espin Pedrolc3cf6822020-06-12 17:54:55 +0200202<1> The per-test _timeout_ attribute is implicitly defined for all tests with
203type _duration_, and will trigger a timeout if test doesn't finish in time
204specified.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100205
206[[scenarios_dir]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200207==== 'scenarios_dir'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100208
209This dir contains scenario configuration files.
210
211.Sample 'scenarios_dir' directory tree:
212----
213scenarios_dir/
214|-- scenarioA.conf
215'-- scenarioB.conf
216----
217
218[[scenario_conf]]
219===== 'scenario conf file'
220Scenarios define further constraints to serve the resource requests of a
221<<suite_conf,suite.conf>>, ie. to select specific resources from the general
222resource pool specified in <<resource_conf,resources.conf>>.
223
224If only one resource is specified in the scenario, then the resource allocator
225assumes the restriction is to be applied to the first resource and that remaining
226resources have no restrictions to be taken into consideration.
227
228To apply restrictions only on the second resource, the first element can be left
229emtpy, like:
230
231----
232resources:
233 bts:
234 - {}
235 - type: osmo-bts-sysmo
236----
237
238On the 'osmo_gsm_tester.py' command line and the
239<<default_suites_conf,default_suites.conf>>, any number of such scenario
240configurations can be combined in the form:
241
242----
243<suite_name>:<scenario>[+<scenario>[+...]]
244----
245
246e.g.
247
248----
249my_suite:sysmo+tch_f+amr
250----
251
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100252*_Parametrized scenario conf files_*:
253
254Furthermore, scenario '.conf' files can be parametrized. The concept is similar to that
255of systemd's Template Unit Files. That is, an scenario file can be written so
256that some values inside it can be passed at the time of referencing the
257scenario name. The idea behind its existence is to re-use the same
258scenario file for a set of attributes which are changed and that can have a lot
259of different values. For instance, if a scenario is aimed at setting or
260filtering some specific attribute holding an integer value, without parametrized
261scenarios then a separate file would be needed for each value the user wanted to use.
262
263A parametrized scenario file, similar to systemd Template Unit Files,
264contain the character '@' in their file name, ie follow the syntax below:
265----
266scenario-name@param1,param2,param3,[...],paramN.conf
267----
268
269Then, its content can be written this way:
270----
271$ cat $scenario_dir/my-parametrized-scenario@.conf
272resources:
273 enb:
274 - type: srsenb
275 rf_dev_type: ${param1}
276modifiers:
277 enb:
278 - num_prb: ${param2}
279----
280
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200281Finally, it can be referenced during {app-name} execution this way, for instance
282when running a suite named '4g':
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100283----
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200284- 4g:my-parametrized-scenario@uhd,6
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100285----
286This way {app-name} when parsing the scenarios and combining them with the suite will::
287. Find out it is parametrized (name contains '@').
288. Split the name
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200289 ('my-parametrized-scenario') from the parameter list (param1='uhd', param2='6')
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100290. Attempt to match a '.conf' file fully matching name and parameters (hence
291 specific content can be set for specific values while still using parameters
292 for general values), and otherwise match only by name.
293. Generate the final
294 scenario content from the template available in the matched '.conf' file.
295
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200296[[scenario_suite_params]]
297*_Scenario to set suite/test parameters_*:
298
299First, the suite needs to define its schema in its <<suite_conf,suite.conf>>
300file. Check <<suite_conf>> on how to do so.
301
302For instance, for a suite named 'mysuite' containing a test 'a_suite_test_foo.py', and containing this schema in its <<suite_conf,suite.conf>> file:
303----
304schema:
305 some_suite_parameter: 'uint'
306 a_suite_test_foo:
307 one_test_parameter_for_test_foo: 'str'
308 another_test_parameter_for_test_foo: ['bool_str']
309----
310
311One could define a parametrized scenario 'myparamscenario@.conf' like this:
312----
313config:
314 suite:
315 mysuite:
316 some_suite_parameter: ${param1}
317 a_suite_test_foo:
318 one_test_parameter_for_test_foo: ${param2}
319 another_test_parameter_for_test_foo: ['true', 'false', 'false', 'true']
320----
321
322And use it in {app-name} this way:
323----
324mysuite:myparamscenario@4,hello.conf
325----
326
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100327[[resources_conf]]
328==== 'resources.conf'
329
330//TODO: update this section
331The 'resources.conf' file defines which hardware is connected to the main unit,
332as well as which limited configuration items (like IP addresses or ARFCNs)
333should be used.
334
335A 'resources.conf' is validated by the <<schema_resources,resources schema>>.
336That means it is structured as a list of items for each resource type, where
Pau Espin Pedrolffa325e2020-06-10 17:49:55 +0200337each item has one or more attributes -- looking for an example, see {app-name}
338subdirectory _doc/examples_.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100339
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200340Side note: at first sight it might make sense to the reader to rather structure
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +0200341e.g. the 'ip_address' or 'arfcn' configuration as +
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200342'"arfcn: GSM-1800: [512, 514, ...]"', +
Pau Espin Pedrolffa325e2020-06-10 17:49:55 +0200343but the more verbose format is chosen in general to stay consistent with the
344general structure of resource configurations, which the resource allocation
345algorithm uses to resolve required resources according to their traits. These
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200346configurations look cumbersome because they exhibit only one trait / a trait
347that is repeated numerous times. No special notation for these cases is
348available (yet).
349
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100350[[default_suites_conf]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200351==== 'default-suites.conf'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200352
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100353The 'default-suites.conf' file contains a YAML list of 'suite:scenario+scenario+...'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200354combination strings as defined by the 'osmo-gsm-tester.py -s' commandline
355option. If invoking the 'osmo-gsm-tester.py' without any suite definitions, the
356'-s' arguments are taken from this file instead. Each of these suite + scenario
357combinations is run in sequence.
358
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100359A suite name must match the name of a directory in the
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200360<<suites_dir,suites_dir/>> as defined by <<main_conf,main.conf>>.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200361
362A scenario name must match the name of a configuration file in the
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200363<<scenarios_dir,scnearios_dir/>> as defined by <<main_conf,main.conf>>
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100364(optionally without the '.conf' suffix).
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200365
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100366.Sample 'default-suites.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200367----
368- sms:sysmo
369- voice:sysmo+tch_f
370- voice:sysmo+tch_h
371- voice:sysmo+dyn_ts
372- sms:trx
373- voice:trx+tch_f
374- voice:trx+tch_h
375- voice:trx+dyn_ts
376----
377
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200378==== 'defaults.conf'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100379
380In {app-name} object instances requested by the test and created by the suite
381relate to a specific allocated resource. That's not always the case, and even if
382it the case the information stored in <<resources_conf,resources.conf>> for that
383resource may not contain tons of attributes which the object class needs to
384manage the resource.
385
386For this exact reason, the 'defaults.conf' file exist. It contains a set of
387default attributes and values (in YAML format) that object classes can use to
388fill in the missing gaps, or to provide values which can easily be changed or
389overwritten by <<suite_conf,suite.conf>> or <<scenario_conf,scenario.conf>>
390files through modifiers.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200391
392Each binary run by osmo-gsm-tester, e.g. 'osmo-nitb' or 'osmo-bts-sysmo',
393typically has a configuration file template that is populated with values for a
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100394trial run. Hence, a <<suite_conf,suite.conf>>, <<scenario_conf,scenario.conf>>
395or a <<resources_conf,resources.conf>> providing a similar setting always has
396precedence over the values given in a 'defaults.conf'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200397
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200398
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100399.Sample 'defaults.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200400----
401nitb:
402 net:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100403 mcc: 901
404 mnc: 70
405 short_name: osmo-gsm-tester-nitb
406 long_name: osmo-gsm-tester-nitb
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200407 auth_policy: closed
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100408 encryption: a5_0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200409
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100410bsc:
411 net:
412 mcc: 901
413 mnc: 70
414 short_name: osmo-gsm-tester-msc
415 long_name: osmo-gsm-tester-msc
416 auth_policy: closed
417 encryption: a5_0
418 authentication: optional
419
420msc:
421 net:
422 mcc: 901
423 mnc: 70
424 short_name: osmo-gsm-tester-msc
425 long_name: osmo-gsm-tester-msc
426 auth_policy: closed
427 encryption: a5_0
428 authentication: optional
429
430bsc_bts:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200431 location_area_code: 23
432 base_station_id_code: 63
433 stream_id: 255
434 osmobsc_bts_type: sysmobts
435 trx_list:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100436 - nominal_power: 23
437 max_power_red: 0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200438 arfcn: 868
439 timeslot_list:
440 - phys_chan_config: CCCH+SDCCH4
441 - phys_chan_config: SDCCH8
442 - phys_chan_config: TCH/F_TCH/H_PDCH
443 - phys_chan_config: TCH/F_TCH/H_PDCH
444 - phys_chan_config: TCH/F_TCH/H_PDCH
445 - phys_chan_config: TCH/F_TCH/H_PDCH
446 - phys_chan_config: TCH/F_TCH/H_PDCH
447 - phys_chan_config: TCH/F_TCH/H_PDCH
448----
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100449
Pau Espin Pedrolfceb8e12020-05-12 13:04:00 +0200450=== Schemas
451
452All configuration attributes in {app-name} are stored and provided as YAML
453files, which are handled internally mostly as sets of dictionaries, lists and
454scalars. Each of these configurations have a known format (set of keys and
455values), which is called 'schema'. Each provided configuration is validated
456against its 'schema' at parse time. Hence, 'schemas' can be seen as a namespace
457containing a structured tree of configuration attributes. Each attribute has a
458schema type assigned which constrains the type of value it can hold.
459
460There are several well-known schemas used across {app-name}, and they are
461described in following sub-sections.
462
463[[schema_main_cfg]]
464==== Schema 'main config'
465
466This schema defines all the attributes available in {app-name} the main
467configuration file <<main_conf,main.conf>>, and it is used to validate it.
468
469[[schema_resources]]
470==== Schema 'resources'
471
472This schema defines all the attributes which can be assigned to
473a _resource_, and it is used to validate the <<resources_conf,resources.conf>>
474file. Hence, the <<resources_conf,resources.conf>> contains a list of elements
475for each resource type. This schema is also used and extended by the
476<<schema_want,'want' schema>>.
477
478It is important to understand that the content in this schema refers to a list of
479resources for each resource class. Since a list is ordered by definition, it
480clearly identifies specific resources by order. This is important when applying
481filters or modifiers, since they are applied per-resource in the list. One can
482for instance apply attribute A to first resource of class C, while not applying
483it or applying another attribute B to second resources of the same class. As a
484result, complex forms can be used to filter and modify a list of resources
485required by a testsuite.
486
487On the other hand, it's also important to note that lists for simple or scalar
488types are currently being treated as unordered sets, which mean combination of
489filters or modifiers apply differently. In the future, it may be possible to
490have both behaviors for scalar/simple types by using also the YAML 'set' type in
491{app-name}.
492
493//TODO: update this list and use a table for each resource type in its own object section
494////
495These kinds of resources and their attributes are known:
496
497'ip_address'::
498 List of IP addresses to run osmo-nitb instances on. The main unit
499 typically has a limited number of such IP addresses configured, which
500 the connected BTS models can see on their network.
501 'addr':::
502 IPv4 address of the local interface.
503
504'bts'::
505 List of available BTS hardware.
506 'label':::
507 human readable label for your own reference
508 'type':::
509 which way to launch this BTS, one of
510 - 'osmo-bts-sysmo'
511 - 'osmo-bts-trx'
512 - 'osmo-bts-octphy'
513 - 'ipa-nanobts'
514 'ipa_unit_id':::
515 ip.access unit id to be used by the BTS, written into BTS and BSC config.
516 'addr':::
517 Remote IP address of the BTS for BTS like sysmoBTS, and local IP address
518 to bind to for locally run BTS such as osmo-bts-trx.
519 'band':::
520 GSM band that this BTS shoud use (*TODO*: allow multiple bands). One of:
521 - 'GSM-1800'
522 - 'GSM-1900'
523 - (*TODO*: more bands)
524 'trx_list':::
525 Specific TRX configurations for this BTS. There should be as many of
526 these as the BTS has TRXes. (*TODO*: a way to define >1 TRX without
527 special configuration for them.)
528 'hw_addr'::::
529 Hardware (MAC) address of the TRX in the form of '11:22:33:44:55:66',
530 only used for osmo-bts-octphy. (*TODO*: and nanobts??)
531 'net_device'::::
532 Local network device to reach the TRX's 'hw_addr' at, only used for
533 osmo-bts-octphy. Example: 'eth0'.
534 'nominal_power'::::
535 Nominal power to be used by the TRX.
536 'max_power_red'::::
537 Max power reduction to apply to the nominal power of the TRX.
538'arfcn'::
539 List of ARFCNs to use for running BTSes, which defines the actual RF
540 frequency bands used.
541 'arfcn':::
542 ARFCN number, see e.g.
543 https://en.wikipedia.org/wiki/Absolute_radio-frequency_channel_number
544 (note that the resource type 'arfcn' contains an item trait also named
545 'arfcn').
546 'band':::
547 GSM band name to use this ARFCN for, same as for 'bts:band' above.
548
549'modem'::
550 List of modems reachable via ofono and information on the inserted SIM
551 card. (Note: the MSISDN is allocated dynamically in test scripts).
552 'label':::
553 Human readable label for your own reference, which also appears in logs.
554 'path':::
555 Ofono's path for this modem, like '/modemkind_99'.
556 'imsi':::
557 IMSI of the inserted SIM card, like '"123456789012345"'.
558 'ki':::
559 16 byte authentication/encryption KI of the inserted SIM card, in
560 hexadecimal notation (32 characters) like +
561 '"00112233445566778899aabbccddeeff"'.
562 'auth_algo':::
563 Authentication algorithm to be used with the SIM card. One of:
564 - 'none'
565 - 'xor'
566 - 'comp128v1'
567 'ciphers':::
568 List of ciphers that this modem supports, used to match
569 requirements in suites or scenarios. Any combination of:
570 - 'a5_0'
571 - 'a5_1'
572 - 'a5_2'
573 - 'a5_3'
574 - 'a5_4'
575 - 'a5_5'
576 - 'a5_6'
577 - 'a5_7'
578 'features':::
579 List of features that this modem supports, used to match requirements in
580 suites or scenarios. Any combination of:
581 - 'sms'
582 - 'gprs'
583 - 'voice'
584 - 'ussd'
585////
586
587[[schema_want]]
588==== Schema 'want'
589
590This schema is basically the same as the <<schema_resources,resources>> one, but
591with an extra 'times' attribute for each resource item. All 'times' attributes
592are expanded before matching. For example, if a 'suite.conf' requests two BTS,
593one may enforce that both BTS should be of type 'osmo-bts-sysmo' in these ways:
594
595----
596resources:
597 bts:
598 - type: osmo-bts-sysmo
599 - type: osmo-bts-sysmo
600----
601
602or alternatively,
603
604----
605resources:
606 bts:
607 - times: 2
608 type: osmo-bts-sysmo
609----
610
611[[schema_config]]
612==== Schema 'config'
613
614This schema defines all the attributes which can be used by object classes or
615tests during test execution. The main difference between this schema and the
616<<schema_resources,resources>> schema is that the former contains configuration
617to be applied globally for all objects being used, while the later applies
618attributes to a specific object in the list of allocated resources. This schema
619hence allows setting attributes for objects which are not allocated as resources
620and hence not directly accessible through scenarios, like a BSC or an iperf3
621client.
622
623This schema is built dynamically at runtime from content registered by:
624- object classes registering their own attributes
625- test suite registering their own attributes through <<suite_conf,suite.conf>>
626 and tests being able to later retrieve them through 'testenv' API.
627
628[[schema_all]]
629==== Schema 'all'
630
631This schema is basically an aggregated namespace for <<schema_want,want>> schema
632and <<schema_config,config>> schema, and is the one used by
633<<suite_conf,suite.conf>> and <<scenario_conf,scenario.conf>> files. It contains
634these main element sections:::
635
636[[schema_all_sec_resources]]
637- Section 'resources': Contains a set of elements validated with <<schema_want,want>>
638 schema. In <<suite_conf,suite.conf>> it is used to construct the list of
639 requested resources. In <<scenario_conf,scenario.conf>>, it is used to inject
640 attributes to the initial <<suite_conf,suite.conf>> _resources_ section and
641 hence further restrain it.
642[[schema_all_sec_modifiers]]
643- Section 'modifiers': Both in <<suite_conf,suite.conf>> and
644 <<scenario_conf,scenario.conf>>, values presented in here are injected into
645 the content of the <<schema_all_sec_resources,resources section>> after
646 _resource_ allocation, hereby overwriting attributes passed to the object
647 class instance managing the specific _resource_ (matches by resource type and
648 list position). Since it is combined with the content of
649 <<schema_all_sec_resources,resources section>>, it is clear that the
650 <<schema_want,want schema>> is used to validate this content.
651[[schema_all_sec_config]]
652- Section 'config': Contains configuration attributes for {app-name} object
653 classes which are not _resources_, and hence cannot be configured with
654 <<schema_all_sec_modifiers,modifiers>>. They can overwrite values provided in the
655 <<defaults_conf,defaults.conf>> file. Content in this section follows the
656 <<schema_config,config>> schema.
657
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100658=== Example Setup
659
660{app-name} comes with an example official setup which is the one used to run
661Osmocom's setup. There are actually two different available setups: a
662production one and an RnD one, used to develop {app-name} itself. These two set
663ups share mostly all configuration, main difference being the
664<<resources_conf,resources.conf>> file being used.
665
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100666All {app-name} related configuration for that environment is publicly available
667in 'osmo-gsm-tester.git' itself:
668
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200669- <<main_conf,main.conf>>: Available Available under 'sysmocom/', with its paths
670 already configured to take required bits from inside the git repository directory.
671- <<suite_dir,suites_dir>>: Available under 'sysmocom/suites/'
672- <<scenarios_dir,scenarios_dir>>: Available under 'sysmocom/scenarios/'
673- <<resource_conf,resources.conf>>: Available under 'sysmocom/' as
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100674 'resources.conf.prod' for Production setup and as 'resources.conf.rnd' for the
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100675 RnD setup. One must use a symbolic link to have it available as
676 'resources.conf'.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100677
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200678There are also small sample setups under the 'doc/examples/' directory to
679showcase how to set up different types of networks.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100680
681==== Typical Invocations
682
683Each invocation of osmo-gsm-tester deploys a set of pre-compiled binaries for
684the Osmocom core network as well as for the Osmocom based BTS models. To create
685such a set of binaries, see <<trials>>.
686
687Examples for launching test trials:
688
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100689- Run the default suites (see <<default_suites_conf,default_suites.conf>>) on a
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200690 given set of binaries from 'path/to/my-trial' with <<main_conf,main.conf>>
691 available under a standard path:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100692
693----
694osmo-gsm-tester.py path/to/my-trial
695----
696
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200697- Same as above, but run an explicit choice of 'suite:scenario' combinations:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100698
699----
700osmo-gsm-tester.py path/to/my-trial -s sms:sysmo -s sms:trx -s sms:nanobts
701----
702
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200703- Same as above, but run one 'suite:scenario1+scenario2' combination, setting
704 log level to 'debug' and enabling logging of full python tracebacks, and also
705 only run just the 'mo_mt_sms.py' test from the suite, e.g. to investigate a
706 test failure:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100707
708----
709osmo-gsm-tester.py path/to/my-trial -s sms:sysmo+foobar -l dbg -T -t mo_mt
710----
711
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200712- Same as above, but tell {app-name} to read the 'main.conf' in specific
713 directory 'path/to/my/main.conf':
714
715----
716osmo-gsm-tester.py -c path/to/my/main.conf path/to/my-trial -s sms:sysmo+foobar -l dbg -T -t mo_mt
717----
718
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100719A test script may also be run step-by-step in a python debugger, see
720<<debugging>>.