Configurable infrastructure file for Ping and Iperf()

- Make configurable to override (to be used later in extended tests with
  new core class)
- Move ping-iperf test infra to tests/ directory
This commit is contained in:
Robert Schmidt
2025-03-21 16:51:56 +01:00
parent 4a9bb6dbe4
commit 19932b10f6
4 changed files with 12 additions and 11 deletions
-4
View File
@@ -396,7 +396,3 @@ l2sim4g_ext_dn:
Host: "%%current_host%%"
NetworkScript: docker exec l2sim4g-trf-gen ip a show dev eth0
CmdPrefix: docker exec l2sim4g-trf-gen
test:
Host: localhost
NetworkScript: echo "inet 127.0.0.1 mtu 1500"
+5 -5
View File
@@ -434,7 +434,7 @@ class OaiCiTest():
return (True, message)
def Ping(self, HTML, EPC, CONTAINERS):
def Ping(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
@@ -446,7 +446,7 @@ class OaiCiTest():
ymlPath = CONTAINERS.yamlPath[0].split('/')
logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}'
local.run(f'mkdir -p {logPath}', silent=True)
ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)]
ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)]
logging.debug(ues)
with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor:
futures = [executor.submit(self.Ping_common, EPC, ue, logPath) for ue in ues]
@@ -516,7 +516,7 @@ class OaiCiTest():
return (status, f'{ue_header}\n{msg}')
def Iperf(self,HTML,EPC,CONTAINERS):
def Iperf(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
@@ -530,8 +530,8 @@ class OaiCiTest():
ymlPath = CONTAINERS.yamlPath[0].split('/')
logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}'
local.run(f'mkdir -p {logPath}', silent=True)
ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)]
svr = cls_module.Module_UE(self.svr_id,self.svr_node)
ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)]
svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file)
logging.debug(ues)
with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor:
futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, i, len(ues), logPath) for i, ue in enumerate(ues)]
@@ -0,0 +1,3 @@
test:
Host: localhost
NetworkScript: echo "inet 127.0.0.1 mtu 1500"
+4 -2
View File
@@ -33,8 +33,9 @@ class TestPingIperf(unittest.TestCase):
def test_ping(self):
self.ci.ping_args = "-c3 127.0.0.1"
self.ci.ping_packetloss_threshold = "0"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Ping(self.html, self.epc, self.cont)
success = self.ci.Ping(self.html, self.epc, self.cont, infra_file=infra_file)
self.assertTrue(success)
def test_iperf(self):
@@ -47,8 +48,9 @@ class TestPingIperf(unittest.TestCase):
self.ci.iperf_packetloss_threshold = "0"
self.ci.iperf_bitrate_threshold = "0"
self.ci.iperf_profile = "balanced"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Iperf(self.html, self.epc, self.cont)
success = self.ci.Iperf(self.html, self.epc, self.cont, infra_file=infra_file)
self.assertTrue(success)
if __name__ == '__main__':