From 2d16f6fd2c88844c9e9b5257795cdc85877e6235 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 30 May 2017 15:33:57 +0200 Subject: Add support for SMPP testing 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 --- src/osmo_gsm_tester/osmo_nitb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/osmo_gsm_tester/osmo_nitb.py') diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 484358e..3ef5276 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,7 +21,7 @@ import os import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoNitb(log.Origin): suite_run = None @@ -30,12 +30,14 @@ class OsmoNitb(log.Origin): config_file = None process = None bts = None + smsc = None def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address self.bts = [] + self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-nitb') @@ -75,6 +77,7 @@ class OsmoNitb(log.Origin): for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + config.overlay(values, self.smsc.get_config()) self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) -- cgit v1.2.3