Commit Graph

256 Commits

Author SHA1 Message Date
Neels Hofmeyr 936a81ec1a fix util.py/FileLock and lock_test
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
2017-09-14 01:52:32 +02:00
Neels Hofmeyr c28769488e add jenkins-make-check-and-run.sh
Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4
2017-09-14 00:21:18 +02:00
Pau Espin 32cab3f5c7 bts_osmotrx: Fix mkdtemp use in python < 3.5
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
2017-09-13 22:21:10 +00:00
Neels Hofmeyr a8647f304c fix build: properly remove artifacts
The jenkins scripts are run by sh, which does not support the {a,b} syntax
shell glob. As a result, old build artifacts pile up in the workspaces.
Use two separate lines to remove .tgz and .md5.

Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913
2017-09-13 19:17:54 +02:00
Pau Espin 15aae98cf0 Use tmpdir to create bts pcu-socket
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
2017-09-12 14:42:09 +00:00
Pau Espin 4e36f7c0c7 resource: Fix list comparison in item_matches
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
2017-09-10 12:30:35 +00:00
Pau Espin 77631215f7 modem: log property changes from Modem interface
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
2017-09-09 18:36:49 +00:00
Pau Espin ee6e4912a4 modem: Include serial attribute in info()
Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30
2017-09-09 18:36:48 +00:00
Neels Hofmeyr ebc7426f85 jenkins: properly clean previous artifacts
Drop the second 'rm -f' from the rm shell command (typo).

Remove all artifacts matching *.build-*.{tgz,md5} because if a job changes the
name of its artifact, the previous artifacts would remain.

(I hit this with the new scripts being originally wrong and all producing
'osmo-msc.*' artifacts, and those stuck around in the workspace even after the
name was fixed.)

Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714
2017-09-07 18:34:07 +02:00
Neels Hofmeyr 36e0404f45 jenkins: build from new osmo-{msc,bsc,mgw,sgsn} repositories
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
2017-09-07 00:59:46 +02:00
Neels Hofmeyr 713a1201d2 jenkins-common: ensure requested binaries indeed have been built
Recent change Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 drops binaries from a
build artifact by leaving only explicitly requested ones. This adds a check
that the requested ones indeed exist.

Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db
2017-09-07 00:59:46 +02:00
Neels Hofmeyr 1921c0f6c9 jenkins: per build, drop programs built "unintentionally"
Each of the jenkins-build-* scripts intends to build a specific set of
programs. While compiling dependencies, other programs may end up in
$prefix/bin. Drop those other binaries to reduce potential confusion.

Add arguments to the create_bin_tgz function: callers need to list exactly the
$prefix/bin/* binaries that should be tar'd. All others are first removed from
the prefix.

Adjust existing scripts to provide such binary names.

Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45
2017-09-05 01:21:25 +02:00
Pau Espin d3fce46f58 contrib: Add scripts to build osmo-pcu
Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab
2017-08-31 17:23:26 +02:00
Pau Espin c54c294df3 default-suites.conf: Add suites to explicitly test with sysmoCell5000
Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90
2017-08-25 14:47:46 +00:00
Pau Espin 7423d2e584 modem: Attempt fixing crash from Register() dbus method
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
2017-08-25 13:07:46 +02:00
Pau Espin e913e3719a Introduce aoip_encryption suite
This suite aims testing different authentication and encryption setups.

Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10
2017-08-24 18:09:07 +02:00
Pau Espin 3fa6e12b78 schema: Remove uneeded TRX_REMOTE_IP validate type
Attribute trx_remote_ip is actually using IPv4 validate type, thus this
validate type is not needed.

Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99
2017-08-24 17:09:12 +02:00
Pau Espin 713ce2cf86 Introduce auth_algo modem config attribute
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
2017-08-24 17:09:11 +02:00
Pau Espin 387526aa99 bsc: Allow tests to select network encryption
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
2017-08-24 15:16:03 +02:00
Pau Espin b5a8614933 Add support for authentication VTY param in msc and bsc
Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f
2017-08-23 17:40:29 +02:00
Pau Espin 0755cdb138 hlr: Implement subscriber_delete API
Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713
2017-08-23 17:03:48 +02:00
Pau Espin 6610dfe0f5 hlr: Use python module instead of cmdline to modify sqlite db
Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7
2017-08-23 17:02:38 +02:00
Pau Espin e1a26224e7 nitb: Introduce subscriber_delete API
Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b
2017-08-23 15:52:14 +02:00
Pau Espin 132e9fe6d3 nitb: ctrl: Remove unused return statement in subscriber_add
In case of failure an exception is raised. If everything goes well no
need to return True.

Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5
2017-08-23 15:50:50 +02:00
Pau Espin abc8fa5da1 hlr: fill auc_2g table when registering a subscriber
Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d
2017-08-23 15:21:57 +02:00
Pau Espin b33fe85442 Add scenarios for each osmo-bts-trx type
This way we can run tests with a specific instance of an osmo-bts-trx,
for instance we may want to run some tests with an Ettus B200 and also
with a sysmoCell 5000.

Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde
2017-08-23 12:56:40 +00:00
Pau Espin 404e150c69 bts_osmotrx: Support configuring bts addr, trx_remote_ip and launch_trx
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
2017-08-23 12:56:40 +00:00
Pau Espin 5df8dd2a2a resources.conf: Remove empty line
Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255
2017-08-23 12:56:40 +00:00
Pau Espin cd6ad9d519 modem: Allow tests to change KI
This is useful for tests that wants to fake a bad KI to test if auth and
encryption are working correctly.

Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb
2017-08-23 12:55:43 +00:00
Pau Espin ca126b1d82 Allow tests to select network encryption
Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac
2017-08-23 12:55:30 +00:00
Pau Espin 66c96c3c8e ctrl: Add dbg log to print received data
This is useful to see for instance the returned values from NITB when
asked for active subscribers.

Change-Id: I5c616646da360457930888b54d9019b76f05fe2f
2017-08-23 10:48:07 +02:00
Pau Espin 8d7a2e343b Increase log verbosity for osmo-bts-trx
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
2017-08-21 19:32:00 +02:00
Pau Espin 80a5c77821 bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx
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
2017-08-21 19:03:10 +02:00
Pau Espin 3169ffbaef esme: Remove temporary workaround for non-implemented deliver_sm
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
2017-08-18 19:19:16 +00:00
Pau Espin 4773853cb0 Split osmo-trx from osmo-bts-trx
In the future, some environments/products may come with a trx interface
pre-installed. Start work to easily disable launching it.

Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa
2017-08-18 07:58:52 +00:00
Pau Espin 5adb5c7405 esme: user_message_referece values should be smaller than 256
SMPP specs say message reference is 16 bits field.
However, message reference field in GSM03.40 spec is only 8 bits.

Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c
2017-08-17 17:58:02 +02:00
Pau Espin 69373b3201 esme: smpp pdu field is a string and needs conversion
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
2017-08-17 17:05:08 +02:00
Pau Espin 74a7676eb1 util: ip_to_iface: Return secondary iface if present
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
2017-08-10 12:12:07 +02:00
Pau Espin ac9c1bb32f esme: Add cleanup function to avoid cascade failure of tests
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
2017-08-10 10:59:43 +02:00
Neels Hofmeyr a10aeaea4b osmo-bts-trx config: remove settsc
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
2017-08-10 10:25:48 +02:00
Pau Espin 329b6f446c Set osmo-bts pcu-socket config to point to run dir
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
2017-08-09 11:01:52 +00:00
Neels Hofmeyr 4008b69bbe cosmetic: osmo-msc.cfg.tmpl: fix indent
Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a
2017-08-07 14:18:09 +02:00
Neels Hofmeyr a64ab702aa aoip: add newly needed osmo-msc point-code config
OsmoMSC no longer has a hard-coded point-code of 0.0.1. Configure it.

Change-Id: I54be984415445e695c583f35c419aed559ac5c84
2017-08-07 14:17:13 +02:00
Alexander Couzens 2ec075dede osmo-bsc.cfg.tmpl: add point code addresses
osmo-bsc requires atm to have point code addresses given for msc + bsc

Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2
2017-08-07 13:45:08 +02:00
Pau Espin 6100b629e5 suite: Don't stop cleanup of objects on cleanup exception
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
2017-07-31 18:19:08 +02:00
Pau Espin 522ae68b08 esme: Log connection parameters of the SMSC
Change-Id: Ie4d3019503a68b02ace849defe618bdc74eacbd9
2017-07-31 17:25:15 +02:00
Pau Espin 91c75b38f1 esme: Fix race condition waiting for message response
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
2017-07-20 22:51:52 +02:00
Pau Espin 4a22ac7d2c aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue
A test case checked in that test is known to be failing at the moment
due to missing correct implementation bits for AoIP software.

Comment it in a separate commit so that is easy to revert it once we
have it implemented.

See OsmoSMSC #2354 for more information.

Change-Id: I12f8dbe1d6dc9a554438fda1e38b2e5e3245c320
2017-07-20 16:56:08 +00:00
Pau Espin db0d8ab4fc Improve SMPP supported features and test coverage
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
2017-07-20 16:56:08 +00:00
Harald Welte ddf78124f8 remove timer section from osmo-{bts,bsc}.cfg.tmpl
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
2017-07-20 11:54:49 +02:00