Commit Graph

505 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther c490cdeebd ms: Add a main function to start all of it
Add a main file to start everything. All parameters need to
be made configurable. Composition of testcase and IMSI ranges
need to be configurable as well. This is left for future
commits. Right now it can execute a single UL test.

Start with:
export PATH=../osmocom-bb/src/host/layer23/src/mobile:$PATH
export PATH=../osmocom-bb/src/host/virt_phy/src/:$PATH
export PYTHONPATH=$PWD/src

python3 -mosmo_ms_driver

Change-Id: I58c938500a067eebb213750e56d8bf4d8af43df2
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther 30cc021af5 ms: Add a first test to use all parts of the system
This is an interim solution but is bringing all parts together.
We will need to:

 * Abstract this into a base class
 * Be able to mix different tests without interfering with each
   other (e.g. 10k LU tests, 2k SMS sending)
 * The event loop will need to handle multiple timers/timeouts
 * Stats printing should print more information and test pass/fail
 * The test should quit early if everything has already passed

Change-Id: Id3277ed0f0f9ee734569bedd4752564eb68c9cfd
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther ff19a5e7c2 ms: Create a starter for virtphy and mobile application
In the long run we might not want to start the virtphy but
for now virtphy+mobile belong together. Start virtphy first
as mobile will not handle a missing socket gracefully.

Change-Id: I5c6d742842d7f3e0a1858436ef3f8634d8c0582d
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther 6af1c18b17 ms: Create template for the osmocom-bb mobile application
Change-Id: I9296f42edfab57762f8dd317d63231298cda5430
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther 28bcaf0f2c ms: Lua part of location update testing
The lua part to start the MS and then signal the first
successful Location Update.

Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther 4a62bb0086 ms: Add lua script support utilities
Add a JSON encoder and a small module to sent registration and
other events per unix datagram socket.

json.lua fetched using:
$ wget -O src/osmo_ms_driver/lua/json.lua \
https://raw.githubusercontent.com/rxi/json.lua/master/json.lua

Change-Id: I43ae84a944c7f33e41d5de0880d4aaab3378809b
2018-04-04 15:35:12 +01:00
Holger Hans Peter Freyther e7ae51fcaa ms: Create an event server to handle Unix datagram messages
Create an EventServer that will create a unix domain socket and
dispatch incoming datagram messages. The lua remotes are not
passing credentials so this is a one way communication channel
for now. Tests can register to handle the message.

Change-Id: Ida97c570e8e741410f2dba4a231a8058ca96da25
2018-04-04 15:35:11 +01:00
Holger Hans Peter Freyther b7749a72b4 ms: Create a simple epoll (or kqueue) based event loop
Create a C-like single process event loop. It could be powered by
select/epoll or kqueue. It should scale to many open fds but we
will not have that many.

Change-Id: Iea06f33870cab9f21e9a1a1feb9758467343dd29
2018-04-04 15:35:11 +01:00
Holger Hans Peter Freyther 38adaa96bf ms: Create a cumulative distribution function class
We are using the CDF to decide which percentage of the jobs should
be running at a given point. The x-axis is time and the y-axis the
percentage of how many jobs should be running.

There are three functions to do this. The first one is a constant
which would result in everything being started right now, one to
start them linearly and the last (formula from Qt/3rdparty) to first
accelerate and decelerate slowly.

Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
2018-04-04 15:34:09 +01:00
Pau Espin 48fce86b3e nanobts: Attempt at fixing race condition using ipaccess-config after power up
It seems there's a period of time in between the nanoBTS starts
announcing itself and it can actually be managed by the BSC
(ipaccess-config in this case). If ipaccess-config is called quickly
after nanoBTS it first announced, its TCP conn will be rejected with a
TCO RST, and ipaccess-config will fail. Let's see if waiting a few
seconds is enough to have this working more reliably.

Change-Id: Iec8adb2cd13d808a6ca1843dc95b81bd1a97d1c0
2018-04-04 12:48:26 +02:00
Pau Espin 9a4631c789 Drop event_loop global functions and import MainLoop
Take the chance to identify and drop modules importing event_loop but
not using it.

Change-Id: Ifa1940cd00138ebc72fbcfd45a0e28246f7a5ed9
2018-04-04 12:38:09 +02:00
Pau Espin bf176e420e event_loop: Use glib as mainloop impl and move modem to use event_loop
Several benefits:
- We can add APIs to poll on fds in the future (for smpp socket for
  instance) instead of using busy polling.
- During wait(), we now block in the glib mainloop instead of sleeping
  0.1 secs and not handling events during that time.
- We remove glib mainloop specific bits from modem.py

Change-Id: I8c3bc44bbe443703077110cdc67207e9cbb43767
2018-04-04 12:38:08 +02:00
Pau Espin 2c0ae6288d templates: osmo-bsc: Remove no longer available cfgs
osmo-bsc c74a5616bf1c77ac40ddd92f4927dca7a1b45bc8 removed these cfg
options as they are dead code.

Change-Id: I2fb63d31d5d7424b48ed2cfc694d09db072db485
2018-04-03 00:38:18 +02:00
Pau Espin 47d2d3a838 example: Run tests on both nanobts with different bands
Change-Id: Iee2220e1770caa891713dbd18e8f4a4741c1fbe4
2018-03-27 19:26:37 +02:00
Pau Espin fef9c1c5cf nanobts: Add support to run nanobts on the 900 band
Change-Id: I13b494630ea835f4bed38ccc77f6a4d5e18326af
2018-03-27 19:20:47 +02:00
Pau Espin 3f480a0e05 example: Add scenarios to select BTS for a specific band
Change-Id: Id830536c9337151818901cb25c3a568a77cdbf5e
2018-03-27 19:16:14 +02:00
Pau Espin 05a838e259 schema: Accept band GSM-900
Change-Id: I274c3010f33776b2967ee01de027c44b794cc5d4
2018-03-27 19:15:41 +02:00
Pau Espin a238ed9931 nanobts: Bind to specific addr instead of specific iface
This way root access is not required.

Change-Id: I02f6fc9e1cb1ea1e1d950eafe22c231a18100f98
2018-03-27 14:51:51 +02:00
Pau Espin 807d865ebe default-suites.conf: Add nanobts related tests
Change-Id: I054db78e6a71514133e4e3c3158342b74af44201
2018-03-15 19:54:43 +01:00
Pau Espin 1b28a584ed Introduce ip.access nanobts support
Change-Id: Ibaea025b3a503dfe897d36701234445de6d49f82
2018-03-15 19:54:42 +01:00
Pau Espin 19c508c304 Introduce PowerSupply interface and PowerSupplySispm
File powersupply.py defines the interface to be used by child classes
implementing it. It also provides helpers to allocate a child class
based on configuration provided ('type' field).

File powersupply_sispm.py is an implementation using pysispm [1], as it's
the one used to control the programmable power socket we have right now.

This kind of class will be used in later commits by Nanobts class, as we
want to poweroff the Nanobts completelly when not in use.

Using it requires the following extra dependencies:
$ apt-get install python3-usb
$ pip3 install pysispm

Related: OS#3040

[1] https://github.com/xypron/pysispm

Change-Id: I981c260eca1a61657147e6d83b4226618088223c
2018-03-15 19:54:36 +01:00
Pau Espin 651cdc9b0f pcu.py: Introduce PcuDummy class
It will be used in later commits by BTS without proper PCU control such
as NanoBts.

Change-Id: I37ba38f7d81134e5f0ca28fa684fdb09c753bb04
2018-03-15 11:29:35 +01:00
Pau Espin 52ad3a66d2 Create Bts abstract class and make OsmoBts inherit from it
This base class will be used to describe the required accessors for all
BTS objects, be it an osmocom BTS or not.

It is introduced in this commit and will be further used in the future
when adding a NanoBts object.

Change-Id: Ic13133e61abda73a8b507c1a1bd7b98c677460f9
2018-03-15 11:29:35 +01:00
Pau Espin 4fbdc35e95 bts_osmo.py: ready_for_pcu is of public access from tests, move it accordingly
Change-Id: Ie8978854404897ae5de7e3100d55d86c7a5c1df1
2018-03-15 11:29:34 +01:00
Pau Espin 150abb48d0 Create Pcu abstract class and make OsmoPcu inherit from it
This base class will be used to describe the required accessors for all
PCU objects.

It is introduced in this commit and will be further used in the future
when adding a Dummy PCU object which will be used by NanoBts object.

Change-Id: Ia3fd4551d1f2932362f99f7d44d65f8ae4fd1979
2018-03-15 11:29:34 +01:00
Pau Espin f8d12196f0 modem: workaround ofono crash
Since commit bfd0b2310c, the IMSI is
retreived from ofono. To get the IMSI, the modme must be powered ON
previously. The imsi() method is called before calling connect() in
order to set up the IMSI in the HLR. As a result, the following
behaviour occurs:
- Powered=true (in imsi())
- SimManager.GetProperties() (several of them)
- Powered=false (power_cycle() in connect()

It seems powering off the modem immediately after using the SIM service
makes ofono crash. Proof of it is that crashes were seen mainly on tests
using only 1 MS, in which we don't spend that much time between
SimManager.GetProperties() and Powered=false for the same modem.

Let's workaround the crash for now increasing the time between using the
SIM services and powering the modem off.

Related: OS#3064

Change-Id: Ief052cac5a862d6ef9391d40c294ba017387506c
2018-03-14 19:20:07 +01:00
Pau Espin 7ad177f396 example: Maintain different resources.conf for RnD and prod
We still want to maintain this file in the same osmo-gsm-tester repo
because we frequently neef to update the config when adding new
features.

Until now only 1 file was maintained (which was used for RnD setup), and
then when runnin in prod the jenkins script used sed to change the file
to accomodate slightly changes. This way is too hacky, so let's just
maintain too separate files, keeping the original resources.conf key
name used by osmo-gsm-tester free, so that jenkins job can symlink one
of the 2 files to it.

Take the chance to remove OctoBTS and Sysmocell5k from the RnD resources
file, as we don't have those them.

Change-Id: Ifec851c7ac6fca6b294e57dfe86b92f214ae8f42
2018-03-13 20:12:42 +01:00
Pau Espin bfd0b2310c modem: get IMSI from ofono
There's no need to specify the IMSI manually in resource config
and it's also prone to errors. Let's take it from ofono.
Add a 'sim' feature to allow modem to auto-discover it,
otherwise if not supported leave that feature out of the config for that
modem and an imsi can still be manually providen.

Change-Id: I20f9e8d97775293925205e4ea576d814214bf1a8
2018-03-13 18:32:59 +01:00
Pau Espin e5a7a40faa contrib: build-osmo-bsc: Add aibsip-find and ipaccess-config binaries to archive
They will be required by Nanobts class.

Change-Id: Ib0e003f74603c3146aa76d581ab493f960f73ab5
2018-03-09 18:54:28 +01:00
Pau Espin 274c8bd637 contrib: build-osmo-bts: Remove dropped dependency openbsc
Since osmo-bts ec33b0397f5d71248c5834513d4be7b9b0e46366, it doesn't
require openbsc anymore to build.

Change-Id: I8a1918971388afad41308629c1851614d1381f25
2018-03-09 18:54:28 +01:00
Alexander Couzens 89da3704bc jenkins: update poky version 2.3.2
The sysmobts 2017 releases are using poky 2.3.2

Change-Id: If6e8a5702e4c9b24e758e3aa5f390e786c51c384
2018-03-06 15:10:24 +01:00
Alexander Couzens 9695a1cbc1 jenkins: use env POKY_VERSION POKY_PATH to find poky
Instead of hardcoded values, use defaults and allow jenkins to override
the defaults.

Change-Id: I1403b32cdf30420f3b02c41c2627b71fcbeae9ab
2018-03-06 15:09:26 +01:00
Pau Espin edcc8d2624 osmo-trx: Add cfg template
Since commit 3da1f8352e337fb032bf7a58c2909d3ba918e237, osmo-trx requires
a cfg file to start successfully.

Change-Id: I8f0e0d0a9fa849f41c3cccc4059431f62f956eac
2018-03-04 20:17:26 +01:00
Pau Espin 86ea02f305 osmo-msc: Use osmo-mgw instead of osmo-bsc_mgcp
osmo-msc now requires osmo-mgw and it's not expected to work properly
anymore with old mgcp code.

Change-Id: I93033f7b6133a4914f12f37511ad870b3dea3201
2018-02-26 12:14:48 +01:00
Pau Espin 2c48c34998 pcap_recorder: log printing pcap file name as dbg
The log message is quite long and makes it difficult to read the log
even with debug disabled.

Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
2018-02-23 17:25:41 +01:00
Pau Espin e25cf04aeb modem: Identify modems by sysfs path instead of ofono dbus path
ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
2018-02-23 17:14:37 +01:00
Pau Espin b2a94e8430 contrib: build-osmo-trx: build new dep libosmocore
Since 8b843e5bed6e3dab1068b86805e557a196f9aa4c, osmo-trx depends on
libosmocore.

Change-Id: I63d09339da5be7af638efe9e07f0c0ed31738ed1
2018-02-23 12:33:39 +01:00
Pau Espin cdac297b89 modem: Remove ctx after deactivating it
Change-Id: Ib0e2a8ae8d9885fa44c9cc1f7dc7c7948abd683c
2018-02-16 15:14:32 +01:00
Pau Espin b05aa3cea2 modem: deactive_context: Log when context is successfully deactivated
Change-Id: Ibe40a954aa4548e54b48c444014d7dbd2da9d956
2018-02-16 15:03:50 +01:00
Pau Espin b17295bb21 templates: osmo-msc: Remove unused option auth policy
Commit osmo-msc 098aa71e83a86200a18088927b4753909f5ed518 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: I928379ebabfc776f33b9f345d92a7a4a533fe25f
2018-02-14 11:26:43 +01:00
Pau Espin 342694150e templates: osmo-msc: Remove unused option reject cause
Commit osmo-msc 27b40c601c41fde70446ad553629494234c07662 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: Iac1948113514414e7573f3bbfb3ce82e6c49adb6
2018-02-14 11:26:11 +01:00
Pau Espin 263dd3b600 modem: deactivate_context: Fix dbg message
Change-Id: Ib3cb72ebcbfbf53693a2d76ca1592ef7d394dd87
2018-02-13 22:27:46 +01:00
Holger Hans Peter Freyther 257ee10967 log: Use sys._getframe() to avoid stat(2) calls
The Osmo MS driver is launching many many processes and I would
like to use the logging framework for the code as well.
Unfortunately the inspect/traceback code will use a linecache which
will execute stat(2) on one or more python files.

Related: OS#2927
Change-Id: I8f6bacadcf74d3aa25db1e1f41644f64aa19cf92
2018-02-13 10:49:00 +00:00
Pau Espin 4792f40f6a resources.conf: Update octphy net_device
Interface naming model changed after switching to debian9. eth1 is now
named enp2s0.

Change-Id: I86422452e6fd52015361d9e8508b7c74e20847a4
2018-02-07 14:29:05 +01:00
Pau Espin 668d42f775 aoip_smpp: Since recent osmo-msc, we accept all sms in store&forward mode
Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3
2018-01-30 12:31:37 +01:00
Pau Espin 031f46476c Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue"
This reverts commit 4a22ac7d2c.

Issue has been fixed in OS#2354, osmo-msc
1e67fea7ba5c6336066b78f98a28ab33b05c36c4.

Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca
2018-01-29 10:56:31 +01:00
Harald Welte ab4a1f7074 osmo-bsc.cfg.tmpl: Remove bogus VTY commands
There are plenty of VTY commands that were inherited from OsmoNITB,
but which make no sense in a BSC.  Upstream OsmoBSC has removed them in
change-ids Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38,
c499e5c62e9bef0db219e4658ffeb3292d6e6a5b and
8311a81bae85618302273c3f769275893161a7d7

Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
2017-12-19 18:55:26 +01:00
Neels Hofmeyr c6cd68ee63 cosmetic: adjust resource_test to comp128v1
Since libosmocore doesn't support XOR at all, it seems weird to use it in the
test, even though it's just a selftest without libosmocore involved...

Change-Id: I51edec255e7ef277907817b3187c2f492465467f
2017-12-18 02:28:58 +00:00
Neels Hofmeyr 0af893c79d osmo_hlr.py: fix auth algo mapping, properly indicate COMP128v1
So far the resources.conf says we're using XOR, but we wrongly map 'xor' to 1,
which is actually comp128v1 in enum osmo_auth_algo from libosmocore (which
osmo-hlr uses to interpret the numbers from the hlr.db).

This explains why our "xor" tests are succeeding even though libosmocore
doesn't support XOR at all: we were using comp128v1 all the while.

Fix the auth algo mapping:
- define correct mappings, copying enum osmo_auth_algo, in util.py
- add a function to get the enum value from name, in util.py
- use this in osmo_hlr.py

Change subscriber_add() API to take the algorithm string instead of a number.
The number is libosmocore internal and we should not expose it within our API
beyond above dict. There are no callers using this parameter yet anyway.

Adjust resources.conf to indicate COMP128v1 which we are actually using and
which means we're still using algorithm number 1 after this change.

BTW, osmo-nitb uses the ctrl interface which interprets the names, so is not
vulnerable to mapping wrong numbers and needs no fix. (If osmo-hlr featured
similar CTRL, which it doesn't yet, this code could be more robust.)

Related: OS#2758
Change-Id: I7a6ce92468a6ae46136ad4f62381da261fd196c8
2017-12-18 02:28:58 +00:00
Pau Espin b05e36aa38 modem: activate_context: print protocol too in dbg log
Change-Id: I5c2df196b924bb0cf74aadabb4544ca1fecc1eba
2017-12-15 12:40:18 +01:00