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 | |
Pau Espin Pedrol | 40c7bc7 | 2020-05-05 13:41:42 +0200 | [diff] [blame] | 9 | hlr = tenv.hlr() |
| 10 | mgw_msc = tenv.mgw() |
| 11 | stp = tenv.stp() |
| 12 | msc = tenv.msc(hlr, mgw_msc, stp) |
Pau Espin Pedrol | 4385780 | 2018-09-13 15:07:27 +0200 | [diff] [blame] | 13 | smsc = msc.smsc |
Pau Espin Pedrol | 40c7bc7 | 2020-05-05 13:41:42 +0200 | [diff] [blame] | 14 | esme = tenv.esme() |
Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 15 | |
| 16 | # Here we deliberately omit calling smsc.esme_add() to avoid having it included |
| 17 | # in the smsc config. |
| 18 | smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) |
| 19 | esme.set_smsc(smsc) |
| 20 | |
Pau Espin Pedrol | 4385780 | 2018-09-13 15:07:27 +0200 | [diff] [blame] | 21 | stp.start() |
| 22 | hlr.start() |
| 23 | msc.start() |
| 24 | mgw_msc.start() |
Pau Espin Pedrol | 2d16f6f | 2017-05-30 15:33:57 +0200 | [diff] [blame] | 25 | |
| 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. |
| 28 | log('Test connect with non-empty values in system_id and password') |
| 29 | esme.set_system_id('foo') |
| 30 | esme.set_password('bar') |
| 31 | esme.connect() |
| 32 | esme.disconnect() |
| 33 | |
| 34 | log('Test connect with empty values in system_id and password') |
| 35 | esme.set_system_id('') |
| 36 | esme.set_password('') |
| 37 | esme.connect() |
| 38 | esme.disconnect() |