blob: 3f4bde13f457973f495834d832aa36a1588dade1 [file] [log] [blame]
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02001== Configuration
2
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01003=== Schemas
Neels Hofmeyrb52df172017-05-14 20:09:35 +02004
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01005All configuration attributes in {app-name} are stored and provided as YAML
6files, which are handled internally mostly as sets of dictionaries, lists and
7scalars. Each of these configurations have a known format, which is called
8'schema'. Each provided configuration is validated against its 'schema' at parse
9time. Hence, 'schemas' can be seen as a namespace containing a structured tree
10of configuration attributes. Each attribute has a schema type assigned which
11constrains the type of value it can hold.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020012
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010013There are several well-known schemas used across {app-name}, and they are
14described in following sub-sections.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020015
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010016[[schema_resources]]
17==== Schema 'resources'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020018
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010019This schema defines all the attributes which can be assigned to
20a _resource_, and it is used to validate the <<resources_conf,resources.conf>>
21file. Hence, the <<resources_conf,resources.conf>> contains a list of elements
22for each resource type.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020023
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010024It is important to understand that the content in this schema refers to a list of
25resources for each resource class. Since a list is ordered by definition, it
26clearly identifies specific resources by order. This is important when applying
27filters or modifiers, since they are applied per-resource in the list. One can
28for instance apply attribute A to first resource of class C, while not applying
29it or applying another attribute B to second resources of the same class. As a
30result, complex forms can be used to filter and modify a list of resources
31required by a testsuite.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020032
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010033On the other hand, it's also important to note that lists for simple or scalar
34types are currently being treated as unordered sets, which mean combination of
35filters or modifiers apply differently. In the future, it may be possible to
36have both behaviors for scalar/simple types by using also the YAML 'set' type in
37{app-handle}.
Neels Hofmeyrb52df172017-05-14 20:09:35 +020038
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010039//TODO: update this list and use a table for each resource type
40These kinds of resources and their attributes are known:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020041
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +020042'ip_address'::
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020043 List of IP addresses to run osmo-nitb instances on. The main unit
44 typically has a limited number of such IP addresses configured, which
45 the connected BTS models can see on their network.
46 'addr':::
47 IPv4 address of the local interface.
48
49'bts'::
50 List of available BTS hardware.
51 'label':::
52 human readable label for your own reference
53 'type':::
54 which way to launch this BTS, one of
55 - 'osmo-bts-sysmo'
56 - 'osmo-bts-trx'
57 - 'osmo-bts-octphy'
58 - 'ipa-nanobts'
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010059 'ipa_unit_id':::
60 ip.access unit id to be used by the BTS, written into BTS and BSC config.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020061 'addr':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010062 Remote IP address of the BTS for BTS like sysmoBTS, and local IP address
63 to bind to for locally run BTS such as osmo-bts-trx.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020064 'band':::
65 GSM band that this BTS shoud use (*TODO*: allow multiple bands). One of:
66 - 'GSM-1800'
67 - 'GSM-1900'
68 - (*TODO*: more bands)
69 'trx_list':::
70 Specific TRX configurations for this BTS. There should be as many of
71 these as the BTS has TRXes. (*TODO*: a way to define >1 TRX without
72 special configuration for them.)
73 'hw_addr'::::
74 Hardware (MAC) address of the TRX in the form of '11:22:33:44:55:66',
75 only used for osmo-bts-octphy. (*TODO*: and nanobts??)
76 'net_device'::::
77 Local network device to reach the TRX's 'hw_addr' at, only used for
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010078 osmo-bts-octphy. Example: 'eth0'.
79 'nominal_power'::::
80 Nominal power to be used by the TRX.
81 'max_power_red'::::
82 Max power reduction to apply to the nominal power of the TRX.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020083'arfcn'::
84 List of ARFCNs to use for running BTSes, which defines the actual RF
85 frequency bands used.
86 'arfcn':::
87 ARFCN number, see e.g.
88 https://en.wikipedia.org/wiki/Absolute_radio-frequency_channel_number
89 (note that the resource type 'arfcn' contains an item trait also named
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010090 'arfcn').
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020091 'band':::
92 GSM band name to use this ARFCN for, same as for 'bts:band' above.
93
94'modem'::
95 List of modems reachable via ofono and information on the inserted SIM
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010096 card. (Note: the MSISDN is allocated dynamically in test scripts).
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020097 'label':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +010098 Human readable label for your own reference, which also appears in logs.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020099 'path':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100100 Ofono's path for this modem, like '/modemkind_99'.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200101 'imsi':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100102 IMSI of the inserted SIM card, like '"123456789012345"'.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200103 'ki':::
104 16 byte authentication/encryption KI of the inserted SIM card, in
105 hexadecimal notation (32 characters) like +
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100106 '"00112233445566778899aabbccddeeff"'.
107 'auth_algo':::
108 Authentication algorithm to be used with the SIM card. One of:
109 - 'none'
110 - 'xor'
111 - 'comp128v1'
112 'ciphers':::
113 List of ciphers that this modem supports, used to match
114 requirements in suites or scenarios. Any combination of:
115 - 'a5_0'
116 - 'a5_1'
117 - 'a5_2'
118 - 'a5_3'
119 - 'a5_4'
120 - 'a5_5'
121 - 'a5_6'
122 - 'a5_7'
123 'features':::
124 List of features that this modem supports, used to match requirements in
125 suites or scenarios. Any combination of:
126 - 'sms'
127 - 'gprs'
128 - 'voice'
129 - 'ussd'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200130
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100131[[schema_want]]
132==== Schema 'want'
133
134This schema is basically the same as the <<schema_resources,resources>> one, but
135with an extra 'times' attribute for each resource item. All 'times' attributes
136are expanded before matching. For example, if a 'suite.conf' requests two BTS,
137one may enforce that both BTS should be of type 'osmo-bts-sysmo' in these ways:
138
139----
140resources:
141 bts:
142 - type: osmo-bts-sysmo
143 - type: osmo-bts-sysmo
144----
145
146or alternatively,
147
148----
149resources:
150 bts:
151 - times: 2
152 type: osmo-bts-sysmo
153----
154
155[[schema_conf]]
156==== Schema 'conf'
157
158This schema is used by <<suite_conf,suite.conf>> and <<scenario_conf,scenario.conf>> files. It contains 3 main element sections:::
159[[schema_conf_sec_resources]]
160- Section 'resources': Contains a set of elements validated with <<schema_resources,resources>>
161 schema. In <<suite_conf,suite.conf>> it is used to construct the list of
162 requested resources. In <<scenario_conf,scenario.conf>>, it is used to inject
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100163 attributes to the initial <<suite_conf,suite.conf>> _resources_ section and
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100164 hence further restrain it.
165[[schema_conf_sec_modifiers]]
166- Section 'modifiers': Both in <<suite_conf,suite.conf>> and
167 <<scenario_conf,scenario.conf>>, values presented in here are injected into
168 the content of the <<schema_conf_sec_resources,resources section>> after
169 _resource_ allocation, hereby overwriting attributes passed to the object
170 class instance managing the specific _resource_ (matches by resource type and
171 list position). Since it is combined with the content of
172 <<schema_conf_sec_resources,resources section>>, it is clear that the
173 <<schema_resources,resources schema>> is used to validate this content.
174[[schema_conf_sec_config]]
175- Section 'config': Contains configuration attributes for {app-name} classes which are
176 not _resources_, and hence cannot be configured with <<schema_modifiers,modifiers>>.
177 They can overwrite values provided in the <<defaults_conf,defaults.conf>> file.
178
179//TODO: defaults.timeout should be change in code to be config.test_timeout or similar
180//TODO: 'config' should be split into its own schema and validate defaults.conf
181
182[[config_paths]]
183=== Config Paths
184
185The osmo-gsm-tester looks for configuration files in various standard
186directories in this order:
187
Pau Espin Pedrol06c82ae2020-05-07 18:15:53 +0200188- '.' (Current Working Directory)
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100189- '$HOME/.config/osmo-gsm-tester/'
190- '/usr/local/etc/osmo-gsm-tester/'
191- '/etc/osmo-gsm-tester/'
192
Pau Espin Pedrol06c82ae2020-05-07 18:15:53 +0200193The config location can also be set through '-c' command line argument, which
194then overrides the above locations.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100195
196The osmo-gsm-tester expects to find the following configuration files in a
197configuration directory:
198
199- <<paths_conf,paths.conf>>
200- <<resource_conf,resources.conf>>
201- <<default_suites_conf,default-suites.conf>> (optional)
202- <<defaults_conf,defaults.conf>> (optional)
203
204These are described in detail in the following sections.
205
206[[paths_conf]]
207==== 'paths.conf'
208
209The 'paths.conf' file defines where to store the global state (of reserved
210resources) and where to find suite and scenario definitions.
211
212Any relative paths found in a 'paths.conf' file are interpreted as relative to
213the directory of that 'paths.conf' file.
214
215There's not yet any well-known schema to validate this file contents since it
216has only 3 attributes.
217
218.Sample paths.conf file:
219----
220state_dir: '/var/tmp/osmo-gsm-tester/state'
221suites_dir: '/usr/local/src/osmo-gsm-tester/suites'
222scenarios_dir: './scenarios'
223----
224
225[[state_dir]]
226===== 'state_dir'
227
228It contains global or system-wide state for osmo-gsm-tester. In a typical state
229dir you can find the following files:
230
231'last_used_*.state'::
232 Contains stateful content spanning accross {app-name} instances and
233 runs. For instance, 'last used msisdn number.state' is automatically
234 (and atomically) increased every time osmo-gsm-tester needs to assign a
235 new subscriber in a test, ensuring tests get unique msisdn numbers.
236'reserved_resources.state'::
237 File containing a set of reserved resources by any number of
238 osmo-gsm-tester instances (aka pool of allocated resources). Each
239 osmo-gsm-tester instance is responsible to clear its resources from the
240 list once it is done using them and are no longer reserved.
241'lock'::
242 Lock file used to implement a mutual exclusion zone around any state
243 files in the 'state_dir', to prevent race conditions between different
244 {app-name} instances running in parallel.
245
246This way, several concurrent users of osmo-gsm-tester (ie. several
247osmo-gsm-tester processes running in parallel) can run without interfering with
248each other (e.g. using same ARFCN, same IP or same ofono modem path).
249
250If you would like to set up several separate configurations (not typical), note
251that the 'state_dir' is used to reserve resources, which only works when all
252configurations that share resources also use the same 'state_dir'. It's also
253important to notice that since resources are stored in YAML dictionary form, if
254same physical device is described differently in several
255<<resource_conf,resources.conf>> files (used by different {app-name} instances),
256resource allocation may not work as expected.
257
258[[suites_dir]]
259===== 'suites_dir'
260
261Suites contain a set of tests which are designed to be run together to test a
262set of features given a specific set of resources. As a result, resources are
263allocated per suite and not per test.
264
265Tests for a given suite are located in the form of '.py' python scripts in the
266same directory where the <<suite_conf,suite.conf>> lays.
267
268Tests in the same testsuite willing to use some shared code can do so by putting
269it eg. in '$suites_dir/$suitename/lib/testlib.py':
270----
271#!/usr/bin/env python3
272from osmo_gsm_tester.testenv import *
273
274def my_shared_code(foo):
275 return foo.bar()
276----
277
278and then in the test itself use it this way:
279----
280#!/usr/bin/env python3
281from osmo_gsm_tester.testenv import *
282
283import testlib
284suite.test_import_modules_register_for_cleanup(testlib)
285from testlib import my_shared_code
286
287bar = my_shared_code(foo)
288----
289
290.Sample 'suites_dir' directory tree:
291----
292suites_dir/
293|-- suiteA
294| |-- suite.conf
295| '-- testA.py
296|-- suiteB
297| |-- testB.py
298| |-- testC.py
299| |-- lib
300| | '-- testlib.py
301| '-- suite.conf
302----
303
304[[suite_conf]]
305===== 'suite.conf'
306
307This file content is parsed using the <<schema_want,Want>> schema.
308
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200309On the <<schema_want,resources>> section, it provides {app-name} with the base restrictions
310(later to be further filtered by <<scenario_conf,scenario>> files) to apply when
311allocating resources.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100312
313It can also override attributes for the allocated resources through the
314<<schema_want,modifiers>> section (to be further modified by
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200315<<scenario_conf,scenario>> files later on). Similarly it can do the same for
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100316general configuration options (no per-resource) through the
317<<schema_want,config>> section.
318
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200319The _schema_ section allows defining a suite's own schema used to validate
320parameters passed to it later on through <<scenario_conf,scenario>> files (See
321<<scenario_suite_params>>), and which can be retrieved by tests using the
322_tenv.config_suite_specific()_ and _tenv.config_test_specific()_ APIs. The first
323one will provide the whole dictionary under schema, while the later will return
324the dictionary immediatelly inside the former and matching the test name being
325run. For instance, if _tenv.config_test_specific()_ is called from test
326_a_suite_test_foo.py_, the method will return the contents under dictionary with
327key _a_suite_test_foo_.
328
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100329.Sample 'suite.conf' file:
330----
331resources:
332 ip_address:
333 - times: 9 # msc, bsc, hlr, stp, mgw*2, sgsn, ggsn, iperf3srv
334 bts:
335 - times: 1
336 modem:
337 - times: 2
338 features:
339 - gprs
340 - voice
341 - times: 2
342 features:
343 - gprs
344
345config:
346 bsc:
347 net:
348 codec_list:
349 - fr1
350
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200351schema:
352 some_suite_parameter: 'uint'
353 a_suite_test_foo:
354 one_test_parameter_for_test_foo: 'str'
355 another_test_parameter_for_test_foo: ['bool_str']
356
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100357defaults:
358 timeout: 50s
359----
360
361[[scenarios_dir]]
362===== 'scenarios_dir'
363
364This dir contains scenario configuration files.
365
366.Sample 'scenarios_dir' directory tree:
367----
368scenarios_dir/
369|-- scenarioA.conf
370'-- scenarioB.conf
371----
372
373[[scenario_conf]]
374===== 'scenario conf file'
375Scenarios define further constraints to serve the resource requests of a
376<<suite_conf,suite.conf>>, ie. to select specific resources from the general
377resource pool specified in <<resource_conf,resources.conf>>.
378
379If only one resource is specified in the scenario, then the resource allocator
380assumes the restriction is to be applied to the first resource and that remaining
381resources have no restrictions to be taken into consideration.
382
383To apply restrictions only on the second resource, the first element can be left
384emtpy, like:
385
386----
387resources:
388 bts:
389 - {}
390 - type: osmo-bts-sysmo
391----
392
393On the 'osmo_gsm_tester.py' command line and the
394<<default_suites_conf,default_suites.conf>>, any number of such scenario
395configurations can be combined in the form:
396
397----
398<suite_name>:<scenario>[+<scenario>[+...]]
399----
400
401e.g.
402
403----
404my_suite:sysmo+tch_f+amr
405----
406
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100407*_Parametrized scenario conf files_*:
408
409Furthermore, scenario '.conf' files can be parametrized. The concept is similar to that
410of systemd's Template Unit Files. That is, an scenario file can be written so
411that some values inside it can be passed at the time of referencing the
412scenario name. The idea behind its existence is to re-use the same
413scenario file for a set of attributes which are changed and that can have a lot
414of different values. For instance, if a scenario is aimed at setting or
415filtering some specific attribute holding an integer value, without parametrized
416scenarios then a separate file would be needed for each value the user wanted to use.
417
418A parametrized scenario file, similar to systemd Template Unit Files,
419contain the character '@' in their file name, ie follow the syntax below:
420----
421scenario-name@param1,param2,param3,[...],paramN.conf
422----
423
424Then, its content can be written this way:
425----
426$ cat $scenario_dir/my-parametrized-scenario@.conf
427resources:
428 enb:
429 - type: srsenb
430 rf_dev_type: ${param1}
431modifiers:
432 enb:
433 - num_prb: ${param2}
434----
435
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200436Finally, it can be referenced during {app-name} execution this way, for instance
437when running a suite named '4g':
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100438----
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200439- 4g:my-parametrized-scenario@uhd,6
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100440----
441This way {app-name} when parsing the scenarios and combining them with the suite will::
442. Find out it is parametrized (name contains '@').
443. Split the name
Pau Espin Pedrol6b8f5ae2020-04-07 18:51:57 +0200444 ('my-parametrized-scenario') from the parameter list (param1='uhd', param2='6')
Pau Espin Pedrol7dc22162020-03-11 19:57:45 +0100445. Attempt to match a '.conf' file fully matching name and parameters (hence
446 specific content can be set for specific values while still using parameters
447 for general values), and otherwise match only by name.
448. Generate the final
449 scenario content from the template available in the matched '.conf' file.
450
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200451[[scenario_suite_params]]
452*_Scenario to set suite/test parameters_*:
453
454First, the suite needs to define its schema in its <<suite_conf,suite.conf>>
455file. Check <<suite_conf>> on how to do so.
456
457For 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:
458----
459schema:
460 some_suite_parameter: 'uint'
461 a_suite_test_foo:
462 one_test_parameter_for_test_foo: 'str'
463 another_test_parameter_for_test_foo: ['bool_str']
464----
465
466One could define a parametrized scenario 'myparamscenario@.conf' like this:
467----
468config:
469 suite:
470 mysuite:
471 some_suite_parameter: ${param1}
472 a_suite_test_foo:
473 one_test_parameter_for_test_foo: ${param2}
474 another_test_parameter_for_test_foo: ['true', 'false', 'false', 'true']
475----
476
477And use it in {app-name} this way:
478----
479mysuite:myparamscenario@4,hello.conf
480----
481
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100482[[resources_conf]]
483==== 'resources.conf'
484
485//TODO: update this section
486The 'resources.conf' file defines which hardware is connected to the main unit,
487as well as which limited configuration items (like IP addresses or ARFCNs)
488should be used.
489
490A 'resources.conf' is validated by the <<schema_resources,resources schema>>.
491That means it is structured as a list of items for each resource type, where
492each item has one or more attributes -- for an example, see
493<<resources_conf_example>>.
494
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200495Side note: at first sight it might make sense to the reader to rather structure
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +0200496e.g. the 'ip_address' or 'arfcn' configuration as +
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200497'"arfcn: GSM-1800: [512, 514, ...]"', +
498but the more verbose format is chosen to stay consistent with the general
499structure of resource configurations, which the resource allocation algorithm
500uses to resolve required resources according to their traits. These
501configurations look cumbersome because they exhibit only one trait / a trait
502that is repeated numerous times. No special notation for these cases is
503available (yet).
504
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100505[[default_suites_conf]]
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100506==== 'default-suites.conf' (optional)
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200507
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100508The 'default-suites.conf' file contains a YAML list of 'suite:scenario+scenario+...'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200509combination strings as defined by the 'osmo-gsm-tester.py -s' commandline
510option. If invoking the 'osmo-gsm-tester.py' without any suite definitions, the
511'-s' arguments are taken from this file instead. Each of these suite + scenario
512combinations is run in sequence.
513
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100514A suite name must match the name of a directory in the
515<<suites_dir,suites_dir/>> as defined by <<paths_conf,paths.conf>>.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200516
517A scenario name must match the name of a configuration file in the
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100518<<scenarios_dir,scnearios_dir/>> as defined by <<paths_conf,paths.conf>>
519(optionally without the '.conf' suffix).
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200520
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100521.Sample 'default-suites.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200522----
523- sms:sysmo
524- voice:sysmo+tch_f
525- voice:sysmo+tch_h
526- voice:sysmo+dyn_ts
527- sms:trx
528- voice:trx+tch_f
529- voice:trx+tch_h
530- voice:trx+dyn_ts
531----
532
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100533==== 'defaults.conf' (optional)
534
535In {app-name} object instances requested by the test and created by the suite
536relate to a specific allocated resource. That's not always the case, and even if
537it the case the information stored in <<resources_conf,resources.conf>> for that
538resource may not contain tons of attributes which the object class needs to
539manage the resource.
540
541For this exact reason, the 'defaults.conf' file exist. It contains a set of
542default attributes and values (in YAML format) that object classes can use to
543fill in the missing gaps, or to provide values which can easily be changed or
544overwritten by <<suite_conf,suite.conf>> or <<scenario_conf,scenario.conf>>
545files through modifiers.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200546
547Each binary run by osmo-gsm-tester, e.g. 'osmo-nitb' or 'osmo-bts-sysmo',
548typically has a configuration file template that is populated with values for a
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100549trial run. Hence, a <<suite_conf,suite.conf>>, <<scenario_conf,scenario.conf>>
550or a <<resources_conf,resources.conf>> providing a similar setting always has
551precedence over the values given in a 'defaults.conf'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200552
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200553
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100554.Sample 'defaults.conf' file:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200555----
556nitb:
557 net:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100558 mcc: 901
559 mnc: 70
560 short_name: osmo-gsm-tester-nitb
561 long_name: osmo-gsm-tester-nitb
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200562 auth_policy: closed
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100563 encryption: a5_0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200564
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100565bsc:
566 net:
567 mcc: 901
568 mnc: 70
569 short_name: osmo-gsm-tester-msc
570 long_name: osmo-gsm-tester-msc
571 auth_policy: closed
572 encryption: a5_0
573 authentication: optional
574
575msc:
576 net:
577 mcc: 901
578 mnc: 70
579 short_name: osmo-gsm-tester-msc
580 long_name: osmo-gsm-tester-msc
581 auth_policy: closed
582 encryption: a5_0
583 authentication: optional
584
585bsc_bts:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200586 location_area_code: 23
587 base_station_id_code: 63
588 stream_id: 255
589 osmobsc_bts_type: sysmobts
590 trx_list:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100591 - nominal_power: 23
592 max_power_red: 0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200593 arfcn: 868
594 timeslot_list:
595 - phys_chan_config: CCCH+SDCCH4
596 - phys_chan_config: SDCCH8
597 - phys_chan_config: TCH/F_TCH/H_PDCH
598 - phys_chan_config: TCH/F_TCH/H_PDCH
599 - phys_chan_config: TCH/F_TCH/H_PDCH
600 - phys_chan_config: TCH/F_TCH/H_PDCH
601 - phys_chan_config: TCH/F_TCH/H_PDCH
602 - phys_chan_config: TCH/F_TCH/H_PDCH
603----
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100604
605=== Example Setup
606
607{app-name} comes with an example official setup which is the one used to run
608Osmocom's setup. There are actually two different available setups: a
609production one and an RnD one, used to develop {app-name} itself. These two set
610ups share mostly all configuration, main difference being the
611<<resources_conf,resources.conf>> file being used.
612
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100613All {app-name} related configuration for that environment is publicly available
614in 'osmo-gsm-tester.git' itself:
615
616- <<paths_conf,paths.conf>>: Available Available under 'example/', with its paths
617 already configured to take required bits from inside the git repository.
Pau Espin Pedrol69488f62020-04-07 16:40:41 +0200618- <<suite_dir,suites_dir>>: Available under 'example/suites/'
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100619- <<scenarios_dir,scenarios_dir>>: Available under 'example/scenarios/'
620- <<resource_conf,resources.conf>>: Available under 'example/' as
621 'resources.conf.prod' for Production setup and as 'resources.conf.rnd' for the
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100622 RnD setup. One must use a symbolic link to have it available as
623 'resources.conf'.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100624
625//TODO: resources.conf file path should be modifiable through paths.conf!
626
627==== Typical Invocations
628
629Each invocation of osmo-gsm-tester deploys a set of pre-compiled binaries for
630the Osmocom core network as well as for the Osmocom based BTS models. To create
631such a set of binaries, see <<trials>>.
632
633Examples for launching test trials:
634
Pau Espin Pedrolc1220e12020-03-16 19:50:40 +0100635- Run the default suites (see <<default_suites_conf,default_suites.conf>>) on a
636 given set of binaries:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +0100637
638----
639osmo-gsm-tester.py path/to/my-trial
640----
641
642- Run an explicit choice of 'suite:scenario' combinations:
643
644----
645osmo-gsm-tester.py path/to/my-trial -s sms:sysmo -s sms:trx -s sms:nanobts
646----
647
648- Run one 'suite:scenario1+scenario2' combination, setting log level to 'debug'
649 and enabling logging of full python tracebacks, and also only run just the
650 'mo_mt_sms.py' test from the suite, e.g. to investigate a test failure:
651
652----
653osmo-gsm-tester.py path/to/my-trial -s sms:sysmo+foobar -l dbg -T -t mo_mt
654----
655
656A test script may also be run step-by-step in a python debugger, see
657<<debugging>>.