blob: 168b4f3a36e4afd6e15acd91313ac88d07b9a13f [file] [log] [blame]
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +02001#!/usr/bin/env python3
2
3# This test checks following use-cases while in 'accept-all' policy:
4# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on
5# the config file
6
Pau Espin Pedroldfe38ad2017-11-09 13:57:39 +01007from osmo_gsm_tester.testenv import *
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +02008
9hlr = suite.hlr()
Pau Espin Pedrol86ea02f2018-02-26 12:14:46 +010010mgw_msc = suite.mgw()
Pau Espin Pedrol1e1d3812017-11-16 18:06:37 +010011stp = suite.stp()
Pau Espin Pedrol86ea02f2018-02-26 12:14:46 +010012msc = suite.msc(hlr, mgw_msc, stp)
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +020013smsc = msc.smsc
14esme = suite.esme()
15
16# Here we deliberately omit calling smsc.esme_add() to avoid having it included
17# in the smsc config.
18smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL)
19esme.set_smsc(smsc)
20
Pau Espin Pedrol1e1d3812017-11-16 18:06:37 +010021stp.start()
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +020022hlr.start()
23msc.start()
Pau Espin Pedrol86ea02f2018-02-26 12:14:46 +010024mgw_msc.start()
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +020025
26# Due to accept-all policy, connect() should work even if we didn't previously
27# configure the esme in the smsc, no matter the system_id / password we use.
28log('Test connect with non-empty values in system_id and password')
29esme.set_system_id('foo')
30esme.set_password('bar')
31esme.connect()
32esme.disconnect()
33
34log('Test connect with empty values in system_id and password')
35esme.set_system_id('')
36esme.set_password('')
37esme.connect()
38esme.disconnect()