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