aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-03-31 13:35:04 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-04-01 14:15:33 +0200
commita57f46ba164a55821d66e3c8da497f58cdb702de (patch)
treefd3b03fbc2ec84e4158b8d134bcfc804cc4abeba
parent0696c60812abbf6c6290b0fd2f4953d8f7ae8fdc (diff)
-rw-r--r--src/osmo_gsm_tester/obj/epc_open5gs.py69
-rw-r--r--src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl6
-rw-r--r--src/osmo_gsm_tester/templates/open5gs-sgwcd.yaml.tmpl9
-rw-r--r--src/osmo_gsm_tester/templates/open5gs-sgwud.yaml.tmpl6
-rw-r--r--src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl15
-rw-r--r--src/osmo_gsm_tester/templates/open5gs-upfd.yaml.tmpl10
6 files changed, 67 insertions, 48 deletions
diff --git a/src/osmo_gsm_tester/obj/epc_open5gs.py b/src/osmo_gsm_tester/obj/epc_open5gs.py
index 15f4eab..feff901 100644
--- a/src/osmo_gsm_tester/obj/epc_open5gs.py
+++ b/src/osmo_gsm_tester/obj/epc_open5gs.py
@@ -39,7 +39,9 @@ def on_register_schemas():
schema.register_config_schema('epc', config_schema)
class Open5gsEPC(epc.EPC):
-
+##############
+# PROTECTED
+##############
REMOTE_DIR = '/osmo-gsm-tester-open5gs'
def __init__(self, testenv, run_node):
@@ -54,27 +56,17 @@ class Open5gsEPC(epc.EPC):
self.sgwu = None
self.subscriber_list = []
- def cleanup(self):
- if self.pcrf:
- self.pcrf.cleanup()
- if self.upf:
- self.upf.cleanup()
- if self.smf:
- self.smf.cleanup()
- if self.hss:
- self.hss.cleanup()
- if self.mme:
- self.mme.cleanup()
- if self.sgwc:
- self.sgwc.cleanup()
- if self.sgwu:
- self.sgwu.cleanup()
-
def configure(self):
values = super().configure(['open5gsepc'])
db_host = values['epc']['db_host']
db_uri = 'mongodb://'+db_host+'/open5gs'
- config.overlay(values, dict(epc=dict(db_uri=db_uri)))
+ config.overlay(values, dict(epc=dict(db_uri=db_uri,
+ tun_addr=self.tun_addr(),
+ addr_smf=self.priv_addr_smf(),
+ addr_upf=self.priv_addr_upf(),
+ addr_sgwc=self.priv_addr_sgwc(),
+ addr_sgwu=self.priv_addr_sgwu(),
+ )))
self.fill_subscribers_mongodb(values['epc']['db_host'], 27017)
self.pcrf = Open5gsPCRF(self.testenv, self)
self.upf = Open5gsUPF(self.testenv, self)
@@ -91,6 +83,47 @@ class Open5gsEPC(epc.EPC):
self.sgwc.configure(copy.deepcopy(values))
self.sgwu.configure(copy.deepcopy(values))
+ def gen_priv_addr(self, suffix):
+ if ':' in self.addr():
+ raise log.Error('IPv6 not implemented!')
+ public_suffix = self.addr()[self.addr().rindex('.')+1:]
+ return '127.0.' + public_suffix + '.' + str(suffix)
+
+########################
+# PUBLIC - INTERNAL API
+########################
+
+ def cleanup(self):
+ if self.pcrf:
+ self.pcrf.cleanup()
+ if self.upf:
+ self.upf.cleanup()
+ if self.smf:
+ self.smf.cleanup()
+ if self.hss:
+ self.hss.cleanup()
+ if self.mme:
+ self.mme.cleanup()
+ if self.sgwc:
+ self.sgwc.cleanup()
+ if self.sgwu:
+ self.sgwu.cleanup()
+
+ def priv_addr_smf(self):
+ return self.gen_priv_addr(1)
+
+ def priv_addr_upf(self):
+ return self.gen_priv_addr(2)
+
+ def priv_addr_sgwc(self):
+ return self.gen_priv_addr(3)
+
+ def priv_addr_sgwu(self):
+ return self.gen_priv_addr(4)
+
+###################
+# PUBLIC (test API included)
+###################
def start(self):
self.log('Starting srsepc')
self.run_dir = util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
diff --git a/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
index 9aec578..5c886e3 100644
--- a/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
@@ -104,8 +104,7 @@ mme:
#
sgwc:
gtpc:
- - addr: ${epc.run_addr}
- port: 2125
+ - addr: ${epc.addr_sgwc}
#
# smf:
@@ -146,8 +145,7 @@ sgwc:
# apn: volte
smf:
gtpc:
- - addr: ${epc.run_addr}
- port: 2124
+ - addr: ${epc.addr_smf}
#
# parameter:
diff --git a/src/osmo_gsm_tester/templates/open5gs-sgwcd.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-sgwcd.yaml.tmpl
index 8d2bd1a..a1db7ed 100644
--- a/src/osmo_gsm_tester/templates/open5gs-sgwcd.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-sgwcd.yaml.tmpl
@@ -52,11 +52,9 @@ logger:
#
sgwc:
gtpc:
- - addr: ${epc.run_addr}
- port: 2125
+ - addr: ${epc.addr_sgwc}
pfcp:
- - addr: ${epc.run_addr}
- port: 8805
+ - addr: ${epc.addr_sgwc}
#
# sgwu:
@@ -112,8 +110,7 @@ sgwc:
#
sgwu:
pfcp:
- - addr: ${epc.run_addr}
- port: 8806
+ - addr: ${epc.addr_sgwu}
#
# parameter:
diff --git a/src/osmo_gsm_tester/templates/open5gs-sgwud.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-sgwud.yaml.tmpl
index 27dd55c..f0e2384 100644
--- a/src/osmo_gsm_tester/templates/open5gs-sgwud.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-sgwud.yaml.tmpl
@@ -49,8 +49,7 @@ logger:
#
sgwu:
pfcp:
- - addr: ${epc.run_addr}
- port: 8806
+ - addr: ${epc.addr_sgwu}
gtpu:
- addr: ${epc.run_addr}
port: 2152
@@ -67,8 +66,7 @@ sgwu:
#
sgwc:
pfcp:
- - addr: ${epc.run_addr}
- port: 8805
+ - addr: ${epc.addr_sgwc}
#
# parameter:
diff --git a/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
index 0e01337..4a030d6 100644
--- a/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
@@ -20,6 +20,7 @@
#
logger:
file: ${smf.log_filename}
+ level: debug
#
# smf:
#
@@ -310,22 +311,17 @@ smf:
- addr: ${epc.run_addr}
port: 7777
pfcp:
- - addr: ${epc.run_addr}
- port: 8808
+ - addr: ${epc.addr_smf}
gtpc:
- - addr: ${epc.run_addr}
- port: 2124
+ - addr: ${epc.addr_smf}
gtpu:
- addr: ${epc.run_addr}
port: 2153
subnet:
- - addr: 10.45.0.1/16
- - addr: 2001:230:cafe::1/48
+ - addr: ${epc.tun_addr}/16
dns:
- 8.8.8.8
- 8.8.4.4
- - 2001:4860:4860::8888
- - 2001:4860:4860::8844
mtu: 1400
freeDiameter: ${smf.diameter_filename}
@@ -415,8 +411,7 @@ nrf:
#
upf:
pfcp:
- - addr: ${epc.run_addr}
- port: 8807
+ - addr: ${epc.addr_upf}
#
# parameter:
diff --git a/src/osmo_gsm_tester/templates/open5gs-upfd.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-upfd.yaml.tmpl
index 4f7a25d..4fd77f6 100644
--- a/src/osmo_gsm_tester/templates/open5gs-upfd.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-upfd.yaml.tmpl
@@ -20,6 +20,7 @@
#
logger:
file: ${upf.log_filename}
+ level: debug
#
# upf:
@@ -104,14 +105,12 @@ logger:
#
upf:
pfcp:
- - addr: ${epc.run_addr}
- port: 8807
+ - addr: ${epc.addr_upf}
gtpu:
- addr: ${epc.run_addr}
port: 2154
subnet:
- - addr: 10.45.0.1/16
- - addr: 2001:230:cafe::1/48
+ - addr: ${epc.tun_addr}/16
#
# smf:
@@ -125,8 +124,7 @@ upf:
#
smf:
pfcp:
- - addr: ${epc.run_addr}
- port: 8808
+ - addr: ${epc.addr_smf}
#
# parameter: