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