[PATCH] osmo-gsm-tester[master]: Require OsmoMgw in OsmoBsc and update tests

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Nov 9 12:16:26 UTC 2017


Review at  https://gerrit.osmocom.org/4758

Require OsmoMgw in OsmoBsc and update tests

Since Change-Id Ia2882b7ca31a3219c676986e85045fa08a425d7a, osmo-bsc
uses osmo-mgw and utilizes libosmo-mgcp-client to talk to it.

This commit fixes latest constant failures in voice suite.

Change-Id: I1dadd781a357fce33e7bde55e4bcbdaeb4633359
---
M example/resources.conf
M src/osmo_gsm_tester/osmo_bsc.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
M suites/aoip_debug/interactive.py
M suites/aoip_debug/suite.conf
M suites/aoip_encryption/register_a5_0_authopt.py
M suites/aoip_encryption/register_a5_0_authreq.py
M suites/aoip_encryption/register_a5_1_authreq.py
M suites/aoip_encryption/suite.conf
M suites/aoip_smpp/esme_ms_sms_storeforward.py
M suites/aoip_smpp/esme_ms_sms_transaction.py
M suites/aoip_smpp/suite.conf
M suites/aoip_sms/mo_mt_sms.py
M suites/aoip_sms/suite.conf
M suites/aoip_ussd/assert_extension.py
M suites/aoip_ussd/suite.conf
M suites/voice/mo_mt_call.py
M suites/voice/suite.conf
19 files changed, 50 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/4758/1

diff --git a/example/resources.conf b/example/resources.conf
index c4c5e31..697b5c8 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -6,6 +6,7 @@
 - addr: 10.42.42.4
 - addr: 10.42.42.5
 - addr: 10.42.42.6
+- addr: 10.42.42.7
 
 bts:
 - label: sysmoBTS 1002
diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
index 5fbeea6..736fe8f 100644
--- a/src/osmo_gsm_tester/osmo_bsc.py
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -30,13 +30,15 @@
     process = None
     bts = None
     encryption = None
+    mgw = None
 
-    def __init__(self, suite_run, msc, ip_address):
+    def __init__(self, suite_run, msc, mgw, ip_address):
         super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr'))
         self.suite_run = suite_run
         self.ip_address = ip_address
         self.bts = []
         self.msc = msc
+        self.mgw = mgw
 
     def start(self):
         self.log('Starting osmo-bsc')
@@ -73,6 +75,7 @@
         values = dict(bsc=config.get_defaults('bsc'))
         config.overlay(values, self.suite_run.config())
         config.overlay(values, dict(bsc=dict(ip_address=self.ip_address)))
+        config.overlay(values, self.mgw.conf_for_client())
 
         bts_list = []
         for bts in self.bts:
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 4b33abc..dd1baf8 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -25,7 +25,7 @@
 import pprint
 from . import config, log, template, util, resource, schema, modem, event_loop, esme, sms
 from . import osmo_nitb
-from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp
+from . import osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp
 from . import test
 
 class Timeout(Exception):
@@ -327,15 +327,20 @@
             ip_address = self.ip_address()
         return osmo_mgcpgw.OsmoMgcpgw(self, ip_address, bts_ip)
 
+    def mgw(self, ip_address=None):
+        if ip_address is None:
+            ip_address = self.ip_address()
+        return osmo_mgw.OsmoMgw(self, ip_address)
+
     def msc(self, hlr, mgcpgw, ip_address=None):
         if ip_address is None:
             ip_address = self.ip_address()
         return osmo_msc.OsmoMsc(self, hlr, mgcpgw, ip_address)
 
-    def bsc(self, msc, ip_address=None):
+    def bsc(self, msc, mgw, ip_address=None):
         if ip_address is None:
             ip_address = self.ip_address()
-        return osmo_bsc.OsmoBsc(self, msc, ip_address)
+        return osmo_bsc.OsmoBsc(self, msc, mgw, ip_address)
 
     def stp(self, ip_address=None):
         if ip_address is None:
diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index d79bb2b..2f06710 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -74,7 +74,10 @@
  token msc_token_23_42
  core-mobile-country-code ${bsc.net.mcc}
  core-mobile-network-code ${bsc.net.mnc}
- ip.access rtp-base 8000
+ ip.access rtp-base 25000
+ mgw remote-ip ${mgw.ip_address.addr}
+ mgw remote-port 2427
+ mgw endpoint-range 1 31
  timeout-ping 1800
  timeout-ping advanced
  timeout-pong 60
diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py
index f09732b..cfa5d6c 100755
--- a/suites/aoip_debug/interactive.py
+++ b/suites/aoip_debug/interactive.py
@@ -3,8 +3,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 modems = suite.modems(int(prompt('How many modems?')))
 
@@ -12,6 +13,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 
 bsc.bts_add(bts)
 bsc.start()
diff --git a/suites/aoip_debug/suite.conf b/suites/aoip_debug/suite.conf
index bb343a5..d75cacb 100644
--- a/suites/aoip_debug/suite.conf
+++ b/suites/aoip_debug/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5
+  - times: 6
   bts:
   - times: 1
   modem:
diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py
index 0224ee0..6e5e459 100755
--- a/suites/aoip_encryption/register_a5_0_authopt.py
+++ b/suites/aoip_encryption/register_a5_0_authopt.py
@@ -4,8 +4,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms = suite.modem()
 
@@ -17,6 +18,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 bsc.bts_add(bts)
 bsc.start()
 bts.start()
diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py
index 114c628..428fc8d 100755
--- a/suites/aoip_encryption/register_a5_0_authreq.py
+++ b/suites/aoip_encryption/register_a5_0_authreq.py
@@ -4,8 +4,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms = suite.modem()
 
@@ -17,6 +18,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 bsc.bts_add(bts)
 bsc.start()
 bts.start()
diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py
index a84fa3a..59e3fac 100755
--- a/suites/aoip_encryption/register_a5_1_authreq.py
+++ b/suites/aoip_encryption/register_a5_1_authreq.py
@@ -4,8 +4,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms = suite.modem()
 
@@ -17,6 +18,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 bsc.bts_add(bts)
 bsc.start()
 bts.start()
diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf
index d6d0eee..18e94a3 100644
--- a/suites/aoip_encryption/suite.conf
+++ b/suites/aoip_encryption/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5 # msc, bsc, hlr, stp, mgw
+  - times: 6 # msc, bsc, hlr, stp, mgw*2
   bts:
   - times: 1
     ciphers:
diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py
index 308ebf3..d49401f 100755
--- a/suites/aoip_smpp/esme_ms_sms_storeforward.py
+++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py
@@ -15,8 +15,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 bsc.bts_add(bts)
 
@@ -28,6 +29,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 bsc.start()
 bts.start()
 
diff --git a/suites/aoip_smpp/esme_ms_sms_transaction.py b/suites/aoip_smpp/esme_ms_sms_transaction.py
index 8bcfb6b..6892a7e 100755
--- a/suites/aoip_smpp/esme_ms_sms_transaction.py
+++ b/suites/aoip_smpp/esme_ms_sms_transaction.py
@@ -13,8 +13,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 bsc.bts_add(bts)
 
@@ -26,6 +27,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 bsc.start()
 bts.start()
 
diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf
index 688fe0a..61e7015 100644
--- a/suites/aoip_smpp/suite.conf
+++ b/suites/aoip_smpp/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5 # msc, bsc, hlr, stp, mgw
+  - times: 6 # msc, bsc, hlr, stp, mgw*2
   bts:
   - times: 1
   modem:
diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py
index 217d807..a7c1f48 100755
--- a/suites/aoip_sms/mo_mt_sms.py
+++ b/suites/aoip_sms/mo_mt_sms.py
@@ -4,8 +4,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms_mo = suite.modem()
 ms_mt = suite.modem()
@@ -14,6 +15,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 
 bsc.bts_add(bts)
 bsc.start()
diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf
index 677a95e..28a81ea 100644
--- a/suites/aoip_sms/suite.conf
+++ b/suites/aoip_sms/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5 # msc, bsc, hlr, stp, mgw
+  - times: 6 # msc, bsc, hlr, stp, mgw*2
   bts:
   - times: 1
   modem:
diff --git a/suites/aoip_ussd/assert_extension.py b/suites/aoip_ussd/assert_extension.py
index 5e934db..36d6222 100755
--- a/suites/aoip_ussd/assert_extension.py
+++ b/suites/aoip_ussd/assert_extension.py
@@ -6,8 +6,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms = suite.modem()
 
@@ -15,6 +16,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 
 bsc.bts_add(bts)
 bsc.start()
diff --git a/suites/aoip_ussd/suite.conf b/suites/aoip_ussd/suite.conf
index 1da0cc5..460147a 100644
--- a/suites/aoip_ussd/suite.conf
+++ b/suites/aoip_ussd/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5 # msc, bsc, hlr, stp, mgw
+  - times: 6 # msc, bsc, hlr, stp, mgw*2
   bts:
   - times: 1
   modem:
diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py
index f426037..8cd3b23 100755
--- a/suites/voice/mo_mt_call.py
+++ b/suites/voice/mo_mt_call.py
@@ -4,8 +4,9 @@
 hlr = suite.hlr()
 bts = suite.bts()
 mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
 msc = suite.msc(hlr, mgcpgw)
-bsc = suite.bsc(msc)
+bsc = suite.bsc(msc, mgw_bsc)
 stp = suite.stp()
 ms_mo = suite.modem()
 ms_mt = suite.modem()
@@ -14,6 +15,7 @@
 stp.start()
 msc.start()
 mgcpgw.start()
+mgw_bsc.start()
 
 bsc.bts_add(bts)
 bsc.start()
diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf
index 40d9f97..522b1ca 100644
--- a/suites/voice/suite.conf
+++ b/suites/voice/suite.conf
@@ -1,6 +1,6 @@
 resources:
   ip_address:
-  - times: 5 # msc, bsc, hlr, stp, mgw
+  - times: 6 # msc, bsc, hlr, stp, mgw*2
   bts:
   - times: 1
   modem:

-- 
To view, visit https://gerrit.osmocom.org/4758
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dadd781a357fce33e7bde55e4bcbdaeb4633359
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list