Otherwise there's too much output. With debug enabled, iperf3 test from
gprs testsuite generates a 96MB osmo-pcu.log. With log level set to
info, size drops to 1.4M, which is a lot less after compressing in an
archive.
Change-Id: I008234024b9369db42c90ef5d59a013fd2d22718
Since the modem iface and the GGSN iface are on the same host/netns,
it's really difficult to conveniently test data plane without getting
routing loops. As a result, either GGSN or modem iface must be moved to
a different namespace. The decision after a few discussions was finally
to move modem interfaces to a different netns.
Expected setup:
* ofono is patched to avoid removing modem if it detects
through udev that its net iface was removed (due to for instance, net
iface being moved to another netns and thus not being reachable anymore
by systemd-udev process running in root netns).
* After ofono is started (and successfully configured all the modems and
detected its net ifaces through syfs/udev), script "modem-netns-setup.py
start" which creates a netns for each modem, naming it after its usb
path ID. net ifaces for that modem are moved into its netns.
* Modem is configured to use 802-3 data format, and as a result the net
iface is configured through DHCP (DHCP req only replied AFTER pdp ctx is
activated!).
* Since osmo-gsm-tester knowns the modem USB path ID (available in
resources.conf), it can run required steps (ifup, DHCP) to configure the
interface. The interface name is provided by ofono to osmo-gsm-tester.
* As a result, any process willing to transmit data through the modem
must be in the modem netns.
Related: OS#2308
Change-Id: Icb06bdfcdd37c797be95ab5addb28da2d9f6681c
All config parameters are hardcoded for now and it should push
subscribers into the test (which should be a base class but not
a specific test).
Change-Id: I586b6d532c6e6395b4e6f2cf2128372237d05a7d
We don't know at which state the termiation routine will be
called and it is best to have a fully initialized object. In
prepare we start with a fresh list just to be sure.
Change-Id: I675772c89e32620da5695aa4793b735cc266684c
This change allows recording all interesting traffic for TTCN3 tests,
having GSMTAP and RSL together, because osmo-bsc is configured to pass
the RSL IP of the TTCN3 testsuite emulating a BSC.
Change-Id: I6bd1d1bec8e7b698d12aa886acc21d92532d9e6c
VTY cmd "logging level all" is deprecated in favour of "logging level
set-all", but the required behaviour in this case is "logging level
set-all".
Change-Id: Ice54fca6be86f05a02ce4ae783e6e42e6958b95d
Previous implementation was done due to osmo-pcu dying if failed to
connect to not-yet prepared BTS. This is no longer the case, so we can
start osmo-pcu as soon as the socket exists.
Change-Id: I3aa6bef0c4893bdcac668002ca018af019f666a3
First of all, it was found that vty allocation must be forced (-t -t)
during ssh session creation to make sure SIGHUP is forwarded when
session is closed.
Second, since osmo-trx ignores SIGHUP (osmo_init_ignore_signals()), we
must add a wrapper script which converts received SIGHUP into a SIGINT
to stop osmo-trx.
Change-Id: Ic334a54b1a1827d74fe0b453ac32bb77b8616147
2nd TRX arfcn is changed in defaults.conf because multi_arfcn requires
them to be alocated in steps of 4 starting from TRX0.
It is not enabled by default yet on B200 (it must use it to support
several TRX) because current host running osmo-gsm-tester is not
performant enough and cannot keep up with timers due to multi-arfcn CPU
overhead.
Change-Id: I096df82ad1f4cbb41dfbd6a78466a845f34be385
At all times have a list of mobiles that were created. Make a shallow
copy and use it as the unstarted list.
This will be used by the upcoming gsm tester integration to build a list
of subscribers to be added into the HLR/AuC database.
Change-Id: Id72b7ce8821cf53ac0d5e4a141b9a2b66242e2a3
In osmo-mgw.git 31b4729f2731c747b8b33c4646dd5ade2ace29bc, osmo-bsc_mgcp
was dropped and the one from openbsc.git must be used.
Change-Id: Ib1c46baf4d36ab18f8064a2234a0ba28a1e7d2c2
Take an IMSI/KI when creating the OsmoMobile and not when starting
it. This will allow other code to know which IMSIs will be used
before the system starts (e.g. to add it to the HLR/nitb db).
Change-Id: I79e259e948aa797c13118143ecd64bb7e29d274b
* This commit is a preparation for future commits to add support for
different osmo-trx devices and backends like osmo-trx-lms.
* Drop deprecated osmo-trx-* cmd line params and use VTY cfg to set them.
* As number of osmo-trx related osmo-gsm-tester attributes grow, group
them togther in an "osmo_trx" dictionary.
Change-Id: I77d29413c9e3b600b796627ba366f80c3281b7e1
suite.config() hasn't been activetly used anywere. New upcoming patches
will start using it to set and overlay config parameters for objects
which are not necessarily allocated as resources.
Since these options don't apply to specific resources, there's no sense
in running replicate_times() on them.
Change-Id: I5fcdc9151d1663e738f5c8abe588a42ab51c8f6e
Before this patch, scenarios were only used to select resources with
specific attributes. This commit introduces "modifiers" in scenarios,
which allows setting or modifing config attributes of resources once
they have been reserved. This way same test can be run selecting same
resources but modifying its configuration, allowing for instance running
different number of TRX, different timeslot configuration, etc.
Modifiers are described by placing a "modifiers" dictionary in any
scenario file, similar to the current "resources" one used to select
requird resources. The "modifiers" dictionary is overlaid on top of the
"resources" one resulting from combining all the "resources" dictionary
of all scenario files.
Change-Id: If8c422c67d9a971d9ce2c72594f55cde2db7550d
Since osmo-hlr.git I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9, USSD
processing has been moved to osmo-hlr and prefix routing needs to be
configured, otherwise USSD requested are answered back to the MS with an
error "ss-NotAvailable (18)".
mesage received for extension resolution (*#100#) had its format change,
so update to new format (carriage return at the end was dropped).
Change-Id: I5f75eff0df2d20d7f9b39e69184cffb0e635713d
After bug described in OS#3456 and fixed in last commit, let's
categorize and place variables in its correct plac to avoid similar
issus. We leave under the class keyword (class scoped variables) the
attributes which are to be used as static class attributes. All other
ones are initialized during __init__(). This way w avoid scenarios in
which while using an object from an instance attribute we end up reading
a class scoped variable which is shared among all instances.
Change-Id: I5ad4cac34a9f49eaf42966c01c9c5a4d3f3e9dc8
variables under class section are shared among all instances, and are
used unless the specific class instance attribute is set. As a result,
the same pwsup_list object was being re-used.
Take the chance to do the same with the _pcu var, since we want same
behavior for it.
See for reference: https://stackoverflow.com/a/1716730
Fixes: OS#3456
Change-Id: I3f6a9d64b35aec33430e90872f41c3d046653ce6
num_trx is left for now by default to 1, but it has been tested to work
properly (current tests pass and both trx are configured) with
num_trx=2.
Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7
We are already doing this for defaults.cfg, but not for resources.conf.
As a result, if we have a trx_list with 2 trx but we have set num_trx=1
(default), parsing will fail later in bsc.cfg.tmpl because
conf_for_bsc_prepare() will pass a trx_list with 2 trx.
Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831
Remove non completed results before calculating the min/max. We will
need to check success/failure based on completion ratio.
Change-Id: Icaf9e90dd729b2339e409b3ec1593f456969fd19
This will make it easier to strt different kind of tests. The cost
of calling step_once is hopefully neglectable as it simplifies the
test.
Change-Id: I3708ac382c0a34e17cf147d18f03603946437a53
We leave mobile/virtphy running after the test. Attempt to gracefully
exit and kill all of them. I experimented with both os.setpgrp and the
prctl(PR_SET_DEATH_SIG) but that didn't improve the situation.
Change-Id: I6cec050db7d4c355fb6678b2d84309fbbe5587b3
As of osmo-hlr edca4f88a653cc688bc1c46611a9f0bc880637e2, hlr.sql file
has been moved to an sql subdir.
Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef
We are using the "autobind" feature of Linux to get a special
socket address. This allows us to have roughly 2^20 clients on
the system.
Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
Avoid being stuck in c7 state and use the c7-any-timeout with a low
value. Do not attempt to store SMS in the home directory (if they
are received).
Change-Id: I4bb59130a04852bc43af9ef3602b129f40e9e170
This way it can easily be spotted which port is being triggered in case
someone wants to manually test it.
Change-Id: Ibd2c70170d97a786e37b6838b1ed6d4eb637ad8b
Some tests may want to reproduce some scenarios in which it is expected
that a BTS process is stopped, for instance if the BSC link is dropped.
Provide a keepalive parameter to start() for bts and pcu objects to
inform suite that failures are expected and that it should keep them
alive in case that ocurrs by respawning the BTS process.
Change-Id: Ia2a7539f9fad457125ac9b60a52a52999e885ba8
Some tests may want to start/stop/manages processes themselves. By using
the process module from osmo-gsm-tester, we make that possible easily,
providing with useful features such as requesting a suite to stop it on
cleanup.
Change-Id: I8e018107cbec81299ec2228bfff933fb3b0bb6cd
Since sys.path is modified idynamically to load modules from "lib" subdir of each suite, from python env point of view all those modules share a namespace. As a result, there can be name collisions.
If a name collision appears (eg test1 loads "testlib.py" and test2
afterwards also loads its own "testlib.py"), then python interpreter
thinks the testlib.py module is already loaded, so test2 ends up using
"testlib.py" from test1.
The way to solve this is to make suite local
modules to live only through the scope of the suite, and unload the
modules once the suite is finished.
Change-Id: I4efe815f85bc4ec2ca91aa9c2d3a369048f21571
The num_trx attribute for a given BTS states the number of TRX to be
used by that BTS. If more than num_trx are configured in trx_list in the
cfg file, then only up to num_trx are taken into account. If a num_trx
value higher than max_trx is specified throuygh config file or at
runtime by the test, an exception is raised explaining the issue.
The num/max_trx attributes are overlayed along the config levels
(generic -> bsc_bts -> specific bts-type -> specific resource object).
This way we can specify a long list of trx+timeslot config in the
generic config (bsc_bts), and tune for each model and specific BTS which
is the desired default number of TRX, as well as the maximum supported
per type.
Change-Id: I7f46eaf7a16f03268653299c93600c0443f691ac
nanobts inherits directly from bts.Bts, so we need to move
conf_for_bsc_prepare there to make nanobts work again.
Fixes: 530681fd86
Change-Id: I4305eefb4056ed7614118532e271efe780f4a87f
This can happen while in a test we use:
wait(ms_mo.call_is_active, mo_cid)
And then answer fails for whatever reason, after a timeout ofono will
remove the call object:
/sierra_2: DBG: 'org.ofono.VoiceCallManager'.CallRemoved() -> /sierra_2/voicecall01
As a result, during next call o call_is_active() will try to get the
call object, but it doesn't exist anymore and an exception will be
created in method call_state during call to systembus_get().
Change-Id: I02b7e76425754372756493761819f18f1e3106c1
It was spotted that when an error ocurred during poll generating an
exception to finish the test (osmo-msc ended prematurely), then the
active wait() condition was kept being checked for later tests, making
all followup tests fail.
That's because in case of exception we were not making sure the timeout
is removed and it kept firing forever.
Change-Id: I5c93cd67b2b83c0ecee96fbc6c4200b419bdf73f
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
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
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
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
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
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
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
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
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
osmo-bsc c74a5616bf1c77ac40ddd92f4927dca7a1b45bc8 removed these cfg
options as they are dead code.
Change-Id: I2fb63d31d5d7424b48ed2cfc694d09db072db485
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
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
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
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
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
Since commit 3da1f8352e337fb032bf7a58c2909d3ba918e237, osmo-trx requires
a cfg file to start successfully.
Change-Id: I8f0e0d0a9fa849f41c3cccc4059431f62f956eac
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
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
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
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
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
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
osmo-ggsn requires a link-local IPv6 address to be added to the
tun interface, otherwise the apn will not be configured correctly and it
won't be able to allocate addresses from the ipv6 pool later on.
Some OS don't support autoconfiguring link-local IPv6 addresses when the
interface is brought up (some linux versions are known to fail at it).
This is the case for our Prod osmo-gsm-tester setup (running debian8
with kernel 3.16.51).
Make sure we configure correctly the interface by forcing osmo-ggsn to
set on the interface and use a specific IPv6 link-local address. This is
done by using the "ipv6 link-local" vty cmd in osmo-ggsn.
After this modification, we can re-enable ipv6 gprs context creation as
it will work in Prod setup.
Related: OS#2746
Change-Id: Ib291c02a3c57a4189f9c4b1b856109be97ad2a34
Commit c9817a50ff moved code from
different BTS into a shared base class, and create_pcu method was
created to be implemented by subclasses to get a new pcu object.
However, parameters where wrongly copied over from pcu() method during
refactoring. create_pcu() has no parameters.
Change-Id: I1e95f2e658a870f86dd9d9d25f446b8efa4107a4
A lot of code can be shared by all osmocom related BTS we currently use
(sysmo, octphy, trx). This commits moves all this easily shareable code
to an abstract class OsmoBts which all (osmocom) BTS use.
Some bits of code do not apply for osmo-bts-sysmo but it's still shared
by BTS running in the main unit (octphy, trx), for instance the pcu
socket handling. Those are put together in OsmoBtsMainUnit.
This way we have:
log.Origin<-OsmoBts<-OsmoBtsMainUnit<-OsmoBtsOctphy
log.Origin<-OsmoBts<-OsmoBtsMainUnit<-OsmoBtsTrx
log.Origin<-OsmoBts<-OsmoBtsSysmo
Also take the chance to categorize the different APIs in the new
abstract class based on their use and scope.
Some code changes while moving which were required:
- A new protected abstract API "create_pcu", which returns an object of
"pcu" interface. Subclasses implement this API returning either a
PcySysmo or a PcuOsmo object. This is needed to abstract the pcu()
getter into the base class.
- For BTS running in the main unit, pcu_sk_tmp_dir object is allocated
when first used (API pcu_socket_path()) instead of doing it in the
constructor. This is moved into OsmoBtsMainUnit
Change-Id: I86db35a7f2497d37360b2c56affa8bf6bf704ee2
This is a temporary workaround to be able to test gprs signalling until
we set up all required bits to run osmo-ggsn in its own namespace.
Change-Id: I0a3ce16218f0274e0be09bbf2881bc21636acdf9
Up to this point we can test signalling plane: attaching to GPRS network and activating a
context.
Data plane (sending IP packets through the network) is still not
implemented as it requires setting up the network interface provided by
ofono as well as routing, and most probably move osmo-ggsn to its own
network namespace.
Change-Id: I605ba1bb1103a045a9b5d0e7215c05dfc1fe575f
This is required to start osmo-pcu after osmo-bts is already setup and
activated. Otherwise osmo-pcu ends after connecting to socket with:
"pcu_l1_if.cpp:416 BTS not available"
Change-Id: I7209589f60bda63094336e417638906be5e273c4
In 3b18044859df15ffd2ad4c3e5c3d2c94a2923eb9 this command
has been dropped and is no longer recognized.
Change-Id: I98546e36f8c809e8066fe0cc0d80d0ae3276473f
authentication is firmly VLR land and must go away from bsc. That option
is a leftover from nitb. It will be removed at some point.
Change-Id: I3bb4189b33173245116018e437e113c6c1226639
As of osmo-bsc ad47f7108aff5438bd2c6f7c0e898f4aa3b66fbe, this command
has been dropped and is no longer recognized.
Change-Id: Id97074195f045e6872a1a7030671a06259c9ec31
Also make sure we power off the modem during cleanup, to make sure we
set it offline (and in the future, we also detach GPRS).
Change-Id: I47845f36864d494be474fdd447a4e9e0cbed1abd
* We want to add more interfaces to this list when we add more features
(such as waiting for ConnectionManager if we want to use GPRS).
* We want to require some ifaces only if we are planning to use those
features in osmo-gsm-tester (driven by config features attribute set to
the modem in resources.conf).
* Previous usage during shutdown was wrong, as it was waiting for any of
them to be down to continue instead of waiting for all of them to be
down.
Change-Id: I56a289360018aa56fe25b3dd328ffe9194b65f6b
Before this commit, tcpdump was instructed to listen only on the
interface which had the IP assigned. However, local processes connecting
to that IP are actually sending packets through the loopback interface.
As we are not listening on it, all those packets are not being recorded.
Let's record on all interfaces instead and rely on the ip filtering to
record only the interesting packets.
Change-Id: I205786d5168acd66cf3427154d8bf307c5c58da5
Make the code more reachable for newcomers, as well as more organized
for people who work a lot with it.
SuiteRun in suite.py is already quite big, and having the Test class in
there make it unnecessarily more big, and makes it difficult to find
stuff.
At the same time, having a test.py which does actually not contain the
Test class but other stuff, makes it even more confusing.
Change-Id: I9c8d67f598466ba52a4827ff77027b9eae85929a
Since Change-Id Ia2882b7ca31a3219c676986e85045fa08a425d7a, osmo-bsc
uses osmo-mgw and utilizes libosmo-mgcp-client to talk to it.
This commit fixes latest constant failures in voice suite.
Change-Id: I1dadd781a357fce33e7bde55e4bcbdaeb4633359
Some modems such as the gobi 2000 doesn't support the Register() method
in /operator path. If the method returns a NotSupported error, fallback
to automatic registration.
Change-Id: Ibc322317db634a5380573de88a56eb53fd92e67b
The logic in next_msisdn can be later re-used for other purposes, such
as getting different location area codes for BTS.
Change-Id: Ib04a34892aacd7e71f8f5961e7339add583f73f2
Specific parts for this class:
- Runs osmo-bts-octphy binary, that requires CAP_NET_RAW capability
because it uses an AF_PACKET socket.
- As a consequence, it must use the previously added APIs to set the
capability and modify the RPATH of the binary before launching it. These
APIs require extra host setup and installed dependencies that will be
documented soon in osmo-gsm-tester manual.
- A num_trx() helper method is added because the binary requires that
parameter.
- A allocate_phy_instances() is added to help build/fill the conf
dictionary to be used in the tmpl to be able to easily set up trx, phy
and insances.
A config to use a osmo-bts-octphy at full power is used (4 trx) is added
in this commit to show how can it be configured. However our
current license only has support to use 1 TRX, and so next commit drops
most configurations to simplify the setup to use only 1 TRX.
Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297
Linux dynamic loader avoids loading shared libraries from env vars such
as LD_LIBRALY_PATH for ELF binaries which have capabilitiy flags enabled
for security reasons. For these binaries, we modify the RPATH of the ELF
header to tell the loader where to find the libraries.
Process class from process module is imported inside the method after
module initialization in order to avoid circular dependency of relative
imports, which is only available since python 3.5.
Change-Id: Ibc356957fb3dbcf9947bfe96b671ec8c7ede33ff
Some binaries such as osmo-bts-ocpty require specific capabilities, and
we need to provide them in case osmo-gsm-tester is not run as root.
Process class from process module is imported inside the method after
module initialization in order to avoid circular dependency of relative
imports, which is only available since python 3.5.
Change-Id: If3eb24461c02173dc80837a4cc83f9f2420c7816
if len(src) > len(dest), then we hit an out-of-bounds crash accessing dest[i].
It is totally valid to have src and dest with different lens, as you may
want to override only part of the list.
Change-Id: I4f8a191810e89a4081199edcb390fb3bb27ed42f
I first wanted to use "reset" method, but according to [1]:
"The recommended practice is to drop the reference to a
cancellable after cancelling it, and let it die with the outstanding
async operations. You should create a fresh cancellable for further
async operations."
Pretty weird that in other parts of documentation it still says that it
can be used for concurrent events.
[1] https://developer.gnome.org/gio/2.54/GCancellable.html#g-cancellable-reset
Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312
The previous commit wrongly placed all of 'osmotrx' below 'instance 0', put the
'osmotrx ip' ones back in the parent (I3a48cda44b932b46f34f027ca88e3703b6f04bad
-- I should have known, the change Id ends in "bad").
The correct structure is:
phy 0
osmotrx ip ...
instance 0
osmotrx rx-gain ...
osmotrx tx-attenuation ...
i.e. the 'osmotrx' command name exists on both the 'phy' parent level as well
as the 'instance' child level. (Argh, can this be more confusing? I assume we
will be seeing a continuous flow of users hitting this now.)
Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6
We hit this now because libosmocore has started strictly enforcing correct
indenting of child nodes. See I24cbb3f6de111f2d31110c3c484c066f1153aac9.
Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad
Same code is already being used by log.Error exception.
This way we can use:
raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands)
And get:
osmo_gsm_tester.resource.NoResourceExn: No free arfcns in any of bands {bands=['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900']}
Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46
The idea behind this attribute is similar to the Features one in ofono:
To provide an easy-to-use list of features that a modem supports.
In osmo-gsm-tester this feature list can be used to create scenarios to
act as a filter for modems. For instance, if an sms related feature must
be tested, then a modem supporting sms features is required. This way
only modems supporting that feature are going to be selected for that
test when that scenario is used.
We provide our own list instead of dynamically using it for two reasons:
- Accessing the list from ofono means powering on + online the modem,
which requires using the modem before resource resolution is done.
- ofono may state that it has support for feature X, but it still
doesn't have all features required by osmo-gsm-tester or there is a bug
in some part of the feature which prevents it from being used for a
specific test.
Change-Id: I1634049f01859ae0310174892a96e204bb670bc1
This parameter is contains a list of supported encryption ciphers by the
modem or bts setting it. It is so far not directly/automatically used
inside osmo-gsm-tester code, but can be useful to create scenarios for
tests that require specific ciphering modes.
For instance, aoip_encryption suite contains tests that require a BTS and
a modem that supports a5 0 and a5 1, otherwise tests will fail.
Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e
... instead of using the one from from osmo vty directly.
This way we avoid having multiple word attribute value and we can skip
using quotes in the conf files.
Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d
We want to handle lists in the same way as we handle them in combine().
Without this commit, reserve()->find() failed to match objects
containing dictionaries inside lists correctly (such as trx configs).
A few attributes are added to trx_list of some resources in
suite_test/resources.conf to show a case in which resource reservation
would fail without this patch. It failed because before this patch,
dictionaries inside lists are compared to be equal instead of being
compared element by element to see if one dictionary is a subset of the
other one (for each element in the lists).
Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48
This commit fixes combination of resources containing lists.
For lists containing complex types, it has been decided to handle them
as sorted list, where position in list matters. In this case, combine is
called recursively for each element in dest and src sharing position in
the list, and assumes that if one list is shorter than the other, then
it has to be combined against empty set for that tye.
For instance this is useful when defining trx_list properties, where a
BTS can have a different amount of TRX but we may be interested in
restricting the first TRX and don't care about extra TRX.
For lists containing simple types (eg. integers or strings), we just want
to merge both lists and we only need to check if the value is already there,
ie. handle them as unsortered sets. This case won't work if we call combine
for each element of the list because for a simple case it will just end up
checking if a[i] == b[i].
This kind of operation for simple types is needed in later commits where
cipher attribute is introduced. Without this patch, having following 2
scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51"
will fail:
cipher_a50.conf:
bts:
- ciphers:
- 'a5 0'
cipher_a51.conf
bts:
- ciphers:
- 'a5 1'
ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1')
Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015
As suite.conf and scenarios need to match 1-to-1 in lists, it's important to
extend the dictionaries by replicating the objects with a 'times' values
higher than 1 in order to match the objects correctly.
Since dictionanries are expanded at combine time, there's no need to
expand them during reserve() time because they are already expanded.
As a result, this commit reworks the kind of schema applied in each
place (and takes the change to start validating scenario files, which
were neglected previously).
Two unit tests are added as a show case. Unfortunately output showing
scenario dictionaries needs to be ignored while verifying because it was
encountered that different versions of python print dictionary elements
in different order.
Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6
Before this commit, only max_power_red was specified and it could only
be used as a defaults and could not be set per object. Together with
nominal_power, it can be useful to be able to set them to different
values for different objects, as for example different osmo-bts-trx
objects can require different values.
Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd
In the following suite.conf, position matters when matching against scenarios:
[suite.conf]
resources:
bts:
- type: sysmo
times: 2
- type: osmo-bts-trx
times: 1
[scenario]
resources:
bts:
-
- ip_addr: 1.2.3.4
In this case, for instance, we make it clear that we want the second
sysmo bts which has IP 1.2.3.4. With old behaviour, the replicated sysmo
would have been created at the end (3rd position), and the ip_addr would
match against the osmo-bts-trx BTS.
Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0
This is a first step to add support for osmo-bts-octpy to
osmo-gsm-tester.
There's no point in building separate insts for different osmo-bts
variants which run on the main unit and which come from the same git
repository, this we make the osmo-bts-trx one generic to handle all
variants which fall into the description above.
Tested locally on my laptop that it builds susccessfully.
Once this patch is applied, jenkins jobs need to be adjusted:
- RnD: osmo-gsm-tester_manual-build-all
- Prod: osmo-gsm-tester_build-osmo-bts-trx (and rename it)
Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90
An issue was spotted recently in tests run in production which call
modem.connect() twice, first time to check that we are unable to connect
with a wrong KI, then that we can connect with the correct KI.
As there's no current easy way to wait for "rejected" signal, we
basically wait for some time before checking if we were unable to
connect. It seems that sometimes waiting for 30 seconds is not enough,
and then a scan() async method is still in progress when we decide to
call connect() again, which will powercycle the modem. If the scan()
method returns at that time, then we try to access interfaces of the
modem which are no longer available because the modem is powered off at
that time. This triggers an exception and test fails.
To correct way to fix this is to make sure we disable pending Scan()
dbus method before powercycling the modem and starting a new Scan()
method.
The sleep time is also increased to make sure we let enough time to
register. It seems it can take about 15 seconds to do a full scan, and
sometimes during first scan iteration the BTS is still not found,
probably because it's still starting.
Related: OS#2510
Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b
Do not pass os.O_TRUNC to open(), that immediately empties out the lock file.
Fix lock_test to be able to catch this error. So far things were happening too
fast to notice it.
Caught by running 'make check' on a main unit APU that has different timing
behavior.
Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e
We are currently seeing this issues in prod setup, which uses python
3.4:
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/bts_osmotrx.py", line 44, in __init__
self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None)
File "/usr/lib/python3.4/tempfile.py", line 432, in mkdtemp
file = _os.path.join(dir, prefix + name + suffix)
TypeError: Can't convert 'NoneType' object to str implicitly
Acording to mkdtemp man in python3:
"Changed in version 3.5: suffix, prefix, and dir may now be supplied in
bytes in order to obtain a bytes return value. Prior to this, only str
was allowed. suffix and prefix now accept and default to None to cause
an appropriate default value to be used."
This issue went unnoticed because the RnD env is running debian 9, which
probably has python version >= 3.5.
Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2
In commit 329b6f4 pcu-socket path was moved to run inside the test run
dir to avoid issues between different tests creating a socket in the
same place.
However, it seems unix sockets paths are limited to 108 bytes (with Null
char included). In some cases, the run dir for a test can be quite long,
as it contains suite name, test name, etc. and the path can be longer
that the limit defined above.
In order to fix this issue, create a tmp dir using mkdtemp to ensure the
path to be used for the pcu-socket doesn't collide between different
instances of osmo-bts-trx.
Clean up of tmp dir and pcu socket is done inside the cleanup() method
called by suite.py.
method pcu_socket_path() is added to help with new implementation, and
it will be used as well as a public API later soon to be used by OsmoPcu
classes.
Related: OS#2507
Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038
In following commits, cipher attribute containing a list of supported
ciphers is introdued in osmo-gsm-tester. While developing the feature,
it was found that resources containing lists are not being handled
correctly.
Previous implementation regarding lists in several ways:
- In the list coe path, both item and wanted_item are expected to be
lists. Python doesn't support to check for sublists using the "in"
operand.
- want_item basically contains the scenario dic, and item is each of the
items available as resource of a given type. Thus, we want to check that
item supports the subset of features requested by the scenario, ie. that
the list in the scenario is a subset of the ones in the3 item and not
the opposite.
The following failing scenario is going to be checked during "make check"
when the cipher attribute is added: BTS supporting cipher a50 and a51,
and scenario requesting a50 succeeds. If this commit is remove, the test
no longer passes, and it fails with:
osmo_gsm_tester.resource.NoResourceExn: No matching resource available for
bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']}
Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d
The purpose of this patch is to make sure we output to the extended log
some information regarding the firwmare version of the modem being used,
even if the test being run doesn't call print(modem.info) explicitly.
Printing self.info() just after waiting for Powered==true doesn't always
work, because the properties are not populated after a while after.
Calling Modem.GetProperties() immediately after receiving Powered==true,
will provide with empty strings on properties such as Revision.
18:59:55.747412 bus /sierra_1: Setting Powered True
18:59:55.938889 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Powered=True
18:59:55.964694 bus /sierra_1: DBG: Powered == True
18:59:55.987777 bus /sierra_1: DBG: interface enabled: org.ofono.VoiceCallManager
18:59:56.006278 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=[]
18:59:56.027366 bus /sierra_1: Setting Online True
18:59:56.189991 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Manufacturer=Sierra Wireless, Incorporated
18:59:56.210935 bus /sierra_1: DBG: interface enabled: org.ofono.LocationReporting
18:59:56.233217 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['gps']
18:59:56.255807 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Model=MC7304
18:59:56.279374 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Online=True
18:59:56.315008 bus /sierra_1: DBG: Online == True
18:59:56.338779 bus /sierra_1: DBG: interface enabled: org.ofono.SimManager
18:59:56.357744 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['sim', 'gps']
18:59:56.379532 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Revision=SWI9X15C_06.03.32.04 r28324 CNSHZ-AR-BUILD 2015/05/25 01:09:15
18:59:56.401241 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Serial=356853054230919
Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5
The idea is to build each binary separately: even though osmo-msc requires
libosmo-sccp, which already includes the osmo-stp binary, we still want
osmo-stp to be built from a separate script. The reason: to track down
regressions, we can change the versions each binary is built from separately.
The additional build effort and jenkins script multitude is acceptable.
Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd
Register() method returned today this error which is expected acording
to ofono documentation API. In this case it probably happens because the
modem internally starts registering at some point between the time
Scan() is finished and we call Register(). In this case it is fine for
us and we should just ignore the error.
A helper method is added to check for this as so far it seems tricky to
check error information coming from pydbus. I could not reproduce this
issue locally so I could not test that the helper function is going to
handle it correctly when it is triggered. That's why I added extra debug
information to be able to fix it next time it is triggered.
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 489, in scan_cb_register
dbus_op.Register()
File "/usr/local/lib/python3.4/dist-packages/pydbus/proxy_method.py", line 75, in __call__
0, timeout_to_glib(timeout), None).unpack()
GLib.Error: g-io-error-quark: GDBus.Error:org.ofono.Error.InProgress: Operation already in progress (36)
Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a
Attribute trx_remote_ip is actually using IPv4 validate type, thus this
validate type is not needed.
Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99
Algorithm to use to generate response for the challenge during
authentication time is hardcoded in the sim card and cannot be easily
changed. Thus specify in the config of each modem the algorithm used by
the SIM Card. This attribute is used add subscriber_add() time, when the
IMSI, KI and algorithm to use in the MSC to authenticate a given
subscriber is stored in the database. This way we can easily set up
a specific algorithm for each SimCard/Modem, in case different SimCards
are configured with different algorithms.
This can be used to specificially test different algorithms too. For
instance, let's imagine we have 2 simcards, one configured to use comp128v1
and another one with xor, and we create a test which ckecks that XOR is
algo is working fine. We don't want to accidentally select the modem
with comp128v1 in this case. Thus we can use this attribute to create a
scenario file matching 'auth_algo: xor' to ensure always the correct
modem is picked.
Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce
Nowadays encryption parameter in bsc needs to be set to the same cipher as
the one specified in msc, otherwise the cipher negotation will fail.
See OS#2461 for more information on the matter.
Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19
We may want to support running a device which runs its own TRX
(osmo-trx or different implementation). Furthermore, this TRX may be
available in some specific hwardare rather than on the main unit.
This makes it easy to configure OsmoBtsTrx to launch it's own
osmo-trx or not. In case it is launched, all IPs are configured correctly
to ensure connection can be established.
Before this commit, osmo-trx was binding to 127.0.0.1. Now we can
support multiple osmo-trx being launched on the main unit.
Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8
This is useful for tests that wants to fake a bad KI to test if auth and
encryption are working correctly.
Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb
This is useful to see for instance the returned values from NITB when
asked for active subscribers.
Change-Id: I5c616646da360457930888b54d9019b76f05fe2f
The log levels changed are useful to understand clock failures we see
from time to time in osmo-gsm-tester. See OS-2325.
Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81
When splitting osmo-trx to its own class the env injection part was
removed because it seemed not needed as it has no dependencies included
by default in the trial.
However, it may still be required by the osmo-gsm-tester main unit to
launch osmo-gsm-tester with LD_PRELOAD_PATH to point to specific
versions of libuhd, so let's add the env injection back in there.
Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36
Openbsc has SMS Delivery Reports since recently, which means we are now
receiving deliver_sm messages and this workaround introduced in commit
db0d8ab4fc is not required anymore.
Closes OS-#2353.
Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921
In the future, some environments/products may come with a trx interface
pre-installed. Start work to easily disable launching it.
Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa
SMPP specs say message reference is 16 bits field.
However, message reference field in GSM03.40 spec is only 8 bits.
Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c
I take the chance to also swap the two log parameters, because they are
included into a dictionary and shown in swapped order in the log anyway,
which distracts me every time I look at the values.
Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f
In the following example setup, if osmo-nitb is listening
on 10.42.42.2, we want to return eth1:0 instead of eth1.
ip addr show eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0d:b9:35:3a:41 brd ff:ff:ff:ff:ff:ff
inet 10.42.42.1/24 brd 10.42.42.255 scope global eth1
valid_lft forever preferred_lft forever
inet 10.42.42.2/24 brd 10.42.42.255 scope global secondary eth1:0
valid_lft forever preferred_lft forever
inet 10.42.42.3/24 brd 10.42.42.255 scope global secondary eth1:1
valid_lft forever preferred_lft forever
Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
In commit 6100b629e5 I assumed esme
already had a cleanup function, which doesn't seem to be the case. This
means if a test calls esme.connect() and fails afterwards without
calling esme.disconnect(), the connection will be kept but as the test
will finish and the NITB is closed, then the connection will be kept
forever in an erroneous state. With the cleanup function we ensure we
will close the connection after the test.
Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config
item is being removed. To be able to test it, drop the settsc option from the
config.
Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
Otherwise osmo-bts stores the socket file in /tmp. If an earlier
instance doesn't finish cleanly, the file is left there and a new
instance will fail to start because it cannot create a new socket file
in the same place.
Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b
Let's accept that during cleanup time some stuff may not be in a good
state, specially in case of a failure, but let's keep harder to clean
up everything as much as possible.
This should fix an issue in which after a test failure using an esme object,
an smpp connection is kept in a buggy state and never removed/cleaned up, and
makes all tests after it fail too because the conn is triggered at
poll() time:
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 260, in run_tests
self.objects_cleanup()
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/suite.py", line 199, in objects_cleanup
obj.cleanup()
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 345, in cleanup
self.dbus.cleanup()
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 170, in cleanup
self.set_powered(False)
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 304, in set_powered
self.set_bool('Powered', powered)
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 295, in set_bool
event_loop.poll()
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/event_loop.py", line 39, in poll
func()
File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/esme.py", line 78, in poll
self.client.poll()
File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 321, in poll
self.read_once(ignore_error_codes)
File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 279, in read_once
p = self.read_pdu()
File "/usr/local/lib/python3.4/dist-packages/smpplib/client.py", line 206, in read_pdu
raise exceptions.ConnectionError()
smpplib.exceptions.ConnectionError
Change-Id: Ie7ef9284490f12f5cfd76c35b33b57eefab20eb6
Sometimes in test esme_ms_sms_transaction.py we get the following error:
esme_ms_sms_transaction.py:54: ERR: ValueError: list.remove(x): x not in list
This appears due to a race condition because sms_send is used several times,
which means we don't wait or sync until we receive the response before calling
sms_send_wait_resp. That means when we wait for response of message with
seqnum X, we may receive response from message seqnum X-1 which was
initiated by sms_send and thus was not stored in the self.pdus_pending
array. As it's not there, trying to remove it triggers an exception.
Change-Id: Idf49f40eb46be1448b328a5c338ddbc4547148ff
esme: Add several bits to handle logic required by tests:
- Allow specifying the mode used to send an sms
- Add a parameter to ask to receive a Delivery receipt for that message
- Add sms_send_wait_resp API, which waits until the response message for
a given smpp message is received when sending an sms.
- Add receipt_was_received API, which together with
message_received_handler maintains state of the delivery receipts we
asked for and were still not received. However, the check needs to be
disabled for now because OsmoNITB doens't seem to be sending stuff
properly, see OsmoNITB #2353.
- On message_received_handler, also print alert_notification messages,
to show that there's actually a bug in OsmoNITB, see #2352.
Move old esme_ms_sms to esme_ms_sms_transaction, and explicitly state
that we are using that mode. On the same test, we can now enable the
part which asserts that sending an SMS to an msisdn with unknown
destination triggers an error. The issue was mainly that the error had
to come from the SMSC server response, not from the sent message, so
we have to wait for the response to have the failure triggered.
Finally, add esme_ms_sms_storeforward, which tests features for sms sent
using that mode, and uses the APIs described above.
Change-Id: Ia2c0c325fee14143deca8310312fc530cd9ce92e
As described in https://osmocom.org/issues/2380 and related gerrit
patch https://gerrit.osmocom.org/#/c/3306 the config files currently
contain timers with a 'zero' value, leading to issues.
The config file templates used in osmo-gsm-tester suffer actually
from exactly the same issue: They basically contain values that were
written back to the file based on the default initialization in libbsc,
which unfortunately was zero in some cases.
Let's remove those values, they are the (bad) default anyway.
libbsc patches in the pipeline will introduce reasonable defaults
and forbid the use of zero for timers.
Change-Id: I8cde29a597a17c2659b3b87268be4b12975f4bef
This is useful while debugging and trying to check events across other
outputs such as pcap files, process logs, etc.
Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8
According to pespin, this makes all osmo-bts-trx test runs fail.
We will still figure out the details, but for the time being
let's go with the known working config.
This reverts commit 72ded64705.
Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048
In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config
item is being removed. To be able to test it, drop the settsc option from the
config.
Change-Id: I89b35fc587bbac6810511b2317eed24368858f37
With this patch, the same errors are still happening.
This is not a solution, so drop this again.
This reverts commit 6c8d9497f2.
Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3
As defined in [1], the different related actors are implemented in this
commit: ESME and SMSC.
SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or
the MSC. A new Smsc abstract class is created to shared code between the
NITB and the MSC, and also makes it easier for later when the SMSC is
splitted. ESMEs can be dynamically added to its configuration in a
similar way to how the BTSs are added.
ESME: A new class Esme is created which can be used by tests to control
an ESME to interact with the SMSC. The ESME functionalities are
implemented using python-smpplib. Required version of this library is at
least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support
for python 3 and some required features to poll the socket.
This commit already contains a few tests which checks different
features and tests the API. Extending tested features or scenarios can be
later done quite easily.
The tests are not enabled by default right now, because there are several
of them in a suite and the ip_address resources are not freed after every
tests which ends up in the suite failing due to missing reserved
resources. All the tests run alone work though. When the issue is fixed
they can then be added to the default list of tests to be run.
[1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf
Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da
Fix bug in put_all(). That method was unused before this commit.
Clean the process list after the processes are stopped,
otherwise the suite eventually fails with a 'process terminated
prematurely' error. Before it was not necessary because it was not
reused (a new suite run was created).
Change-Id: Iee12866045145544076c6c18786e1a54f18fc293
Processes created have the scope of the test, so we should store
everything in a per-suite_run/per-test directory, otherwise everything
is stored in the same trial run_dir directory and it's really messy.
Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957
We get sporadic clock skews when running osmo-bts-trx, causing the process to
end and the test to fail. Try to give some seconds for the osmo-trx process to
sort itself out, in the hope to avoid the clock skews.
Related: OS#2325
Change-Id: I82d29358498e7ad9fef28d409808168926e2f876
This commit should fix issue described #2326, in which a test started
scanning and quickly afterwards failed, leaving the async Scan() method
running and the response arriving when we were already in another
suite/test.
Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d
We have sporadic osmo-bts-trx shutdowns with "No clock from osmo-trx" error
messages. Around it are L1C logs on level 'notice', so let's log those as well.
Related: OS#2325
Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b
method raise_exn was removed in
1a7a3f0e43, but due to merge process it
remaine dbeing used in some places.
Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19
ofono's NetworkRegistration.Scan() method fails sporadically. On failure,
check if we are now registered to the desired network, and schedule another
scan otherwise.
For instance it fails with org.ofono.Error.Failed if the modem starts to
register internally after we started Scan() and the registering succeeds
while we are still waiting for Scan() to finsih.
Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
With the recent fix of the junit report related issues, another issue arose:
the 'with log.Origin' was changed to disallow __enter__ing an object twice to
fix problems, now still code would fail because it tries to do 'with' on the
same object twice. The only reason is to ensure that logging is associated with
a given object. Instead of complicating even more, implement differently.
Refactor logging to simplify use: drop the 'with Origin' style completely, and
instead use the python stack to determine which objects are created by which,
and which object to associate a log statement with.
The new way: we rely on the convention that each class instance has a local
'self' referencing the object instance. If we need to find an origin as a new
object's parent, or to associate a log message with, we traverse each stack
frame, fetching the first local 'self' object that is a log.Origin class
instance.
How to use:
Simply call log.log() anywhere, and it finds an Origin object to log for, from
the stack. Alternatively call self.log() for any Origin() object to skip the
lookup.
Create classes as child class of log.Origin and make sure to call
super().__init__(category, name). This constructor will magically find a parent
Origin on the stack.
When an exception happens, we first escalate the exception up through call
scopes to where ever it is handled by log.log_exn(). This then finds an Origin
object in the traceback's stack frames, no need to nest in 'with' scopes.
Hence the 'with log.Origin' now "happens implicitly", we can write pure natural
python code, no more hassles with scope ordering.
Furthermore, any frame can place additional logging information in a frame by
calling log.ctx(). This is automatically inserted in the ancestry associated
with a log statement / exception.
Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90
A new mcc_mnc parameter is now optionally passed to connect() in order
to manually register to a specific network with a given MCC+MNC pair.
If no parameter is passed (or None), then the modem will be instructed
to attempt an automatic registration with any available network which
permits it.
We get the MCC+MNC parameter from the MSC/NITB and we pass it to the
modem object at connect time as shown in the modified tests. Two new
simple tests to check network registration is working are added in this
commit.
Ofono modems seem to be automatically registering at some point after
they are set Online=true, and we were actually using that 'feature'
before this patch. Thus, it is possible that a modem quickly becomes
registered, and we then check so before starting the scan+registration
process, which can take a few seconds.
The scanning method can take a few seconds to complete. To avoid
blocking in the dbus ofono Scan() method, this commit adds some code to
make use of glib/gdbus async methods, which are not yet supported
directly by pydbus. This way, we can continue polling while waiting for
the scan process to complete and we can register several modems in
parallel. When scan completes, a callback is run which attempts to
register. If no MCC+MNC was passed, as we just finished scanning the
modem should have enough fresh operator information to take good and
quick decisions on where to connect. If we have an MCC+MNC, then we check
the operator list received by Scan() method. If operator with desired
MCC+MNC is there, we register with it. If it's not there, we start
scanning() again asynchronously hoping the operator will show up in next
scan.
As scanning() and registration is done in the background, tests are
expected to call connect(), and then later on wait for the modem to
register by waiting/polling the method "modem.is_connected()". Tests
first check for the modem being connected and after with MSC
subscriber_attached(). The order is intentional because the later has to
poll through network and adds unneeded garbage to the pcap files bein
recorded.
Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c
Even if aborted due to signal, write a JUnit report XML, and make sure to
indicate the runs as erratic.
Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4