blob: ef5db4ead7a8825789409492f071d579bf49f02e [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()
10bts = suite.bts() # bts not started, only needed for mgcpgw
11mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
Pau Espin Pedrol1e1d3812017-11-16 18:06:37 +010012stp = suite.stp()
13msc = suite.msc(hlr, mgcpgw, stp)
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +020014smsc = msc.smsc
15esme = suite.esme()
16
17# Here we deliberately omit calling smsc.esme_add() to avoid having it included
18# in the smsc config.
19smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL)
20esme.set_smsc(smsc)
21
Pau Espin Pedrol1e1d3812017-11-16 18:06:37 +010022stp.start()
Pau Espin Pedrol2d16f6f2017-05-30 15:33:57 +020023hlr.start()
24msc.start()
25mgcpgw.start()
26
27# Due to accept-all policy, connect() should work even if we didn't previously
28# configure the esme in the smsc, no matter the system_id / password we use.
29log('Test connect with non-empty values in system_id and password')
30esme.set_system_id('foo')
31esme.set_password('bar')
32esme.connect()
33esme.disconnect()
34
35log('Test connect with empty values in system_id and password')
36esme.set_system_id('')
37esme.set_password('')
38esme.connect()
39esme.disconnect()