blob: 2a954d53eecb500acfa68369cc25edad66ebb00f [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
7from osmo_gsm_tester.test import *
8
9hlr = suite.hlr()
10bts = suite.bts() # bts not started, only needed for mgcpgw
11mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
12msc = suite.msc(hlr, mgcpgw)
13smsc = 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
21hlr.start()
22msc.start()
23mgcpgw.start()
24
25# Due to accept-all policy, connect() should work even if we didn't previously
26# configure the esme in the smsc, no matter the system_id / password we use.
27log('Test connect with non-empty values in system_id and password')
28esme.set_system_id('foo')
29esme.set_password('bar')
30esme.connect()
31esme.disconnect()
32
33log('Test connect with empty values in system_id and password')
34esme.set_system_id('')
35esme.set_password('')
36esme.connect()
37esme.disconnect()