aboutsummaryrefslogtreecommitdiffstats
path: root/suites/aoip_smpp/esme_connect_policy_acceptall.py
blob: 82d4f862b2fee6e24c2aee1396415d1dc31d5a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3

# This test checks following use-cases while in 'accept-all' policy:
# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on
#   the config file

from osmo_gsm_tester.test import *

hlr = suite.hlr()
bts = suite.bts() # bts not started, only needed for mgw
mgw = suite.mgw(bts_ip=bts.remote_addr())
msc = suite.msc(hlr, mgw)
smsc = msc.smsc
esme = suite.esme()

# Here we deliberately omit calling smsc.esme_add() to avoid having it included
# in the smsc config.
smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL)
esme.set_smsc(smsc)

hlr.start()
msc.start()
mgw.start()

# Due to accept-all policy, connect() should work even if we didn't previously
# configure the esme in the smsc, no matter the system_id / password we use.
log('Test connect with non-empty values in system_id and password')
esme.set_system_id('foo')
esme.set_password('bar')
esme.connect()
esme.disconnect()

log('Test connect with empty values in system_id and password')
esme.set_system_id('')
esme.set_password('')
esme.connect()
esme.disconnect()