Commit 3b53e583 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Rename ci_ueinfra.yaml and cls_module_ue.py

parent 99a46f49
...@@ -41,7 +41,7 @@ import cls_cmd ...@@ -41,7 +41,7 @@ import cls_cmd
class Module_UE: 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: with open(filename, 'r') as f:
all_ues = yaml.load(f, Loader=yaml.FullLoader) all_ues = yaml.load(f, Loader=yaml.FullLoader)
m = all_ues.get(module_name) m = all_ues.get(module_name)
...@@ -64,7 +64,7 @@ class Module_UE: ...@@ -64,7 +64,7 @@ class Module_UE:
self.trace = m.get('trace') == True self.trace = m.get('trace') == True
self.logStore = m.get('LogStore') self.logStore = m.get('LogStore')
self.cmd_prefix = m.get('CmdPrefix') self.cmd_prefix = m.get('CmdPrefix')
logging.info(f'initialized UE {self.module_name}@{self.host} from {filename}') logging.info(f'initialized {self.module_name}@{self.host} from {filename}')
def __str__(self): def __str__(self):
return f"{self.module_name}@{self.host} [IP: {self.getIP()}]" return f"{self.module_name}@{self.host} [IP: {self.getIP()}]"
......
...@@ -53,7 +53,7 @@ import constants as CONST ...@@ -53,7 +53,7 @@ import constants as CONST
import cls_cluster as OC import cls_cluster as OC
import sshconnection import sshconnection
import cls_module_ue import cls_module
import cls_cmd import cls_cmd
logging.getLogger("matplotlib").setLevel(logging.WARNING) logging.getLogger("matplotlib").setLevel(logging.WARNING)
...@@ -224,7 +224,7 @@ class OaiCiTest(): ...@@ -224,7 +224,7 @@ class OaiCiTest():
def InitializeUE(self, HTML): 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 = [] messages = []
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.initialize) for ue in ues] futures = [executor.submit(ue.initialize) for ue in ues]
...@@ -440,7 +440,7 @@ class OaiCiTest(): ...@@ -440,7 +440,7 @@ class OaiCiTest():
self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS)
def AttachUE(self, 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: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.attach) for ue in ues] futures = [executor.submit(ue.attach) for ue in ues]
attached = [f.result() for f in futures] attached = [f.result() for f in futures]
...@@ -455,7 +455,7 @@ class OaiCiTest(): ...@@ -455,7 +455,7 @@ class OaiCiTest():
self.AutoTerminateUEandeNB(HTML, RAN, EPC, CONTAINERS) self.AutoTerminateUEandeNB(HTML, RAN, EPC, CONTAINERS)
def DetachUE(self, HTML): 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: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.detach) for ue in ues] futures = [executor.submit(ue.detach) for ue in ues]
[f.result() for f in futures] [f.result() for f in futures]
...@@ -463,7 +463,7 @@ class OaiCiTest(): ...@@ -463,7 +463,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) HTML.CreateHtmlTestRowQueue('NA', 'OK', messages)
def DataDisableUE(self, HTML): 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: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.dataDisable) for ue in ues] futures = [executor.submit(ue.dataDisable) for ue in ues]
status = [f.result() for f in futures] status = [f.result() for f in futures]
...@@ -475,7 +475,7 @@ class OaiCiTest(): ...@@ -475,7 +475,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not disable UE data!"]) HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not disable UE data!"])
def DataEnableUE(self, HTML): 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}') logging.debug(f'disabling data for UEs {ues}')
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.dataEnable) for ue in ues] futures = [executor.submit(ue.dataEnable) for ue in ues]
...@@ -488,7 +488,7 @@ class OaiCiTest(): ...@@ -488,7 +488,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not enable UE data!"]) HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not enable UE data!"])
def CheckStatusUE(self,HTML): 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}') logging.debug(f'checking status of UEs {ues}')
messages = [] messages = []
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor() as executor:
...@@ -592,7 +592,7 @@ class OaiCiTest(): ...@@ -592,7 +592,7 @@ class OaiCiTest():
if self.ue_ids == []: if self.ue_ids == []:
raise Exception("no module names in self.ue_ids provided") 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) logging.debug(ues)
pingLock = Lock() pingLock = Lock()
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor() as executor:
...@@ -938,8 +938,8 @@ class OaiCiTest(): ...@@ -938,8 +938,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}"') 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_ue.Module_UE(self.svr_id) svr = cls_module.Module_UE(self.svr_id)
logging.debug(ues) logging.debug(ues)
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, RAN, i, len(ues)) for i, ue in enumerate(ues)] futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, RAN, i, len(ues)) for i, ue in enumerate(ues)]
...@@ -1221,7 +1221,7 @@ class OaiCiTest(): ...@@ -1221,7 +1221,7 @@ class OaiCiTest():
return global_status return global_status
def TerminateUE(self, HTML): 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: with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(ue.terminate) for ue in ues] futures = [executor.submit(ue.terminate) for ue in ues]
archives = [f.result() for f in futures] archives = [f.result() for f in futures]
......
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