Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 1 | #!/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 Pedrol | dfe38ad | 2017-11-09 13:57:39 +0100 | [diff] [blame] | 7 | from osmo_gsm_tester.testenv import * |
Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 8 | |
| 9 | hlr = suite.hlr() |
| 10 | bts = suite.bts() # bts not started, only needed for mgcpgw |
| 11 | mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) |
Pau Espin Pedrol | 1e1d381 | 2017-11-16 18:06:37 +0100 | [diff] [blame] | 12 | stp = suite.stp() |
| 13 | msc = suite.msc(hlr, mgcpgw, stp) |
Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 14 | smsc = msc.smsc |
| 15 | esme = suite.esme() |
| 16 | |
| 17 | # Here we deliberately omit calling smsc.esme_add() to avoid having it included |
| 18 | # in the smsc config. |
| 19 | smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) |
| 20 | esme.set_smsc(smsc) |
| 21 | |
Pau Espin Pedrol | 1e1d381 | 2017-11-16 18:06:37 +0100 | [diff] [blame] | 22 | stp.start() |
Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 23 | hlr.start() |
| 24 | msc.start() |
| 25 | mgcpgw.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. |
| 29 | log('Test connect with non-empty values in system_id and password') |
| 30 | esme.set_system_id('foo') |
| 31 | esme.set_password('bar') |
| 32 | esme.connect() |
| 33 | esme.disconnect() |
| 34 | |
| 35 | log('Test connect with empty values in system_id and password') |
| 36 | esme.set_system_id('') |
| 37 | esme.set_password('') |
| 38 | esme.connect() |
| 39 | esme.disconnect() |