epc_amarisoft: launch ltesim server when starting

this allows to use the lteue to generate DL traffic. the
server listens on the default spgw address.

Change-Id: Iad081e57e2fd9d3cbc3e59e4f729a4721ad778c9
This commit is contained in:
Andre Puschmann 2021-03-08 16:32:28 +01:00
parent 0e72f9de5f
commit 0acc75ccba
1 changed files with 14 additions and 1 deletions

View File

@ -19,6 +19,7 @@
import os
import pprint
import time
from ..core import log, util, config, template, process, remote
from ..core import schema
@ -37,6 +38,7 @@ class AmarisoftEPC(epc.EPC):
CFGFILE = 'amarisoft_ltemme.cfg'
LOGFILE = 'ltemme.log'
IFUPFILE = 'mme-ifup'
LTESIM_BINFILE = 'ltesim_server'
def __init__(self, testenv, run_node):
super().__init__(testenv, run_node, 'amarisoftepc')
@ -50,7 +52,7 @@ class AmarisoftEPC(epc.EPC):
self.remote_inst = None
self.remote_config_file = None
self.remote_log_file = None
self.remote_ifup_file =None
self.remote_ifup_file = None
self._bin_prefix = None
self.inst = None
self.subscriber_list = []
@ -81,6 +83,7 @@ class AmarisoftEPC(epc.EPC):
self.start_locally()
else:
self.start_remotely()
self.start_ltesim_remotely()
def start_remotely(self):
remote_binary = self.remote_inst.child('', AmarisoftEPC.BINFILE)
@ -115,6 +118,16 @@ class AmarisoftEPC(epc.EPC):
self.testenv.remember_to_stop(self.process)
self.process.launch()
def start_ltesim_remotely(self):
# Sleep for a moment to give MME time to start up create TUN device
time.sleep(5)
remote_binary = self.remote_inst.child('', AmarisoftEPC.LTESIM_BINFILE)
args = (remote_binary, "-a " + self.tun_addr())
self.log('Launching ltesim_server')
self.ltesim_process = self.rem_host.RemoteProcess(AmarisoftEPC.LTESIM_BINFILE, args)
self.testenv.remember_to_stop(self.ltesim_process)
self.ltesim_process.launch()
def configure(self):
self.inst = util.Dir(os.path.abspath(self.bin_prefix()))
if not self.inst.isfile('', AmarisoftEPC.BINFILE):