blob: 118f056d492c876895baa3375f9e0daf17c641b1 [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 Pedrol7e0b2dd2020-03-10 11:46:39 +0100193----
194
195[[scenarios_dir]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200196==== 'scenarios_dir'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100197
198This dir contains scenario configuration files.
199
200.Sample 'scenarios_dir' directory tree:
201----
202scenarios_dir/
203|-- scenarioA.conf
204'-- scenarioB.conf
205----
206
207[[scenario_conf]]
208===== 'scenario conf file'
209Scenarios define further constraints to serve the resource requests of a
210<<suite_conf,suite.conf>>, ie. to select specific resources from the general
211resource pool specified in <<resource_conf,resources.conf>>.
212
213If only one resource is specified in the scenario, then the resource allocator
214assumes the restriction is to be applied to the first resource and that remaining
215resources have no restrictions to be taken into consideration.
216
217To apply restrictions only on the second resource, the first element can be left
218emtpy, like:
219
220----
221resources:
222 bts:
223 - {}
224 - type: osmo-bts-sysmo
225----
226
227On the 'osmo_gsm_tester.py' command line and the
228<<default_suites_conf,default_suites.conf>>, any number of such scenario
229configurations can be combined in the form:
230
231----
232<suite_name>:<scenario>[+<scenario>[+...]]
233----
234
235e.g.
236
237----
238my_suite:sysmo+tch_f+amr
239----
240
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100241*_Parametrized scenario conf files_*:
242
243Furthermore, scenario '.conf' files can be parametrized. The concept is similar to that
244of systemd's Template Unit Files. That is, an scenario file can be written so
245that some values inside it can be passed at the time of referencing the
246scenario name. The idea behind its existence is to re-use the same
247scenario file for a set of attributes which are changed and that can have a lot
248of different values. For instance, if a scenario is aimed at setting or
249filtering some specific attribute holding an integer value, without parametrized
250scenarios then a separate file would be needed for each value the user wanted to use.
251
252A parametrized scenario file, similar to systemd Template Unit Files,
253contain the character '@' in their file name, ie follow the syntax below:
254----
255scenario-name@param1,param2,param3,[...],paramN.conf
256----
257
258Then, its content can be written this way:
259----
260$ cat $scenario_dir/my-parametrized-scenario@.conf
261resources:
262 enb:
263 - type: srsenb
264 rf_dev_type: ${param1}
265modifiers:
266 enb:
267 - num_prb: ${param2}
268----
269
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200270Finally, it can be referenced during {app-name} execution this way, for instance
271when running a suite named '4g':
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100272----
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200273- 4g:my-parametrized-scenario@uhd,6
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100274----
275This way {app-name} when parsing the scenarios and combining them with the suite will::
276. Find out it is parametrized (name contains '@').
277. Split the name
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200278 ('my-parametrized-scenario') from the parameter list (param1='uhd', param2='6')
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100279. Attempt to match a '.conf' file fully matching name and parameters (hence
280 specific content can be set for specific values while still using parameters
281 for general values), and otherwise match only by name.
282. Generate the final
283 scenario content from the template available in the matched '.conf' file.
284
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200285[[scenario_suite_params]]
286*_Scenario to set suite/test parameters_*:
287
288First, the suite needs to define its schema in its <<suite_conf,suite.conf>>
289file. Check <<suite_conf>> on how to do so.
290
291For 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:
292----
293schema:
294 some_suite_parameter: 'uint'
295 a_suite_test_foo:
296 one_test_parameter_for_test_foo: 'str'
297 another_test_parameter_for_test_foo: ['bool_str']
298----
299
300One could define a parametrized scenario 'myparamscenario@.conf' like this:
301----
302config:
303 suite:
304 mysuite:
305 some_suite_parameter: ${param1}
306 a_suite_test_foo:
307 one_test_parameter_for_test_foo: ${param2}
308 another_test_parameter_for_test_foo: ['true', 'false', 'false', 'true']
309----
310
311And use it in {app-name} this way:
312----
313mysuite:myparamscenario@4,hello.conf
314----
315
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100316[[resources_conf]]
317==== 'resources.conf'
318
319//TODO: update this section
320The 'resources.conf' file defines which hardware is connected to the main unit,
321as well as which limited configuration items (like IP addresses or ARFCNs)
322should be used.
323
324A 'resources.conf' is validated by the <<schema_resources,resources schema>>.
325That means it is structured as a list of items for each resource type, where
Pau Espin Pedrolffa325e2020-06-10 17:49:55 +0200326each item has one or more attributes -- looking for an example, see {app-name}
327subdirectory _doc/examples_.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100328
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200329Side note: at first sight it might make sense to the reader to rather structure
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +0200330e.g. the 'ip_address' or 'arfcn' configuration as +
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200331'"arfcn: GSM-1800: [512, 514, ...]"', +
Pau Espin Pedrolffa325e2020-06-10 17:49:55 +0200332but the more verbose format is chosen in general to stay consistent with the
333general structure of resource configurations, which the resource allocation
334algorithm uses to resolve required resources according to their traits. These
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200335configurations look cumbersome because they exhibit only one trait / a trait
336that is repeated numerous times. No special notation for these cases is
337available (yet).
338
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100339[[default_suites_conf]]
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200340==== 'default-suites.conf'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200341
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100342The 'default-suites.conf' file contains a YAML list of 'suite:scenario+scenario+...'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200343combination strings as defined by the 'osmo-gsm-tester.py -s' commandline
344option. If invoking the 'osmo-gsm-tester.py' without any suite definitions, the
345'-s' arguments are taken from this file instead. Each of these suite + scenario
346combinations is run in sequence.
347
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100348A suite name must match the name of a directory in the
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200349<<suites_dir,suites_dir/>> as defined by <<main_conf,main.conf>>.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200350
351A scenario name must match the name of a configuration file in the
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200352<<scenarios_dir,scnearios_dir/>> as defined by <<main_conf,main.conf>>
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100353(optionally without the '.conf' suffix).
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200354
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100355.Sample 'default-suites.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200356----
357- sms:sysmo
358- voice:sysmo+tch_f
359- voice:sysmo+tch_h
360- voice:sysmo+dyn_ts
361- sms:trx
362- voice:trx+tch_f
363- voice:trx+tch_h
364- voice:trx+dyn_ts
365----
366
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200367==== 'defaults.conf'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100368
369In {app-name} object instances requested by the test and created by the suite
370relate to a specific allocated resource. That's not always the case, and even if
371it the case the information stored in <<resources_conf,resources.conf>> for that
372resource may not contain tons of attributes which the object class needs to
373manage the resource.
374
375For this exact reason, the 'defaults.conf' file exist. It contains a set of
376default attributes and values (in YAML format) that object classes can use to
377fill in the missing gaps, or to provide values which can easily be changed or
378overwritten by <<suite_conf,suite.conf>> or <<scenario_conf,scenario.conf>>
379files through modifiers.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200380
381Each binary run by osmo-gsm-tester, e.g. 'osmo-nitb' or 'osmo-bts-sysmo',
382typically has a configuration file template that is populated with values for a
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100383trial run. Hence, a <<suite_conf,suite.conf>>, <<scenario_conf,scenario.conf>>
384or a <<resources_conf,resources.conf>> providing a similar setting always has
385precedence over the values given in a 'defaults.conf'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200386
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200387
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100388.Sample 'defaults.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200389----
390nitb:
391 net:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100392 mcc: 901
393 mnc: 70
394 short_name: osmo-gsm-tester-nitb
395 long_name: osmo-gsm-tester-nitb
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200396 auth_policy: closed
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100397 encryption: a5_0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200398
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100399bsc:
400 net:
401 mcc: 901
402 mnc: 70
403 short_name: osmo-gsm-tester-msc
404 long_name: osmo-gsm-tester-msc
405 auth_policy: closed
406 encryption: a5_0
407 authentication: optional
408
409msc:
410 net:
411 mcc: 901
412 mnc: 70
413 short_name: osmo-gsm-tester-msc
414 long_name: osmo-gsm-tester-msc
415 auth_policy: closed
416 encryption: a5_0
417 authentication: optional
418
419bsc_bts:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200420 location_area_code: 23
421 base_station_id_code: 63
422 stream_id: 255
423 osmobsc_bts_type: sysmobts
424 trx_list:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100425 - nominal_power: 23
426 max_power_red: 0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200427 arfcn: 868
428 timeslot_list:
429 - phys_chan_config: CCCH+SDCCH4
430 - phys_chan_config: SDCCH8
431 - phys_chan_config: TCH/F_TCH/H_PDCH
432 - phys_chan_config: TCH/F_TCH/H_PDCH
433 - phys_chan_config: TCH/F_TCH/H_PDCH
434 - phys_chan_config: TCH/F_TCH/H_PDCH
435 - phys_chan_config: TCH/F_TCH/H_PDCH
436 - phys_chan_config: TCH/F_TCH/H_PDCH
437----
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100438
Pau Espin Pedrolfceb8e12020-05-12 13:04:00 +0200439=== Schemas
440
441All configuration attributes in {app-name} are stored and provided as YAML
442files, which are handled internally mostly as sets of dictionaries, lists and
443scalars. Each of these configurations have a known format (set of keys and
444values), which is called 'schema'. Each provided configuration is validated
445against its 'schema' at parse time. Hence, 'schemas' can be seen as a namespace
446containing a structured tree of configuration attributes. Each attribute has a
447schema type assigned which constrains the type of value it can hold.
448
449There are several well-known schemas used across {app-name}, and they are
450described in following sub-sections.
451
452[[schema_main_cfg]]
453==== Schema 'main config'
454
455This schema defines all the attributes available in {app-name} the main
456configuration file <<main_conf,main.conf>>, and it is used to validate it.
457
458[[schema_resources]]
459==== Schema 'resources'
460
461This schema defines all the attributes which can be assigned to
462a _resource_, and it is used to validate the <<resources_conf,resources.conf>>
463file. Hence, the <<resources_conf,resources.conf>> contains a list of elements
464for each resource type. This schema is also used and extended by the
465<<schema_want,'want' schema>>.
466
467It is important to understand that the content in this schema refers to a list of
468resources for each resource class. Since a list is ordered by definition, it
469clearly identifies specific resources by order. This is important when applying
470filters or modifiers, since they are applied per-resource in the list. One can
471for instance apply attribute A to first resource of class C, while not applying
472it or applying another attribute B to second resources of the same class. As a
473result, complex forms can be used to filter and modify a list of resources
474required by a testsuite.
475
476On the other hand, it's also important to note that lists for simple or scalar
477types are currently being treated as unordered sets, which mean combination of
478filters or modifiers apply differently. In the future, it may be possible to
479have both behaviors for scalar/simple types by using also the YAML 'set' type in
480{app-name}.
481
482//TODO: update this list and use a table for each resource type in its own object section
483////
484These kinds of resources and their attributes are known:
485
486'ip_address'::
487 List of IP addresses to run osmo-nitb instances on. The main unit
488 typically has a limited number of such IP addresses configured, which
489 the connected BTS models can see on their network.
490 'addr':::
491 IPv4 address of the local interface.
492
493'bts'::
494 List of available BTS hardware.
495 'label':::
496 human readable label for your own reference
497 'type':::
498 which way to launch this BTS, one of
499 - 'osmo-bts-sysmo'
500 - 'osmo-bts-trx'
501 - 'osmo-bts-octphy'
502 - 'ipa-nanobts'
503 'ipa_unit_id':::
504 ip.access unit id to be used by the BTS, written into BTS and BSC config.
505 'addr':::
506 Remote IP address of the BTS for BTS like sysmoBTS, and local IP address
507 to bind to for locally run BTS such as osmo-bts-trx.
508 'band':::
509 GSM band that this BTS shoud use (*TODO*: allow multiple bands). One of:
510 - 'GSM-1800'
511 - 'GSM-1900'
512 - (*TODO*: more bands)
513 'trx_list':::
514 Specific TRX configurations for this BTS. There should be as many of
515 these as the BTS has TRXes. (*TODO*: a way to define >1 TRX without
516 special configuration for them.)
517 'hw_addr'::::
518 Hardware (MAC) address of the TRX in the form of '11:22:33:44:55:66',
519 only used for osmo-bts-octphy. (*TODO*: and nanobts??)
520 'net_device'::::
521 Local network device to reach the TRX's 'hw_addr' at, only used for
522 osmo-bts-octphy. Example: 'eth0'.
523 'nominal_power'::::
524 Nominal power to be used by the TRX.
525 'max_power_red'::::
526 Max power reduction to apply to the nominal power of the TRX.
527'arfcn'::
528 List of ARFCNs to use for running BTSes, which defines the actual RF
529 frequency bands used.
530 'arfcn':::
531 ARFCN number, see e.g.
532 https://en.wikipedia.org/wiki/Absolute_radio-frequency_channel_number
533 (note that the resource type 'arfcn' contains an item trait also named
534 'arfcn').
535 'band':::
536 GSM band name to use this ARFCN for, same as for 'bts:band' above.
537
538'modem'::
539 List of modems reachable via ofono and information on the inserted SIM
540 card. (Note: the MSISDN is allocated dynamically in test scripts).
541 'label':::
542 Human readable label for your own reference, which also appears in logs.
543 'path':::
544 Ofono's path for this modem, like '/modemkind_99'.
545 'imsi':::
546 IMSI of the inserted SIM card, like '"123456789012345"'.
547 'ki':::
548 16 byte authentication/encryption KI of the inserted SIM card, in
549 hexadecimal notation (32 characters) like +
550 '"00112233445566778899aabbccddeeff"'.
551 'auth_algo':::
552 Authentication algorithm to be used with the SIM card. One of:
553 - 'none'
554 - 'xor'
555 - 'comp128v1'
556 'ciphers':::
557 List of ciphers that this modem supports, used to match
558 requirements in suites or scenarios. Any combination of:
559 - 'a5_0'
560 - 'a5_1'
561 - 'a5_2'
562 - 'a5_3'
563 - 'a5_4'
564 - 'a5_5'
565 - 'a5_6'
566 - 'a5_7'
567 'features':::
568 List of features that this modem supports, used to match requirements in
569 suites or scenarios. Any combination of:
570 - 'sms'
571 - 'gprs'
572 - 'voice'
573 - 'ussd'
574////
575
576[[schema_want]]
577==== Schema 'want'
578
579This schema is basically the same as the <<schema_resources,resources>> one, but
580with an extra 'times' attribute for each resource item. All 'times' attributes
581are expanded before matching. For example, if a 'suite.conf' requests two BTS,
582one may enforce that both BTS should be of type 'osmo-bts-sysmo' in these ways:
583
584----
585resources:
586 bts:
587 - type: osmo-bts-sysmo
588 - type: osmo-bts-sysmo
589----
590
591or alternatively,
592
593----
594resources:
595 bts:
596 - times: 2
597 type: osmo-bts-sysmo
598----
599
600[[schema_config]]
601==== Schema 'config'
602
603This schema defines all the attributes which can be used by object classes or
604tests during test execution. The main difference between this schema and the
605<<schema_resources,resources>> schema is that the former contains configuration
606to be applied globally for all objects being used, while the later applies
607attributes to a specific object in the list of allocated resources. This schema
608hence allows setting attributes for objects which are not allocated as resources
609and hence not directly accessible through scenarios, like a BSC or an iperf3
610client.
611
612This schema is built dynamically at runtime from content registered by:
613- object classes registering their own attributes
614- test suite registering their own attributes through <<suite_conf,suite.conf>>
615 and tests being able to later retrieve them through 'testenv' API.
616
617[[schema_all]]
618==== Schema 'all'
619
620This schema is basically an aggregated namespace for <<schema_want,want>> schema
621and <<schema_config,config>> schema, and is the one used by
622<<suite_conf,suite.conf>> and <<scenario_conf,scenario.conf>> files. It contains
623these main element sections:::
624
625[[schema_all_sec_resources]]
626- Section 'resources': Contains a set of elements validated with <<schema_want,want>>
627 schema. In <<suite_conf,suite.conf>> it is used to construct the list of
628 requested resources. In <<scenario_conf,scenario.conf>>, it is used to inject
629 attributes to the initial <<suite_conf,suite.conf>> _resources_ section and
630 hence further restrain it.
631[[schema_all_sec_modifiers]]
632- Section 'modifiers': Both in <<suite_conf,suite.conf>> and
633 <<scenario_conf,scenario.conf>>, values presented in here are injected into
634 the content of the <<schema_all_sec_resources,resources section>> after
635 _resource_ allocation, hereby overwriting attributes passed to the object
636 class instance managing the specific _resource_ (matches by resource type and
637 list position). Since it is combined with the content of
638 <<schema_all_sec_resources,resources section>>, it is clear that the
639 <<schema_want,want schema>> is used to validate this content.
640[[schema_all_sec_config]]
641- Section 'config': Contains configuration attributes for {app-name} object
642 classes which are not _resources_, and hence cannot be configured with
643 <<schema_all_sec_modifiers,modifiers>>. They can overwrite values provided in the
644 <<defaults_conf,defaults.conf>> file. Content in this section follows the
645 <<schema_config,config>> schema.
646
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100647=== Example Setup
648
649{app-name} comes with an example official setup which is the one used to run
650Osmocom's setup. There are actually two different available setups: a
651production one and an RnD one, used to develop {app-name} itself. These two set
652ups share mostly all configuration, main difference being the
653<<resources_conf,resources.conf>> file being used.
654
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100655All {app-name} related configuration for that environment is publicly available
656in 'osmo-gsm-tester.git' itself:
657
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200658- <<main_conf,main.conf>>: Available Available under 'sysmocom/', with its paths
659 already configured to take required bits from inside the git repository directory.
660- <<suite_dir,suites_dir>>: Available under 'sysmocom/suites/'
661- <<scenarios_dir,scenarios_dir>>: Available under 'sysmocom/scenarios/'
662- <<resource_conf,resources.conf>>: Available under 'sysmocom/' as
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100663 'resources.conf.prod' for Production setup and as 'resources.conf.rnd' for the
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100664 RnD setup. One must use a symbolic link to have it available as
665 'resources.conf'.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100666
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200667There are also small sample setups under the 'doc/examples/' directory to
668showcase how to set up different types of networks.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100669
670==== Typical Invocations
671
672Each invocation of osmo-gsm-tester deploys a set of pre-compiled binaries for
673the Osmocom core network as well as for the Osmocom based BTS models. To create
674such a set of binaries, see <<trials>>.
675
676Examples for launching test trials:
677
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100678- Run the default suites (see <<default_suites_conf,default_suites.conf>>) on a
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200679 given set of binaries from 'path/to/my-trial' with <<main_conf,main.conf>>
680 available under a standard path:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100681
682----
683osmo-gsm-tester.py path/to/my-trial
684----
685
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200686- Same as above, but run an explicit choice of 'suite:scenario' combinations:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100687
688----
689osmo-gsm-tester.py path/to/my-trial -s sms:sysmo -s sms:trx -s sms:nanobts
690----
691
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200692- Same as above, but run one 'suite:scenario1+scenario2' combination, setting
693 log level to 'debug' and enabling logging of full python tracebacks, and also
694 only run just the 'mo_mt_sms.py' test from the suite, e.g. to investigate a
695 test failure:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100696
697----
698osmo-gsm-tester.py path/to/my-trial -s sms:sysmo+foobar -l dbg -T -t mo_mt
699----
700
Pau Espin Pedrol6c6c0e82020-05-11 18:30:58 +0200701- Same as above, but tell {app-name} to read the 'main.conf' in specific
702 directory 'path/to/my/main.conf':
703
704----
705osmo-gsm-tester.py -c path/to/my/main.conf path/to/my-trial -s sms:sysmo+foobar -l dbg -T -t mo_mt
706----
707
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100708A test script may also be run step-by-step in a python debugger, see
709<<debugging>>.