Commit 08353293 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Rename and modify ci_ueinfra and cls_module_ue

- add traffic servers
- add runServer parameter
parent 921c24ce
......@@ -56,6 +56,39 @@ adb_ue_2:
MTU: 1500
LogStore: /media/usb-drive/ci_adb_2-logs
oc-cn5g:
Host: avra
NetworkScript: echo "inet 172.21.6.102"
RunIperf3Server: False
porcepix-cn4g:
Host: porcepix
NetworkScript: docker exec prod-trf-gen ip a show dev eth0
CmdPrefix: docker exec prod-trf-gen
porcepix-cn5g:
Host: porcepix
NetworkScript: docker exec prod-trf-gen ip a show dev eth0
CmdPrefix: docker exec prod-trf-gen
RunIperf3Server: False
nano-cn4g:
Host: nano
NetworkScript: docker exec prod-trf-gen ip a show dev eth0
CmdPrefix: docker exec prod-trf-gen
ltebox-nano:
Host: nano
NetworkScript: ip a show dev tun1
sabox-nepes:
Host: nepes
NetworkScript: ip a show dev tun1
ltebox-nepes:
Host: nepes
NetworkScript: ip a show dev tun1
amarisoft_ue:
Host: amariue
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_aw2s_asue_2x2/aw2s-multi-20897-2x2.cfg &
......
......@@ -41,7 +41,7 @@ import cls_cmd
class Module_UE:
def __init__(self, module_name, filename="ci_ueinfra.yaml"):
def __init__(self, module_name, filename="ci_infra.yaml"):
with open(filename, 'r') as f:
all_ues = yaml.load(f, Loader=yaml.FullLoader)
m = all_ues.get(module_name)
......@@ -64,7 +64,8 @@ class Module_UE:
self.trace = m.get('trace') == True
self.logStore = m.get('LogStore')
self.cmd_prefix = m.get('CmdPrefix')
logging.info(f'initialized UE {self.module_name}@{self.host} from {filename}')
self.runIperf3Server = m.get('RunIperf3Server', True)
logging.info(f'initialized {self.module_name}@{self.host} from {filename}')
def __str__(self):
return f"{self.module_name}@{self.host} [IP: {self.getIP()}]"
......@@ -189,6 +190,9 @@ class Module_UE:
def getHost(self):
return self.host
def getRunIperf3Server(self):
return self.runIperf3Server
def getCmdPrefix(self):
return self.cmd_prefix if self.cmd_prefix else ""
......
......@@ -52,7 +52,7 @@ import constants as CONST
import cls_cluster as OC
import sshconnection
import cls_module_ue
import cls_module
import cls_cmd
logging.getLogger("matplotlib").setLevel(logging.WARNING)
......@@ -113,6 +113,7 @@ class OaiCiTest():
self.clean_repository = True
self.air_interface=''
self.ue_ids = []
self.svr_id = None
self.cmd_prefix = '' # prefix before {lte,nr}-uesoftmodem
......@@ -222,7 +223,7 @@ class OaiCiTest():
def InitializeUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
messages = []
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.initialize) for ue in ues]
......@@ -438,7 +439,7 @@ class OaiCiTest():
self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS)
def AttachUE(self, HTML, RAN, EPC, CONTAINERS):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.attach) for ue in ues]
attached = [f.result() for f in futures]
......@@ -453,7 +454,7 @@ class OaiCiTest():
self.AutoTerminateUEandeNB(HTML, RAN, EPC, CONTAINERS)
def DetachUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.detach) for ue in ues]
[f.result() for f in futures]
......@@ -461,7 +462,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('NA', 'OK', messages)
def DataDisableUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.dataDisable) for ue in ues]
status = [f.result() for f in futures]
......@@ -473,7 +474,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not disable UE data!"])
def DataEnableUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
logging.debug(f'disabling data for UEs {ues}')
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.dataEnable) for ue in ues]
......@@ -486,7 +487,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not enable UE data!"])
def CheckStatusUE(self,HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
logging.debug(f'checking status of UEs {ues}')
messages = []
with concurrent.futures.ThreadPoolExecutor() as executor:
......@@ -590,7 +591,7 @@ class OaiCiTest():
if self.ue_ids == []:
raise Exception("no module names in self.ue_ids provided")
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
logging.debug(ues)
pingLock = Lock()
with concurrent.futures.ThreadPoolExecutor() as executor:
......@@ -990,7 +991,8 @@ class OaiCiTest():
logging.debug(f'Iperf: iperf_args "{self.iperf_args}" iperf_direction "{self.iperf_direction}" iperf_packetloss_threshold "{self.iperf_packetloss_threshold}" iperf_bitrate_threshold "{self.iperf_bitrate_threshold}" iperf_profile "{self.iperf_profile}" iperf_options "{self.iperf_options}"')
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
svr = cls_module.Module_UE(self.svr_id)
logging.debug(ues)
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(self.Iperf_Module, EPC, ue, RAN, i, len(ues)) for i, ue in enumerate(ues)]
......@@ -1272,7 +1274,7 @@ class OaiCiTest():
return global_status
def TerminateUE(self, HTML):
ues = [cls_module_ue.Module_UE(n.strip()) for n in self.ue_ids]
ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.terminate) for ue in ues]
archives = [f.result() for f in futures]
......
......@@ -268,7 +268,7 @@ def GetParametersFromXML(action):
elif action == 'Iperf':
CiTestObj.iperf_args = test.findtext('iperf_args')
CiTestObj.ue_ids = test.findtext('id').split(' ')
CiTestObj.iperf_direction = test.findtext('direction')
CiTestObj.svr_id = test.findtext('svr_id') or None
CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
CiTestObj.iperf_bitrate_threshold = test.findtext('iperf_bitrate_threshold') or '90'
CiTestObj.iperf_profile = test.findtext('iperf_profile') or 'balanced'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment