blob: d19f9093140164b38fea4a48941058f38b7de309 [file] [log] [blame]
Neels Hofmeyrb52df172017-05-14 20:09:35 +02001== Installation on Main Unit
2
3The main unit is a general purpose computer that orchestrates the tests. It
4runs the core network components, controls the modems and so on. This can be
5anything from a dedicated production rack unit to your laptop at home.
6
Pau Espin Pedrolaccd74f2017-11-02 15:09:39 +01007This manual will assume that tests are run from a jenkins build slave, by a user
8named 'jenkins' that belong to group 'osmo-gsm-tester'. The user configuration
9for manual test runs and/or a different user name is identical, simply replace
10the user name or group.
Neels Hofmeyrb52df172017-05-14 20:09:35 +020011
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +010012=== Osmo-gsm-tester Dependencies
Neels Hofmeyrb52df172017-05-14 20:09:35 +020013
14On a Debian/Ubuntu based system, these commands install the packages needed to
15run the osmo-gsm-tester.py code, i.e. install these on your main unit:
16
17----
18apt-get install \
19 dbus \
20 tcpdump \
Neels Hofmeyr97110692017-06-03 15:20:28 +020021 sqlite3 \
Neels Hofmeyrb52df172017-05-14 20:09:35 +020022 python3 \
23 python3-yaml \
24 python3-mako \
25 python3-gi \
26 ofono \
Pau Espin Pedrol1ba1f5a2017-11-02 15:11:30 +010027 patchelf \
28 sudo \
29 libcap2-bin \
Neels Hofmeyrb52df172017-05-14 20:09:35 +020030 python3-pip
31pip3 install pydbus
Pau Espin Pedrol8d72cd62017-06-14 16:02:34 +020032pip3 install git+git://github.com/podshumok/python-smpplib.git
Neels Hofmeyrb52df172017-05-14 20:09:35 +020033----
34
35IMPORTANT: ofono may need to be installed from source to contain the most
Neels Hofmeyr7b8dbd82017-05-15 15:28:34 +020036recent fixes needed to operate your modems. This depends on the modem hardware
Neels Hofmeyrb52df172017-05-14 20:09:35 +020037used and the tests run. Please see <<hardware_modems>>.
38
39To run osmo-bts-trx with a USRP attached, you may need to install a UHD driver.
40Please refer to http://osmocom.org/projects/osmotrx/wiki/OsmoTRX#UHD for
41details; the following is an example for the B200 family USRP devices:
42
43----
44apt-get install libuhd-dev uhd-host
45/usr/lib/uhd/utils/uhd_images_downloader.py
46----
47
48[[jenkins_deps]]
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +010049==== Osmocom Build Dependencies
Neels Hofmeyrb52df172017-05-14 20:09:35 +020050
51Each of the jenkins builds requires individual dependencies. This is generally
52the same as for building the software outside of osmo-gsm-tester and will not
53be detailed here. For the Osmocom projects, refer to
54http://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source . Be
55aware of specific requirements for BTS hardware: for example, the
56osmo-bts-sysmo build needs the sysmoBTS SDK installed on the build slave, which
57should match the installed sysmoBTS firmware.
58
59
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +010060[[configure_jenkins_slave]]
61=== Jenkins Build and Run Slave
Neels Hofmeyrb52df172017-05-14 20:09:35 +020062
63==== Create 'jenkins' User on Main Unit
64
65On the main unit, create a jenkins user:
66
67----
68useradd -m jenkins
69----
70
Neels Hofmeyr3f596ed2017-07-14 00:04:40 +020071==== Install Java on Main Unit
72
73To be able to launch the Jenkins build slave, a Java RE must be available on
74the main unit. For example:
75
76----
77apt-get install default-jdk
78----
79
Neels Hofmeyrb52df172017-05-14 20:09:35 +020080==== Allow SSH Access from Jenkins Master
81
82Create an SSH keypair to be used for login on the osmo-gsm-tester. This may be
83entered on the jenkins web UI; alternatively, use the jenkins server's shell:
84
85Login on the main jenkins server shell and create an SSH keypair, for example:
86
87----
88# su jenkins
Neels Hofmeyr3f596ed2017-07-14 00:04:40 +020089$ mkdir -p /usr/local/jenkins/keys
Neels Hofmeyrb52df172017-05-14 20:09:35 +020090$ ssh-keygen
91Generating public/private rsa key pair.
92Enter file in which to save the key (/home/jenkins/.ssh/id_rsa): /usr/local/jenkins/keys/osmo-gsm-tester-rnd
93Enter passphrase (empty for no passphrase): <enter a passphrase>
94Enter same passphrase again: <enter a passphrase>
95Your identification has been saved in /usr/local/jenkins/keys/osmo-gsm-tester-rnd
96Your public key has been saved in /usr/local/jenkins/keys/osmo-gsm-tester-rnd.pub.
97The key fingerprint is:
98...
99----
100
101Copy the public key to the main unit, e.g. copy-paste:
102
103----
104cat /usr/local/jenkins/keys/osmo-gsm-tester-rnd.pub
105# copy this public key
106----
107
108On the main unit:
109
110----
111mkdir ~jenkins/.ssh
112cat > ~jenkins/.ssh/authorized_keys
113# paste above public key and hit Ctrl-D
114chown -R jenkins: ~jenkins/.ssh
115----
116
117Make sure that the user running the jenkins master accepts the main unit's host
118identification. There must be an actual RSA host key available in the
119known_hosts file for the jenkins master to be able to log in. Simply calling
120ssh and accepting the host key as usual is not enough. Jenkins may continue to
121say "Host key verification failed".
122
123To place an RSA host key in the jenkins' known_hosts file, you may do:
124
125On the Jenkins master:
126
127----
128main_unit_ip=10.9.8.7
129ssh-keyscan -H $main_unit_ip >> ~jenkins/.ssh/known_hosts
130chown jenkins: ~jenkins/.ssh/known_hosts
131----
132
133Verify that the jenkins user on the Jenkins master has SSH access to the main
134unit:
135
136----
137su jenkins
138main_unit_ip=10.9.8.7
Neels Hofmeyr3f596ed2017-07-14 00:04:40 +0200139ssh -i /usr/local/jenkins/keys/osmo-gsm-tester-rnd jenkins@$main_unit_ip
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200140exit
141----
142
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +0100143[[install_add_jenkins_slave]]
144==== Add Jenkins Slave
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200145
146In the jenkins web UI, add a new build slave for the osmo-gsm-tester:
147
148* 'Manage Jenkins'
149** 'Manage Nodes'
150*** 'New Node'
151**** Enter a node name, e.g. "osmo-gsm-tester-1" +
152 (the "-1" is just some identification in case you'd like to add another
153 setup later).
154**** 'Permanent Agent'
155
156Configure the node as:
157
158* '# of executors': 1
159* 'Remote root directory': "/home/jenkins"
160* 'Labels': "osmo-gsm-tester" +
161 (This is a general label common to all osmo-gsm-tester build slaves you may set up in the future.)
162* 'Usage': 'Only build jobs with label expressions matching this node'
163* 'Launch method': 'Launch slave agents via SSH'
164** 'Host': your main unit's IP address
165** 'Credentials': choose 'Add' / 'Jenkins'
166*** 'Domain': 'Global credentials (unrestricted)'
167*** 'Kind': 'SSH Username with private key'
168*** 'Scope': 'Global'
169*** 'Username': "jenkins" +
170 (as created on the main unit above)
171*** 'Private Key': 'From a file on Jenkins master'
172**** 'File': "/usr/local/jenkins/keys/osmo-gsm-tester-rnd"
173*** 'Passphrase': enter same passphrase as above
174*** 'ID': "osmo-gsm-tester-1"
175*** 'Name': "jenkins for SSH to osmo-gsm-tester-1"
176
177The build slave should be able to start now.
178
179
180==== Add Build Jobs
181
182There are various jenkins-build-* scripts in osmo-gsm-tester/contrib/, which
183can be called as jenkins build jobs to build and bundle binaries as artifacts,
184to be run on the osmo-gsm-tester main unit and/or BTS hardware.
185
186Be aware of the dependencies, as hinted at in <<jenkins_deps>>.
187
188While the various binaries could technically be built on the osmo-gsm-tester
189main unit, it is recommended to use a separate build slave, to take load off
190of the main unit.
191
192On your jenkins master, set up build jobs to call these scripts -- typically
193one build job per script. Look in contrib/ and create one build job for each of
194the BTS types you would like to test, as well as one for the 'build-osmo-nitb'.
195
196These are generic steps to configure a jenkins build
197job for each of these build scripts, by example of the
198jenkins-build-osmo-nitb.sh script; all that differs to the other scripts is the
199"osmo-nitb" part:
200
201* 'Project name': "osmo-gsm-tester_build-osmo-nitb" +
202 (Replace 'osmo-nitb' according to which build script this is for)
203* 'Discard old builds' +
204 Configure this to taste, for example:
205** 'Max # of build to keep': "20"
206* 'Restrict where this project can be run': Choose a build slave label that
207 matches the main unit's architecture and distribution, typically a Debian
208 system, e.g.: "linux_amd64_debian8"
209* 'Source Code Management':
210** 'Git'
211*** 'Repository URL': "git://git.osmocom.org/osmo-gsm-tester"
212*** 'Branch Specifier': "*/master"
213*** 'Additional Behaviors'
214**** 'Check out to a sub-directory': "osmo-gsm-tester"
215* 'Build Triggers' +
216 The decision on when to build is complex. Here are some examples:
217** Once per day: +
218 'Build periodically': "H H * * *"
219** For the Osmocom project, the purpose is to verify our software changes.
220 Hence we would like to test every time our code has changed:
221*** We could add various git repositories to watch, and enable 'Poll SCM'.
222*** On jenkins.osmocom.org, we have various jobs that build the master branches
223 of their respective git repositories when a new change was merged. Here, we
224 can thus trigger e.g. an osmo-nitb build for osmo-gsm-tester everytime the
225 master build has run: +
226 'Build after other projects are built': "OpenBSC"
227*** Note that most of the Osmocom projects also need to be re-tested when their
228 dependencies like libosmo* have changed. Triggering on all those changes
229 typically causes more jenkins runs than necessary: for example, it rebuilds
230 once per each dependency that has rebuilt due to one libosmocore change.
231 There is so far no trivial way known to avoid this. It is indeed safest to
232 rebuild more often.
233* 'Build'
234** 'Execute Shell'
235+
236----
237#!/bin/sh
238set -e -x
239./osmo-gsm-tester/contrib/jenkins-build-osmo-nitb.sh
240----
241+
242(Replace 'osmo-nitb' according to which build script this is for)
243
244* 'Post-build Actions'
245** 'Archive the artifacts': "*.tgz, *.md5" +
246 (This step is important to be able to use the built binaries in the run job
247 below.)
248
249
250TIP: When you've created one build job, it is convenient to create further
251build jobs by copying the first and, e.g., simply replacing all "osmo-nitb"
252with "osmo-bts-trx".
253
254==== Add Run Job
255
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +0100256This is the jenkins job that runs the tests on the GSM hardware:
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200257
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +0100258* It sources the artifacts from jenkins' build jobs.
259* It runs on the osmo-gsm-tester main unit.
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200260
261Here is the configuration for the run job:
262
263* 'Project name': "osmo-gsm-tester_run"
264* 'Discard old builds' +
265 Configure this to taste, for example:
266** 'Max # of build to keep': "20"
267* 'Restrict where this project can be run': "osmo-gsm-tester" +
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +0100268 (to match the 'Label' configured in <<install_add_jenkins_slave>>).
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200269* 'Source Code Management':
270** 'Git'
271*** 'Repository URL': "git://git.osmocom.org/osmo-gsm-tester"
272*** 'Branch Specifier': "*/master"
273*** 'Additional Behaviors'
274**** 'Check out to a sub-directory': "osmo-gsm-tester"
275**** 'Clean before checkout'
276* 'Build Triggers' +
277 The decision on when to build is complex. For this run job, it is suggested
278 to rebuild:
279** after each of above build jobs that produced new artifacts: +
280 'Build after other projects are built': "osmo-gsm-tester_build-osmo-nitb,
281 osmo-gsm-tester_build-osmo-bts-sysmo, osmo-gsm-tester_build-osmo-bts-trx" +
282 (Add each build job name you configured above)
283** as well as once per day: +
284 'Build periodically': "H H * * *"
285** and, in addition, whenever the osmo-gsm-tester scripts have been modified: +
286 'Poll SCM': "H/5 * * * *" +
287 (i.e. look every five minutes whether the upstream git has changed)
288* 'Build'
289** Copy artifacts from each build job you have set up:
290*** 'Copy artifacts from another project'
291**** 'Project name': "osmo-gsm-tester_build-osmo-nitb"
292**** 'Which build': 'Latest successful build'
293**** enable 'Stable build only'
294**** 'Artifacts to copy': "*.tgz, *.md5"
295*** Add a separate similar 'Copy artifacts...' section for each build job you
296 have set up.
297** 'Execute Shell'
298+
299----
300#!/bin/sh
301set -e -x
302
303# debug: provoke a failure
304#export OSMO_GSM_TESTER_OPTS="-s debug -t fail"
305
306PATH="$PWD/osmo-gsm-tester/src:$PATH" \
307 ./osmo-gsm-tester/contrib/jenkins-run.sh
308----
309+
310Details:
311
312*** The 'jenkins-run.sh' script assumes to find the 'osmo-gsm-tester.py' in the
313 '$PATH'. To use the most recent osmo-gsm-tester code here, we direct
314 '$PATH' to the actual workspace checkout. This could also run from a sytem
315 wide install, in which case you could omit the explicit PATH to
316 "$PWD/osmo-gsm-tester/src".
317*** This assumes that there are configuration files for osmo-gsm-tester placed
318 on the system (see <<config_paths>>).
319*** If you'd like to check the behavior of test failures, you can uncomment the
320 line below "# debug" to produce a build failure on every run. Note that
321 this test typically produces a quite empty run result, since it launches no
322 NITB nor BTS.
323* 'Post-build Actions'
324** 'Archive the artifacts'
Neels Hofmeyr8d8a1362017-06-18 02:31:38 +0200325*** 'Files to archive': "*-run.tgz, *-bin.tgz" +
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200326 This stores the complete test report with config files, logs, stdout/stderr
Neels Hofmeyr8d8a1362017-06-18 02:31:38 +0200327 output, pcaps as well as the binaries used for the test run in artifacts.
328 This allows analysis of older builds, instead of only the most recent build
329 (which cleans up the jenkins workspace every time). The 'trial-N-run.tgz'
330 and 'trial-N-bin.tgz' archives are produced by the 'jenkins-run.sh' script,
331 both for successful and failing runs.
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200332
333=== Install osmo-gsm-tester on Main Unit
334
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +0100335This assumes you have already created the jenkins user (see <<configure_jenkins_slave>>).
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200336
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200337==== User Permissions
338
339On the main unit, create a group for all users that should be allowed to use
340the osmo-gsm-tester, and add users (here 'jenkins') to this group.
341
342----
343groupadd osmo-gsm-tester
344gpasswd -a jenkins osmo-gsm-tester
345----
346
347NOTE: you may also need to add users to the 'usrp' group, see
348<<user_config_uhd>>.
349
350A user added to a group needs to re-login for the group permissions to take
351effect.
352
353This group needs the following permissions:
354
355===== Paths
356
357Assuming that you are using the example config, prepare a system wide state
358location in '/var/tmp':
359
360----
361mkdir -p /var/tmp/osmo-gsm-tester/state
362chown -R :osmo-gsm-tester /var/tmp/osmo-gsm-tester
363chmod -R g+rwxs /var/tmp/osmo-gsm-tester
364setfacl -d -m group:osmo-gsm-tester:rwx /var/tmp/osmo-gsm-tester/state
365----
366
367IMPORTANT: the state directory needs to be shared between all users potentially
368running the osmo-gsm-tester to resolve resource allocations. Above 'setfacl'
369command sets the access control to keep all created files group writable.
370
371With the jenkins build as described here, the trials will live in the build
372slave's workspace. Other modes of operation (a daemon scheduling concurrent
373runs, *TODO*) may use a system wide directory to manage trials to run:
374
375----
376mkdir -p /var/tmp/osmo-gsm-tester/trials
377chown -R :osmo-gsm-tester /var/tmp/osmo-gsm-tester
378chmod -R g+rwxs /var/tmp/osmo-gsm-tester
379----
380
381===== Allow DBus Access to ofono
382
383Put a DBus configuration file in place that allows the 'osmo-gsm-tester' group
384to access the org.ofono DBus path:
385
386----
387cat > /etc/dbus-1/system.d/osmo-gsm-tester.conf <<END
388<!-- Additional rules for the osmo-gsm-tester to access org.ofono from user
389 land -->
390
391<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
392 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
393<busconfig>
394
395 <policy group="osmo-gsm-tester">
396 <allow send_destination="org.ofono"/>
397 </policy>
398
399</busconfig>
400END
401----
402
403(No restart of dbus nor ofono necessary.)
404
405[[install_capture_packets]]
406===== Capture Packets
407
408In order to allow collecting pcap traces of the network communication for later
409reference, allow the osmo-gsm-tester group to capture packets using the 'tcpdump'
410program:
411
412----
413chgrp osmo-gsm-tester /usr/sbin/tcpdump
414chmod 750 /usr/sbin/tcpdump
415setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
416----
417
418Put 'tcpdump' in the '$PATH' -- assuming that 'tcpdump' is available for root:
419
420----
421ln -s `which tcpdump` /usr/local/bin/tcpdump
422----
423
424TIP: Why a symlink in '/usr/local/bin'? On Debian, 'tcpdump' lives in
425'/usr/sbin', which is not part of the '$PATH' for non-root users. To avoid
426hardcoding non-portable paths in the osmo-gsm-tester source, 'tcpdump' must be
427available in the '$PATH'. There are various trivial ways to modify '$PATH' for
428login shells, but the jenkins build slave typically runs in a *non-login*
429shell; modifying non-login shell enviroments is not trivially possible without
430also interfering with files installed from debian packages. Probably the
431easiest way to allow all users and all shells to find the 'tcpdump' binary is
432to actually place a symbolic link in a directory that is already part of the
433non-login shell's '$PATH'. Above example places such in '/usr/local/bin'.
434
435Verify that a non-login shell can find 'tcpdump':
436
437----
438su jenkins -c 'which tcpdump'
439# should print: "/usr/local/bin/tcpdump"
440----
441
442WARNING: When logged in via SSH on your main unit, running 'tcpdump' to capture
443packets may result in a feedback loop: SSH activity to send tcpdump's output to
444your terminal is in turn is picked up in the tcpdump trace, and so forth. When
445testing 'tcpdump' access, make sure to have proper filter expressions in place.
446
Pau Espin Pedrole617d2a2017-11-02 18:04:06 +0100447===== Allow Core Files
Pau Espin Pedrol018e1042017-08-28 11:58:25 +0200448
449In case a binary run for the test crashes, a core file of the crash should be
450written. This requires a limit rule. Create a file with the required rule:
451
452----
453sudo -s
454echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf
455----
456
457Re-login the user to make these changes take effect.
458
459Set the *kernel.core_pattern* sysctl to *core* (usually the default). For each
460binary run by osmo-gsm-tester, a core file will then appear in the same dir that
461contains stdout and stderr for that process (because this dir is set as CWD).
462
463----
464sysctl -w kernel.core_pattern=core
465----
466
Pau Espin Pedrole617d2a2017-11-02 18:04:06 +0100467===== Allow Realtime Priority
Pau Espin Pedrol018e1042017-08-28 11:58:25 +0200468
469Certain binaries should be run with real-time priority, like 'osmo-bts-trx'.
470Add this permission on the main unit:
471
472----
473sudo -s
474echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf
475----
476
477Re-login the user to make these changes take effect.
478
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200479[[user_config_uhd]]
Pau Espin Pedrole617d2a2017-11-02 18:04:06 +0100480===== UHD
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200481
482Grant permission to use the UHD driver to run USRP devices for osmo-bts-trx, by
483adding the jenkins user to the 'usrp' group:
484
485----
486gpasswd -a jenkins usrp
487----
488
Pau Espin Pedrole617d2a2017-11-02 18:04:06 +0100489===== Allow CAP_NET_RAW capability
Pau Espin Pedrol8ad5e6a2017-11-02 16:08:05 +0100490
491Certain binaries require 'CAP_NET_RAW' to be set, like 'osmo-bts-octphy' as it
492uses a 'AF_PACKET' socket.
493
494To be able to set the following capability without being root, osmo-gsm-tester
495uses sudo to gain permissions to set the capability.
496
497This is the script that osmo-gsm-tester expects on the main unit:
498
499----
500echo /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh <<EOF
501#!/bin/bash
502/sbin/setcap cap_net_raw+ep $1
503EOF
504chmod +x /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh
505----
506
507Now, again on the main unit, we need to provide sudo access to this script for
508osmo-gsm-tester:
509
510----
511echo "%osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh" > /etc/sudoers.d/osmo-gsm-tester_setcap_net_raw
512chmod 0440 /etc/sudoers.d/osmo-gsm-tester_setcap_net_raw
513----
514
515The script file name 'osmo-gsm-tester_setcap_net_raw.sh' is important, as
516osmo-gsm-tester expects to find a script with this name in '$PATH' at run time.
517
518
Neels Hofmeyr74689532017-09-05 19:43:02 +0200519==== Log Rotation
520
521To avoid clogging up /var/log, it makes sense to choose a sane maximum log size:
522
523----
524echo maxsize 10M > /etc/logrotate.d/maxsize
525----
526
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200527==== Install Scripts
528
529IMPORTANT: When using the jenkins build slave as configured above, *there is no
530need to install the osmo-gsm-tester sources on the main unit*. The jenkins job
531will do so implicitly by checking out the latest osmo-gsm-tester sources in the
532workspace for every run. If you're using only the jenkins build slave, you may
533skip this section.
534
535If you prefer to use a fixed installation of the osmo-gsm-tester sources
536instead of the jenkins workspace, you can:
537
538. From the run job configured above, remove the line that says
539+
540----
541PATH="$PWD/osmo-gsm-tester/src:$PATH" \
542----
543+
544so that this uses a system wide installation instead.
545
546. Install the sources e.g. in '/usr/local/src' as indicated below.
547
548On the main unit, to install the latest in '/usr/local/src':
549
550----
551apt-get install git
552mkdir -p /usr/local/src
553cd /usr/local/src
554git clone git://git.osmocom.org/osmo-gsm-tester
555----
556
557To allow all users to run 'osmo-gsm-tester.py', from login as well as non-login
558shells, the easiest solution is to place a symlink in '/usr/local/bin':
559
560----
561ln -s /usr/local/src/osmo-gsm-tester/src/osmo-gsm-tester.py /usr/local/bin/
562----
563
564(See also the tip in <<install_capture_packets>> for a more detailed
565explanation.)
566
567The example configuration provided in the source is suitable for running as-is,
568*if* your hardware setup matches (you could technically use that directly by a
569symlink e.g. from '/usr/local/etc/osmo-gsm-tester' to the 'example' dir). If in
570doubt, rather copy the example, point 'paths.conf' at the 'suites' dir, and
571adjust your own configuration as needed. For example:
572
573----
574cd /etc
575cp -R /usr/local/src/osmo-gsm-tester/example osmo-gsm-tester
576sed -i 's#\.\./suites#/usr/local/src/osmo-gsm-tester/suites#' osmo-gsm-tester/paths.conf
577----
578
579NOTE: The configuration will be looked up in various places, see
580<<config_paths>>.
581
582
583== Hardware Choice and Configuration
584
585=== SysmoBTS
586
587To use the SysmoBTS in the osmo-gsm-tester, the following systemd services must
588be disabled:
589
590----
Maxbe69b6b2017-07-03 19:03:25 +0200591systemctl mask osmo-nitb osmo-bts-sysmo osmo-pcu sysmobts-mgr
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200592----
593
594This stops the stock setup keeping the BTS in operation and hence allows the
595osmo-gsm-tester to install and launch its own versions of the SysmoBTS
596software.
597
598==== IP Address
599
600To ensure that the SysmoBTS is always reachable at a fixed known IP address,
601configure the eth0 to use a static IP address:
602
603Adjust '/etc/network/interfaces' and replace the line
604
605----
606iface eth0 inet dhcp
607----
608
609with
610
611----
612iface eth0 inet static
613 address 10.42.42.114
614 netmask 255.255.255.0
615 gateway 10.42.42.1
616----
617
618You may set the name server in '/etc/resolve.conf' (most likely to the IP of
619the gateway), but this is not really needed by the osmo-gsm-tester.
620
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200621==== Allow Core Files
622
623In case a binary run for the test crashes, a core file of the crash should be
Neels Hofmeyree57f092017-06-03 15:20:50 +0200624written. This requires a limits rule. Append a line to /etc/limits like:
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200625
626----
Neels Hofmeyree57f092017-06-03 15:20:50 +0200627ssh root@10.42.42.114
628echo "* C16384" >> /etc/limits
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200629----
630
Neels Hofmeyree57f092017-06-03 15:20:50 +0200631==== Reboot
632
633Reboot the BTS and make sure that the IP address for eth0 is now indeed
63410.42.42.114, and that no osmo* programs are running.
635
636----
637ip a
638ps w | grep osmo
639----
640
641==== SSH Access
642
643Make sure that the jenkins user on the main unit is able to login on the
644sysmoBTS, possibly erasing outdated host keys after a new rootfs was loaded:
645
646On the main unit, for example do:
647
648----
649su - jenkins
650ssh root@10.42.42.114
651----
652
653Fix any problems until you get a login on the sysmoBTS.
654
Neels Hofmeyrb52df172017-05-14 20:09:35 +0200655
656[[hardware_modems]]
657=== Modems
658
659TODO: describe modem choices and how to run ofono
660
661[[hardware_trx]]
662=== osmo-bts-trx
663
664TODO: describe B200 family