cosmetic: rename 'osmo-mgcpgw', it is inaccurate

The current binary is called osmo-bsc_mgcp, while the projected binary to be
used in the future will be called osmo-mgw. osmo-mgcpgw is a phantasy name that
never existed and never will.

Rename the suite.py "public API" to 'mgw', and use 'mgw' as name for
osmo-msc.cfg.

However, since currently the binary used is still osmo-bsc_mgcp, keep the parts
that are specific to this "MGW implementation" called osmo_bsc_mgcp /
OsmoBscMgcp. It is for itself 'osmo_bsc_mgcp', and for the MSC called 'mgw'.

Hence we can in the future add an osmo-mgw alongside the osmo-bsc_mgcp.

Change-Id: I9e2c485f0784c3b76e352fbb528ce17d1900f3d8
diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_bsc_mgcp.py
similarity index 80%
rename from src/osmo_gsm_tester/osmo_mgcpgw.py
rename to src/osmo_gsm_tester/osmo_bsc_mgcp.py
index 93c3a7c..2da2f4d 100644
--- a/src/osmo_gsm_tester/osmo_mgcpgw.py
+++ b/src/osmo_gsm_tester/osmo_bsc_mgcp.py
@@ -1,4 +1,4 @@
-# osmo_gsm_tester: specifics for running an osmo-mgcp-gw (osmo-bsc_mgcp)
+# osmo_gsm_tester: specifics for running an osmo-mgw (osmo-bsc_mgcp)
 #
 # Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH
 #
@@ -22,7 +22,7 @@
 
 from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
 
-class OsmoMgcpgw(log.Origin):
+class OsmoBscMgcp(log.Origin):
     suite_run = None
     ip_address = None
     run_dir = None
@@ -30,14 +30,14 @@
     process = None
 
     def __init__(self, suite_run, ip_address, bts_ip):
-        super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr'))
+        super().__init__(log.C_RUN, 'osmo-bsc_mgcp_%s' % ip_address.get('addr'))
         self.suite_run = suite_run
         self.ip_address = ip_address
-        # hack: so far mgcpgw needs one specific BTS IP.
+        # hack: so far osmo-bsc_mgcp needs one specific BTS IP.
         self.bts_ip = bts_ip
 
     def start(self):
-        self.log('Starting osmo-mgcpgw')
+        self.log('Starting osmo-bsc_mgcp')
         self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
         self.configure()
         inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-mgw')))
@@ -63,17 +63,17 @@
         self.process.launch()
 
     def configure(self):
-        self.config_file = self.run_dir.new_file('osmo-mgcpgw.cfg')
+        self.config_file = self.run_dir.new_file('osmo-bsc_mgcp.cfg')
         self.dbg(config_file=self.config_file)
 
-        values = dict(mgcpgw=config.get_defaults('mgcpgw'))
+        values = dict(mgw=config.get_defaults('osmo_bsc_mgcp'))
         config.overlay(values, self.suite_run.config())
-        config.overlay(values, dict(mgcpgw=dict(ip_address=self.ip_address, bts_ip=self.bts_ip)))
+        config.overlay(values, dict(osmo_bsc_mgcp=dict(ip_address=self.ip_address, bts_ip=self.bts_ip)))
 
         self.dbg('MGCPGW CONFIG:\n' + pprint.pformat(values))
 
         with open(self.config_file, 'w') as f:
-            r = template.render('osmo-mgcpgw.cfg', values)
+            r = template.render('osmo-bsc_mgcp.cfg', values)
             self.dbg(r)
             f.write(r)
 
@@ -81,7 +81,7 @@
         return self.ip_address.get('addr')
 
     def conf_for_msc(self):
-        return dict(mgcpgw=dict(ip_address=self.ip_address))
+        return dict(mgw=dict(ip_address=self.ip_address))
 
     def running(self):
         return not self.process.terminated()
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index 67234e3..a5e8585 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -34,12 +34,12 @@
     encryption = None
     authentication = None
 
-    def __init__(self, suite_run, hlr, mgcpgw, ip_address):
+    def __init__(self, suite_run, hlr, mgw, ip_address):
         super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr'))
         self.suite_run = suite_run
         self.ip_address = ip_address
         self.hlr = hlr
-        self.mgcpgw = mgcpgw
+        self.mgw = mgw
         self.smsc = smsc.Smsc((ip_address.get('addr'), 2775))
 
     def start(self):
@@ -75,7 +75,7 @@
         values = dict(msc=config.get_defaults('msc'))
         config.overlay(values, self.suite_run.config())
         config.overlay(values, dict(msc=dict(ip_address=self.ip_address)))
-        config.overlay(values, self.mgcpgw.conf_for_msc())
+        config.overlay(values, self.mgw.conf_for_msc())
         config.overlay(values, self.hlr.conf_for_msc())
         config.overlay(values, self.smsc.get_config())
 
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 28bdd69..e9505f1 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, ofono_client, 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_bsc_mgcp, osmo_msc, osmo_bsc, osmo_stp
 from . import test
 
 class Timeout(Exception):
@@ -322,15 +322,15 @@
             ip_address = self.ip_address()
         return osmo_hlr.OsmoHlr(self, ip_address)
 
-    def mgcpgw(self, ip_address=None, bts_ip=None):
+    def mgw(self, ip_address=None, bts_ip=None):
         if ip_address is None:
             ip_address = self.ip_address()
-        return osmo_mgcpgw.OsmoMgcpgw(self, ip_address, bts_ip)
+        return osmo_bsc_mgcp.OsmoBscMgcp(self, ip_address, bts_ip)
 
-    def msc(self, hlr, mgcpgw, ip_address=None):
+    def msc(self, hlr, mgw, ip_address=None):
         if ip_address is None:
             ip_address = self.ip_address()
-        return osmo_msc.OsmoMsc(self, hlr, mgcpgw, ip_address)
+        return osmo_msc.OsmoMsc(self, hlr, mgw, ip_address)
 
     def bsc(self, msc, ip_address=None):
         if ip_address is None:
diff --git a/src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc_mgcp.cfg.tmpl
similarity index 69%
rename from src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl
rename to src/osmo_gsm_tester/templates/osmo-bsc_mgcp.cfg.tmpl
index 28a3798..7ef192b 100644
--- a/src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc_mgcp.cfg.tmpl
@@ -7,11 +7,11 @@
  logging level all debug
 line vty
   no login
-  bind ${mgcpgw.ip_address.addr}
+  bind ${osmo_bsc_mgcp.ip_address.addr}
 mgcp
-  local ip ${mgcpgw.ip_address.addr}
-  bts ip ${mgcpgw.bts_ip}
-  bind ip ${mgcpgw.ip_address.addr}
+  local ip ${osmo_bsc_mgcp.ip_address.addr}
+  bts ip ${osmo_bsc_mgcp.bts_ip}
+  bind ip ${osmo_bsc_mgcp.ip_address.addr}
   bind port 2427
   rtp base 4000
   rtp force-ptime 20
diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
index 6851ea9..58d9333 100644
--- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
@@ -20,7 +20,7 @@
 cs7 instance 0
  point-code 0.0.1
 msc
- mgcpgw remote-ip ${mgcpgw.ip_address.addr}
+ mgcpgw remote-ip ${mgw.ip_address.addr}
  assign-tmsi
  cs7-instance-iu 0
  cs7-instance-a 0
diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py
index d596b68..21d07b9 100755
--- a/suites/aoip_debug/interactive.py
+++ b/suites/aoip_debug/interactive.py
@@ -2,8 +2,8 @@
 from osmo_gsm_tester.test import *
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 modems = suite.modems(int(prompt('How many modems?')))
@@ -11,7 +11,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.start()
 
 bsc.bts_add(bts)
 bsc.start()
diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py
index 0224ee0..dafdc54 100755
--- a/suites/aoip_encryption/register_a5_0_authopt.py
+++ b/suites/aoip_encryption/register_a5_0_authopt.py
@@ -3,8 +3,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 ms = suite.modem()
@@ -16,7 +16,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.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..49b8021 100755
--- a/suites/aoip_encryption/register_a5_0_authreq.py
+++ b/suites/aoip_encryption/register_a5_0_authreq.py
@@ -3,8 +3,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 ms = suite.modem()
@@ -16,7 +16,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.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..21ac1ef 100755
--- a/suites/aoip_encryption/register_a5_1_authreq.py
+++ b/suites/aoip_encryption/register_a5_1_authreq.py
@@ -3,8 +3,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 ms = suite.modem()
@@ -16,7 +16,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.start()
 bsc.bts_add(bts)
 bsc.start()
 bts.start()
diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py
index 2a954d5..82d4f86 100755
--- a/suites/aoip_smpp/esme_connect_policy_acceptall.py
+++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py
@@ -7,9 +7,9 @@
 from osmo_gsm_tester.test import *
 
 hlr = suite.hlr()
-bts = suite.bts() # bts not started, only needed for mgcpgw
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+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()
 
@@ -20,7 +20,7 @@
 
 hlr.start()
 msc.start()
-mgcpgw.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.
diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py
index 29b25d1..ce07f9c 100755
--- a/suites/aoip_smpp/esme_connect_policy_closed.py
+++ b/suites/aoip_smpp/esme_connect_policy_closed.py
@@ -13,8 +13,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 smsc = msc.smsc
 
 esme = suite.esme()
@@ -27,7 +27,7 @@
 
 hlr.start()
 msc.start()
-mgcpgw.start()
+mgw.start()
 
 log('Test with correct credentials (no password)')
 esme_no_pwd.connect()
diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py
index 308ebf3..32dc68a 100755
--- a/suites/aoip_smpp/esme_ms_sms_storeforward.py
+++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py
@@ -14,8 +14,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 bsc.bts_add(bts)
@@ -27,7 +27,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.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..cd677fa 100755
--- a/suites/aoip_smpp/esme_ms_sms_transaction.py
+++ b/suites/aoip_smpp/esme_ms_sms_transaction.py
@@ -12,8 +12,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 bsc.bts_add(bts)
@@ -25,7 +25,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.start()
 bsc.start()
 bts.start()
 
diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py
index 217d807..3ede47a 100755
--- a/suites/aoip_sms/mo_mt_sms.py
+++ b/suites/aoip_sms/mo_mt_sms.py
@@ -3,8 +3,8 @@
 
 hlr = suite.hlr()
 bts = suite.bts()
-mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
-msc = suite.msc(hlr, mgcpgw)
+mgw = suite.mgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgw)
 bsc = suite.bsc(msc)
 stp = suite.stp()
 ms_mo = suite.modem()
@@ -13,7 +13,7 @@
 hlr.start()
 stp.start()
 msc.start()
-mgcpgw.start()
+mgw.start()
 
 bsc.bts_add(bts)
 bsc.start()