Osmocom Mobile Switching Centre
Go to file
Vadim Yanitskiy e1e7247500 Introduce initial unit test for db_sms_* API
Since OsmoMSC has built-in SMSC, it needs to store the messages
somewhere. Currently we use libdbi and SQLite3 back-end for that.

For a long time, the db_sms_* API remained uncovered by unit tests.
This change aims to fix that, and does cover the following calls:

  - db_sms_store(),
  - db_sms_get(),

  - db_sms_get_next_unsent(),
  - db_sms_mark_delivered(),

  - db_sms_delete_sent_message_by_id(),
  - db_sms_delete_by_msisdn(),
  - db_sms_delete_oldest_expired_message().

Due to performance reasons, the test database is initialized in
RAM using the magic filename ':memory:'. This is a feature of
SQLite3 (and not libdbi), see:

  https://www.sqlite.org/inmemorydb.html

Of course, this unit test helped to discover some problems:

  1) Storing an SMS with empty TP-User-Data (TP-UDL=0) causes
     buffer overruns in both db_sms_store() and db_sms_get().

  2) TP-User-Data-Length is always being interpreted in octets,
     regardless of DCS (Data Coding Scheme). This results in
     storing garbage in the database if the default 7-bit
     encoding is used. Fortunately, the 'user_data' buffer
     in structure 'gsm_sms' is large emough, so we don't
     experience buffer overruns.

  3) db_sms_delete_oldest_expired_message() doesn't work
     as expected. Instead of removing the *oldest* expired
     message, it tries to remove the *newest* one.

The current test expectations do reflect these problems.
All of them will be fixed in the follow-up patches.

Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3
2019-06-03 17:28:35 +07:00
contrib contrib: fix makedistcheck with disabled systemd 2018-12-06 16:31:01 +00:00
debian debian: create -doc subpackage with pdf manuals 2019-05-29 12:14:16 +02:00
doc debian: create -doc subpackage with pdf manuals 2019-05-29 12:14:16 +02:00
include Use GSM23003_MSISDN_MAX_DIGITS from libosmogsm 2019-05-29 08:48:16 +00:00
m4 move openbsc/* to repos root 2017-07-12 23:17:10 +00:00
src Introduce initial unit test for db_sms_* API 2019-06-03 17:28:35 +07:00
tests Introduce initial unit test for db_sms_* API 2019-06-03 17:28:35 +07:00
.gitignore rename bscconfig.h to config.h, cleanup 2019-05-08 17:02:32 +02:00
.gitreview update .gitreview to new repo url 2017-08-08 17:26:28 +02:00
.mailmap add .mailmap file for mapping git author name/mail in shortlog 2016-08-08 17:40:28 +00:00
AUTHORS move openbsc/* to repos root 2017-07-12 23:17:10 +00:00
COPYING move openbsc/* to repos root 2017-07-12 23:17:10 +00:00
Makefile.am Fix DISTCHECK_CONFIGURE_FLAGS override 2018-12-04 15:37:37 +01:00
README rewrite README 2017-09-06 16:33:41 +02:00
README.vty-tests Remove obsolete ./configure option 2017-11-29 14:24:54 +00:00
configure.ac Introduce initial unit test for db_sms_* API 2019-06-03 17:28:35 +07:00
git-version-gen git-version-gen: Don't check for .git directory 2018-07-24 18:05:46 +02:00
osmoappdesc.py doc/examples: add detailed cs7 config examples 2017-09-07 03:10:36 +02:00

README

About OsmoMSC
=============

OsmoMSC originated from the OpenBSC project, which started as a minimalistic
all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached
maturity and diversity (including M3UA SIGTRAN and 3G support in the form of
IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one
approach to fully independent separate programs as in typical GSM networks.

OsmoMSC was one of the parts split off from the old openbsc.git. Before, it was
the libmsc part of the old OsmoNITB. Since a true A interface and IuCS for 3G
support is available, OsmoMSC exists only as a separate standalone entity.

OsmoMSC exposes
- GSUP towards OsmoHLR (or a MAP proxy);
- A over IP towards a BSC (e.g. OsmoBSC);
- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice;
- MNCC (Mobile Network Call Control derived from GSM TS 04.07);
- SMPP 3.4 (Short Message Peer-to-Peer);
- The Osmocom typical telnet VTY and CTRL interfaces.

Find OsmoMSC issue tracker and wiki online at
https://osmocom.org/projects/osmomsc
https://osmocom.org/projects/osmomsc/wiki