blob: a56c4adff6e170c580687446dc7921a7f0cb24d3 [file] [log] [blame]
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02001== Configuration
2
Neels Hofmeyrb52df172017-05-14 20:09:35 +02003[[config_paths]]
4=== Config Paths
5
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02006The osmo-gsm-tester looks for configuration files in various standard
7directories in this order:
8
9- '$HOME/.config/osmo-gsm-tester/'
10- '/usr/local/etc/osmo-gsm-tester/'
11- '/etc/osmo-gsm-tester/'
12
13The config location can also be set by an environment variable
14'$OSMO_GSM_TESTER_CONF', which then overrides the above locations.
15
16The osmo-gsm-tester expects to find the following configuration files in a
17configuration directory:
18
19- 'paths.conf'
20- 'resources.conf'
21- 'default-suites.conf' (optional)
22- 'defaults.conf' (optional)
23
Neels Hofmeyrb52df172017-05-14 20:09:35 +020024These are described in detail in the following sections.
25
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020026=== Format: YAML, and its Drawbacks
27
28The general configuration format used is YAML. The stock python YAML parser
29does have several drawbacks: too many complex possibilities and alternative
30ways of formatting a configuration, but at the time of writing seems to be the
31only widely used configuration format that offers a simple and human readable
32formatting as well as nested structuring. It is recommended to use only the
33exact YAML subset seen in this manual in case the osmo-gsm-tester should move
34to a less bloated parser in the future.
35
36Careful: if a configuration item consists of digits and starts with a zero, you
37need to quote it, or it may be interpreted as an octal notation integer! Please
38avoid using the octal notation on purpose, it is not provided intentionally.
39
40[[paths_conf]]
41=== 'paths.conf'
42
43The 'paths.conf' file defines where to store the global state (of reserved
44resources) and where to find suite and scenario definitions.
45
46Any relative paths found in a 'paths.conf' file are interpreted as relative to
47the directory of that 'paths.conf' file.
48
49Example:
50
51----
Neels Hofmeyrb52df172017-05-14 20:09:35 +020052state_dir: '/var/tmp/osmo-gsm-tester/state'
53suites_dir: '/usr/local/src/osmo-gsm-tester/suites'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020054scenarios_dir: './scenarios'
55----
56
Neels Hofmeyrb52df172017-05-14 20:09:35 +020057If you would like to set up several separate configurations (not typical), note
58that the 'state_dir' is used to reserve resources, which only works when all
59configurations that share resources also use the same 'state_dir'.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020060
Pau Espin Pedrol6131f352017-11-02 14:45:46 +010061[[scenarios_dir]]
62==== 'scenarios_dir'
63
64This dir contains scenario configuration files.
65
66Scenarios define constraints to serve the resource requests of a 'suite.conf',
67to select specific resources from the general resource pool specified in 'resources.conf'.
68
69All 'times' attributes are expanded before matching. For example, if a 'suite.conf'
70requests two BTS, we may enforce that both BTS should be of type 'osmo-bts-sysmo' in
71these ways:
72
73----
74resources:
75 bts:
76 - type: osmo-bts-sysmo
77 - type: osmo-bts-sysmo
78----
79
80or alternatively,
81
82----
83resources:
84 bts:
85 - times: 2
86 type: osmo-bts-sysmo
87----
88
89If only one resource is specified in the scenario, then the resource allocator
90assumes the restriction is to be applied to the first resource and that remaining
91resources have no restrictions to be taken into consideration.
92
93To apply restrictions only on the second resource, the first element can be left
94emtpy, like:
95
96----
97resources:
98 bts:
99 - {}
100 - type: osmo-bts-sysmo
101----
102
103On the 'osmo_gsm_tester.py' command line and the 'default_suites.conf', any number of
104such scenario configurations can be combined in the form:
105
106----
107<suite_name>:<scenario>[+<scenario>[+...]]
108----
109
110e.g.
111
112----
113my_suite:sysmo+tch_f+amr
114----
115
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200116[[resources_conf]]
117=== 'resources.conf'
118
119The 'resources.conf' file defines which hardware is connected to the main unit,
120as well as which limited configuration items (like IP addresses or ARFCNs)
121should be used.
122
123These resources are allocated dynamically and are not configured explicitly:
124
125- MSISDN: phone numbers are dealt out to test scripts in sequence on request.
126
127A 'resources.conf' is structured as a list of items for each resource type,
128where each item has one or more settings -- for an example, see
129<<resources_conf_example>>.
130
131These kinds of resource are known:
132
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +0200133'ip_address'::
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200134 List of IP addresses to run osmo-nitb instances on. The main unit
135 typically has a limited number of such IP addresses configured, which
136 the connected BTS models can see on their network.
137 'addr':::
138 IPv4 address of the local interface.
139
140'bts'::
141 List of available BTS hardware.
142 'label':::
143 human readable label for your own reference
144 'type':::
145 which way to launch this BTS, one of
146 - 'osmo-bts-sysmo'
147 - 'osmo-bts-trx'
148 - 'osmo-bts-octphy'
149 - 'ipa-nanobts'
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100150 'ipa_unit_id':::
151 ip.access unit id to be used by the BTS, written into BTS and BSC config.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200152 'addr':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100153 Remote IP address of the BTS for BTS like sysmoBTS, and local IP address
154 to bind to for locally run BTS such as osmo-bts-trx.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200155 'band':::
156 GSM band that this BTS shoud use (*TODO*: allow multiple bands). One of:
157 - 'GSM-1800'
158 - 'GSM-1900'
159 - (*TODO*: more bands)
160 'trx_list':::
161 Specific TRX configurations for this BTS. There should be as many of
162 these as the BTS has TRXes. (*TODO*: a way to define >1 TRX without
163 special configuration for them.)
164 'hw_addr'::::
165 Hardware (MAC) address of the TRX in the form of '11:22:33:44:55:66',
166 only used for osmo-bts-octphy. (*TODO*: and nanobts??)
167 'net_device'::::
168 Local network device to reach the TRX's 'hw_addr' at, only used for
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100169 osmo-bts-octphy. Example: 'eth0'.
170 'nominal_power'::::
171 Nominal power to be used by the TRX.
172 'max_power_red'::::
173 Max power reduction to apply to the nominal power of the TRX.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200174'arfcn'::
175 List of ARFCNs to use for running BTSes, which defines the actual RF
176 frequency bands used.
177 'arfcn':::
178 ARFCN number, see e.g.
179 https://en.wikipedia.org/wiki/Absolute_radio-frequency_channel_number
180 (note that the resource type 'arfcn' contains an item trait also named
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100181 'arfcn').
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200182 'band':::
183 GSM band name to use this ARFCN for, same as for 'bts:band' above.
184
185'modem'::
186 List of modems reachable via ofono and information on the inserted SIM
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100187 card. (Note: the MSISDN is allocated dynamically in test scripts).
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200188 'label':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100189 Human readable label for your own reference, which also appears in logs.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200190 'path':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100191 Ofono's path for this modem, like '/modemkind_99'.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200192 'imsi':::
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100193 IMSI of the inserted SIM card, like '"123456789012345"'.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200194 'ki':::
195 16 byte authentication/encryption KI of the inserted SIM card, in
196 hexadecimal notation (32 characters) like +
Pau Espin Pedrol264829e2017-11-02 16:43:04 +0100197 '"00112233445566778899aabbccddeeff"'.
198 'auth_algo':::
199 Authentication algorithm to be used with the SIM card. One of:
200 - 'none'
201 - 'xor'
202 - 'comp128v1'
203 'ciphers':::
204 List of ciphers that this modem supports, used to match
205 requirements in suites or scenarios. Any combination of:
206 - 'a5_0'
207 - 'a5_1'
208 - 'a5_2'
209 - 'a5_3'
210 - 'a5_4'
211 - 'a5_5'
212 - 'a5_6'
213 - 'a5_7'
214 'features':::
215 List of features that this modem supports, used to match requirements in
216 suites or scenarios. Any combination of:
217 - 'sms'
218 - 'gprs'
219 - 'voice'
220 - 'ussd'
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200221
222Side note: at first sight it might make sense to the reader to rather structure
Neels Hofmeyr5d0330f2017-05-18 18:38:50 +0200223e.g. the 'ip_address' or 'arfcn' configuration as +
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200224'"arfcn: GSM-1800: [512, 514, ...]"', +
225but the more verbose format is chosen to stay consistent with the general
226structure of resource configurations, which the resource allocation algorithm
227uses to resolve required resources according to their traits. These
228configurations look cumbersome because they exhibit only one trait / a trait
229that is repeated numerous times. No special notation for these cases is
230available (yet).
231
232[[default_suites]]
233=== 'default-suites.conf' (optional)
234
235The 'default-suites.conf' file contains a list of 'suite:scenario+scenario+...'
236combination strings as defined by the 'osmo-gsm-tester.py -s' commandline
237option. If invoking the 'osmo-gsm-tester.py' without any suite definitions, the
238'-s' arguments are taken from this file instead. Each of these suite + scenario
239combinations is run in sequence.
240
241A suite name must match the name of a directory in the 'suites_dir' as defined
242by 'paths.conf'.
243
244A scenario name must match the name of a configuration file in the
245'scenarios_dir' as defined by 'paths.conf' (optionally without the '.conf'
246suffix).
247
248For 'paths.conf', see <<paths_conf>>.
249
250Example of a 'default-suites.conf' file:
251
252----
253- sms:sysmo
254- voice:sysmo+tch_f
255- voice:sysmo+tch_h
256- voice:sysmo+dyn_ts
257- sms:trx
258- voice:trx+tch_f
259- voice:trx+tch_h
260- voice:trx+dyn_ts
261----
262
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200263=== 'defaults.conf' (optional)
264
265Each binary run by osmo-gsm-tester, e.g. 'osmo-nitb' or 'osmo-bts-sysmo',
266typically has a configuration file template that is populated with values for a
267trial run.
268
269Some of these values are provided by the 'resources.conf' from the allocated
270resource(s), but not all values can be populated this way: some osmo-nitb
271configuration values like the network name, encryption algorithm or timeslot
272channel combinations are in fact not resources (only the nitb's interface
273address is). These additional settings may be provided by the scenario
274configurations, but in case the provided scenarios leave some values unset,
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100275they are taken from this 'defaults.conf'. (A 'scenario.conf' or a
276'resources.conf' providing a similar setting always has precedence over the
277values given in a 'defaults.conf').
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200278
279Example of a 'defaults.conf':
280
281----
282nitb:
283 net:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100284 mcc: 901
285 mnc: 70
286 short_name: osmo-gsm-tester-nitb
287 long_name: osmo-gsm-tester-nitb
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200288 auth_policy: closed
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100289 encryption: a5_0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200290
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100291bsc:
292 net:
293 mcc: 901
294 mnc: 70
295 short_name: osmo-gsm-tester-msc
296 long_name: osmo-gsm-tester-msc
297 auth_policy: closed
298 encryption: a5_0
299 authentication: optional
300
301msc:
302 net:
303 mcc: 901
304 mnc: 70
305 short_name: osmo-gsm-tester-msc
306 long_name: osmo-gsm-tester-msc
307 auth_policy: closed
308 encryption: a5_0
309 authentication: optional
310
311bsc_bts:
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200312 location_area_code: 23
313 base_station_id_code: 63
314 stream_id: 255
315 osmobsc_bts_type: sysmobts
316 trx_list:
Pau Espin Pedrol6fa61992017-11-02 16:57:22 +0100317 - nominal_power: 23
318 max_power_red: 0
Neels Hofmeyrc0827c42017-04-23 15:04:19 +0200319 arfcn: 868
320 timeslot_list:
321 - phys_chan_config: CCCH+SDCCH4
322 - phys_chan_config: SDCCH8
323 - phys_chan_config: TCH/F_TCH/H_PDCH
324 - phys_chan_config: TCH/F_TCH/H_PDCH
325 - phys_chan_config: TCH/F_TCH/H_PDCH
326 - phys_chan_config: TCH/F_TCH/H_PDCH
327 - phys_chan_config: TCH/F_TCH/H_PDCH
328 - phys_chan_config: TCH/F_TCH/H_PDCH
329----