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