Commit Graph

162 Commits

Author SHA1 Message Date
Harald Welte 6a688d6bde Add GPLv3 license text to repository
Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934
2017-06-03 14:23:51 +00:00
Harald Welte 2720534f27 Re-License under GPLv3-or-later instead of AGPLv3-or-later
The "Affero" nature makes sense for the Osmocom network components like
BSC, SGSN, etc. as they are typically operated to provide a network
service.

For testing, this doesn't make so much sense as it is difficult to
imagine people creating a business out of offering to run test cases on
an end-to-end Osmocom GSM network.  So let's drop the 'Affero' here.

All code is so far developed by sysmocom staff, so as Managing Director
of sysmocom I can effect such a license change unilaterally.

Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05
2017-06-03 14:23:51 +00:00
Pau Espin db59bcf9fc Use reserved ip address for osmo-hlr GSUP interface
Otherwise 0.0.0.0 was being used and we want all interfaces for a
specific osmo-hlr instance to use the same IP

Requires osmo-hlr change id I79f7a300480f308b21116dd14d1698be38725afd
otherwise osmo-hlr won't be able to parse the configuration file.

Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1
2017-06-03 14:21:09 +00:00
Neels Hofmeyr 53e758ae4c jenkins: extract common parts of build scripts to separate file
Have all complexity in one common shell script, greatly simplify the individual
scripts.

This allows to provide a specific branch or git hash to build instead of
current master. Some scripts allowed to provide branch names before, this now
also allows using git hashes directly.

Environment variables can be used to override the git hash/branch to use for
specific repositories.

Motivation for this patch: we need this to investigate failure causes more
easily.

Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089
2017-06-02 16:58:37 +02:00
Neels Hofmeyr e62364e7fc jenkins: remove unused file: jenkins-remote-update.sh
Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9
2017-06-02 14:28:59 +02:00
Neels Hofmeyr 3b906728b7 jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh
Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0
2017-06-02 14:28:49 +02:00
Pau Espin fa00b0f843 Use reserved ip address for osmo-mgcpgw VTY interface
Otherwise 127.0.0.1 was being used and we want all interfaces for a
specific osmo-mgcpgw instance to use the same IP

Change-Id: I60dbfbb66458cd333fe07139ee175c94fa1672a7
2017-05-31 19:00:16 +00:00
Pau Espin 1ba2deda37 aoip_debug/interactive: Start mgcpgw
Change-Id: I32079a7ed70e23d9bf170672e2220bc44d434e5d
2017-05-31 18:59:44 +00:00
Pau Espin ea3549f844 Use reserved ip address for osmo-bsc ctrl interface
Otherwise 127.0.0.1 was being used and we want all interfaces for a
specific osmo-bsc instance to use the same IP

Change-Id: I38dccac6707bf55f0abcf96e3a9d7d8ec765a156
2017-05-31 18:58:58 +00:00
Neels Hofmeyr ff1becfbf7 sms_test: add output checks
Change-Id: I4b033dc0d3d43825901308cda05c6999946b664e
2017-05-31 20:40:18 +02:00
Neels Hofmeyr b3b3104b6a fix: Sms.__eq__ bug due to typo
Add test of this to sms_test.py

Change-Id: Ib0b420a81c1b211a9f03a2521d244b3a427d5e5b
2017-05-31 20:39:42 +02:00
Pau Espin 996651a3a3 Move Sms class to a separate module
Preparation for following commits to add smpp support, as we will have a
class SmppClient with a method accepting an Sms object to send it.

Change-Id: I1f28e14e963abb64df687b69d54975be2aeb0d0d
2017-05-31 16:14:08 +02:00
Neels Hofmeyr b8011695b8 cosmetic: review mo_mt_sms.py's logging
Implement the Modem.log_info() function, use that instead of logging all modem
properties.

Tweak mo_mt_sms.py print() statements.

Pass modem object to SMS generation to inlcude the modem name as SMS token.

Change-Id: I2b17fce0b3b05594fd9038b54e5b65f5127bd0a4
2017-05-30 15:38:52 +00:00
Pau Espin 0993bf6f98 ofono_client: Fix race condition when checking for required features
I got a backtrace in which the modem was lacking feature 'net'. That
happens for 2 reasons:
1- net feature is not shown unless the modem is Online (at least for
sierra modems)
2- Even after it has been set online, a lapse of time can pass before
the feature gets shown.

This was added in 896f08f6ab
"fix: refresh dbus object when interfaces have changed"
with the expectation that the 'Features' list would be available in all
modem states. Since it depends on being powered and online, the same
functionality is already provided by checking the Interfaces list, hence
this code can be dropped entirely.

Change-Id: Iedd62235d1a3a8b917ad4ac0b61b9c5dbf0fe43c
2017-05-30 15:26:00 +00:00
Neels Hofmeyr 765c1d9ce3 default suites: enable osmo-bts-trx (Ettus B210)
Change-Id: I5dce732ed21f34988aa014add4d2d611dd0c44fc
2017-05-29 21:43:10 +00:00
Neels Hofmeyr 4e0627f85a contrib/jenkins: more aggressively exclude docs
Completely discard prefix/share/doc in builds. There was still ~1.2Mb from
libosmo-netif around.

Exception: osmo-hlr installs a bootstrap sql in prefix/share/doc/osmo-hlr,
so leave that script as-is.

Change-Id: I7f3f3cfed0f56099bdff93b11a0009c1caef67c8
2017-05-29 20:30:24 +00:00
Neels Hofmeyr 8c7477f5d8 cosmetic: SMS tokens: add modem name to SMS message
Change-Id: I66b8f30303e21ad781d16f3aa9fe30067d6a0e20
2017-05-29 20:30:06 +00:00
Neels Hofmeyr 0cc53ef4bc log.Origin: return self on __enter__
Allows using 'with some_origin() as foo:' constructs.
Not used actively, but is sometimes useful during debugging sessions.

Change-Id: I7a6463ee39761775305dd2272c24f248552db4ad
2017-05-29 20:29:09 +00:00
Neels Hofmeyr bef36bc5e3 resources.conf: take out 10.42.42.1
This seems to be the default address used to communicate via SSH with the
sysmoBTS. Whichever process ends up getting this address sees all of the
SSH in its pcap (for the AoIP build it tends to be OsmoHLR).

We could filter properly, but actually also just take this address out of
the pool for allocation to server processes.

Change-Id: I07e74ba0b9a5b08a308aae7646c4b7c70fe4aa0e
2017-05-29 02:54:16 +00:00
Neels Hofmeyr 206803d59a fix osmo-bts-trx: missing patch to use new event_loop
Change-Id: I640258d8451aff1633cba7390df5430da50d0b0b
2017-05-29 04:32:32 +02:00
Neels Hofmeyr 908faf8d1b fix log: print suite-run separator in proper place
error was introduced by 0ffb414406
'Add JUnit XML reports; refactor test reporting'

Change-Id: I9acf1a840277979a19a2019c69e4562ff7fe2ca0
2017-05-29 04:32:26 +02:00
Neels Hofmeyr 4d688c2faf fix multi-suite runs: implement modem cleanup
After a suite was done, the modem object would linger. If two suites were run
consecutively, the first suite's modem objects would still log incoming SMS.

Add an object cleanup mechanism in the SuiteRun class. Start by adding a
cleanup() to the Modem object and subscribing created modems there.

Move the modem_obj() function into SuiteRun, there is no use of it being
separate, and it makes for better logging.

Change-Id: I0048d33e661d683a263c98128cd5c38b8d897dab
2017-05-29 04:32:13 +02:00
Neels Hofmeyr 896f08f6ab fix: refresh dbus object when interfaces have changed
This solves the KeyError problems when we attempt to use new Interfaces that
have come up. The solution is to get a fresh pydbus object when interfaces have
been added.

Another key solution is to not completely discard and unregister all signals
every time. This is racy and may cause signals getting lost. If an interface
was not removed, it is not harmful to have it subscribed using an older pydbus
object. These older objects may linger until the specific signal subscriptions
are disconnected. It is important to fetch a new dbus object for subscribing to
signals on interfaces that have just been added.

Put signal subscription and property watching in a separate class
ModemDbusInteraction. This class may also be used without signals or a modem
config, in anticipation of the IMSI discovery patch that's coming up.

Related: OS#2233
Change-Id: Ia36b881c25976d7e69dbb587317dd139169ce3d9
2017-05-29 04:30:34 +02:00
Neels Hofmeyr ed4e528693 fix: free resources when a suite run is done
Add missing code to free resources, not upon program exit, but when a suite is
done.

This allows running more than one suite in a row.

Also add a check to not attempt to free if there is nothing to be freed, to
avoid a regression test failure triggered when a suite exits without reserving
anything.

Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Related: OS#2301
2017-05-29 03:03:39 +02:00
Neels Hofmeyr 2a1a1fa8f9 fix: None error on unavailable resources
If not a single resource of a wanted item was left, we ran into a None. Report
unavailability instead.

Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
2017-05-29 02:54:41 +02:00
Neels Hofmeyr 48055ed0aa fix osmo-bts-trx: add config: 'osmotrx tx-attenuation oml'
Before this, the network opened up by osmo-bts-trx would be invisible through
the attenuation of the osmo-gsm-tester hardware, because tx-attenuation would
apparently default to 50, meaning maximum attenuation.

Change-Id: I1c026b5691033127eef766d82566c39cc070e14a
2017-05-29 00:29:50 +02:00
Neels Hofmeyr 9576f5f9a5 log: change 'log_all_origins' from bool to a list of levels to apply to
The idea is to see the full origin list for log level ERR, while the rest
of the logging can be kept less verbose.

Change-Id: I0277782652548fa321f767da79b207d70678fad1
2017-05-28 22:26:23 +00:00
Neels Hofmeyr 445ff9b0f5 contrib/jenkins: cosmetic: add some spacing in log output
Change-Id: Ie7238d8610f2be3e074f366861782e010d814e94
2017-05-28 22:26:23 +00:00
Neels Hofmeyr 0e8b900a0f default-suites.conf: run aoip
Change-Id: I0f7d6feec5062c2aaf07eb9a7f543a4a84cb1ff7
2017-05-29 00:19:46 +02:00
Neels Hofmeyr aea2f2c13c MSC+BSC: add separate suites for AoIP: aoip_sms, aoip_debug
It would be nicer to select the network programs as scenarios, i.e.
independently from the specifics of tests that don't care whether a NITB or a
MSC+BSC is in place. See OS#2270.

For now have a separate script for BSC+MSC+HLR operation to be able to rapidly
get the binaries to work. We might even simply drop the NITB style, in which
case we don't need to make it configurable.

Change-Id: I06d2529822f3e483ce7fffc439edfa57844e01ef
2017-05-29 00:19:46 +02:00
Neels Hofmeyr 798e592fd6 MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP
Change-Id: I5842e8f1cba8e8e6bedfc08540efcafe207159cb
2017-05-29 00:19:45 +02:00
Neels Hofmeyr 52261b3f14 contrib: add jenkins-build-osmo-hlr.sh
Change-Id: I07ca99c57eb1c47a3f83673502c8ec638e7e42b2
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 0d05d3674d contrib: add jenkins-build-osmo-msc.sh
Change-Id: I2d5520cab0ad09f23e3ba49404385af80acf56f6
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 866d27eb5c resources.conf: more IP addresses
The upcoming BSC+MSC+HLR+MGCPGW style will need four IP addresses. I found six
already configured on the main unit, so adding all of them to our
resources.conf.

Change-Id: Ie0e0ed9bb7fbd87ebe630c32ef59659117d77ed8
2017-05-29 00:18:43 +02:00
Neels Hofmeyr d41dae9820 bts: add remote_addr() function
To start an MGCPGW, we so far need the BTS address in advance (should get fixed
at some point, but so far we do).

The sysmoBTS has a fixed IP address configured. The osmo-bts-trx so far always
uses 127.0.0.1 (should also be fixed at some point). Both now return this
address with the remote_addr() function.

This also replaces a SysmoBts.remote_addr member variable (which is not
sufficient because it is only populated during configure()).

Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 4f59ba6e68 config: nitb template: move ip_address to nitb.ip_address
It's the NITB's address, so it should go in the nitb.* scope.

Change-Id: I71a5ef153b7156b0644253f5aa8a0c848f42ab3b
2017-05-29 00:18:43 +02:00
Neels Hofmeyr c4ba4a6866 rename more items from nitb to bsc
A NITB is a BSC + MSC, and if a BTS talks to a NITB, it talks to the BSC part
of the NITB. Hence it makes more sense to name certain things 'bsc' instead of
'nitb', to prepare for a separate BSC process appearing soon.

Change-Id: I6a0343b9243b166d4053cc44f523543f1245d772
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 76d8103bfb rename resource nitb_iface to ip_address
I would like to use the IP addresses also for OsmoBSC processes, so it is more
than clear now that 'nitb_iface' was the wrong naming choice.

The only distinction we may need in the future is public versus loopback
interface. To add that, we may add a trait to the 'ip_address' resource
like:

  ip_address:
  - addr: 10.42.42.1
    type: public
  - addr: 127.0.0.1
    type: loopback

This way we can substitute public vs loopback addresses flexibly (e.g. using
scenarios).

Change-Id: I3ad583ae7a33f7a7bb56fe78a125f73c56a0e860
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 943c81d878 debug: config logging before templates: use pprint and an all-caps label
Change-Id: I0e1c1d3ce8163d5b40c17b7d0fb0847a068ced76
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 6d8e485a2b nitb config: set: logging color 1, category 1
Change-Id: Icd9022f5732caac65d16fc49f2ed7833199523de
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 2d1d561eeb resource error logging that is easier to understand
Log what a suite requested, what it has reserved and the complete resource
state.

Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
2017-05-29 00:18:42 +02:00
Pau Espin 927344b4dc event_loop: Create a global event loop to poll and wait for events
Tweaked-by: nhofmeyr
Change-Id: Iaa78bae0f053496377609b24a11ebaef3fd77598
2017-05-25 17:25:09 +00:00
Neels Hofmeyr 095d1290a6 resources.conf: remove unused example BTS
Change-Id: I370789a4dc048cf71c1951f2eb70bfec261583a2
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 391afe3b13 remove bts_ocpthy.py
We're not currently paying attention to the octphy in osmo-gsm-tester. So
instead of maintaining dead code, remove the bts_octphy.py; we can re-add when
the octphy is implemented properly.

Change-Id: Ia5d5750d440ae7019634b51fa1efe7bbb2a1d1e2
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 8b915073ae osmo_nitb.py: remove unused imports
Change-Id: I55c118c6b277a2c8cddc251e3d36571b12504266
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 62a5600051 contrib/jenkins: don't package /share/doc/libosmocore
Change-Id: Ibd2674c3f65f820a72d77c40a9e9df3e094bb41d
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 1eb5cbc719 fix: contrib/jenkins sysmobts build: proper PKG_CONFIG_PATH
Change-Id: I94b706d664ba89b2ea999601ba67348973c3639c
2017-05-24 16:17:58 +00:00
Pau Espin 5bf66c57d6 trial.py: Remove accidental double creation of file
This file is already created in run_suites().
Creating it in here too makes a new file name()_2.xml created and
populated instead of the original name().xml one.

Change-Id: Ibec14a1ef5fd029aa37ce666d00236bb872d636e
2017-05-24 12:02:43 +00:00
Pau Espin 98df394fc6 Exit with failure if not enough resources are found
Change-Id: I9e38435ff71416585a259c823053bd07c670d495
2017-05-24 12:01:07 +00:00
Pau Espin d1f8fe689e osmo_nitb.py: Remove unused var
Change-Id: Ifb0c274aac9f8fda177992f19146807387485627
2017-05-22 22:00:14 +00:00