Commit 99a46f49 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Remove IperfFromContainer

parent 5ae83c8c
...@@ -1378,44 +1378,6 @@ class Containerize(): ...@@ -1378,44 +1378,6 @@ class Containerize():
self.UndeployGenObject(HTML, RAN, UE) self.UndeployGenObject(HTML, RAN, UE)
self.exitStatus = 1 self.exitStatus = 1
def IperfFromContainer(self, HTML, RAN, UE):
myCmd = cls_cmd.LocalCmd()
self.exitStatus = 0
ymlPath = self.yamlPath[0].split('/')
logPath = '../cmake_targets/log/' + ymlPath[1]
cmd = f'mkdir -p {logPath}'
myCmd.run(cmd, silent=True)
# Start the server process
cmd = f'docker exec -d {self.svrContName} /bin/bash -c "nohup iperf {self.svrOptions} > /tmp/iperf_server.log 2>&1"'
myCmd.run(cmd)
time.sleep(3)
# Start the client process
cmd = f'docker exec {self.cliContName} /bin/bash -c "iperf {self.cliOptions}" 2>&1 | tee {logPath}/iperf_client_{HTML.testCase_id}.log'
clientStatus = myCmd.run(cmd, timeout=100)
# Stop the server process
cmd = f'docker exec {self.svrContName} /bin/bash -c "pkill iperf"'
myCmd.run(cmd)
time.sleep(3)
serverStatusFilename = f'{logPath}/iperf_server_{HTML.testCase_id}.log'
cmd = f'docker cp {self.svrContName}:/tmp/iperf_server.log {serverStatusFilename}'
myCmd.run(cmd, timeout=60)
myCmd.close()
# clientStatus was retrieved above. The serverStatus was
# written in the background, then copied to the local machine
with open(serverStatusFilename, 'r') as f:
serverStatus = f.read()
(iperfStatus, msg) = AnalyzeIperf(self.cliOptions, clientStatus.stdout, serverStatus)
if iperfStatus:
logging.info('\u001B[1m Iperf Test PASS\u001B[0m')
else:
logging.error('\u001B[1;37;41m Iperf Test FAIL\u001B[0m')
self.IperfExit(HTML, RAN, UE, iperfStatus, msg)
def IperfExit(self, HTML, RAN, UE, status, message): def IperfExit(self, HTML, RAN, UE, status, message):
html_cell = f'UE\n{message}' html_cell = f'UE\n{message}'
if status: if status:
......
...@@ -886,15 +886,6 @@ class OaiCiTest(): ...@@ -886,15 +886,6 @@ class OaiCiTest():
return (False, f"UE {ue.getName()} has no IP address") return (False, f"UE {ue.getName()} has no IP address")
server_filename = f'iperf_server_{self.testCase_id}_{ue.getName()}.log' server_filename = f'iperf_server_{self.testCase_id}_{ue.getName()}.log'
client_filename = f'iperf_client_{self.testCase_id}_{ue.getName()}.log' client_filename = f'iperf_client_{self.testCase_id}_{ue.getName()}.log'
#if (re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE)) or (re.match('OAICN5G', EPC.Type, re.IGNORECASE)):
# with cls_cmd.getConnection(ue.getHost()) as cmd:
#retrieve trf-gen container IP address
#cmd.run('docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen', '\$', 5)
#result = re.search('TRF_IP_ADDR = (?P<trf_ip_addr>[0-9\.]+)', cmd.getBefore())
#if result is None:
# raise Exception("could not corver prod-trf-gen IP address")
#cn_target_ip = result.group('trf_ip_addr')
#cn_iperf_prefix = "docker exec prod-trf-gen" # -w /iperf-2.0.13 necessary?
if udpIperf: if udpIperf:
iperf_opt = self.Iperf_ComputeModifiedBW(idx, ue_num) iperf_opt = self.Iperf_ComputeModifiedBW(idx, ue_num)
logging.info(f'iperf options modified from "{self.iperf_args}" to "{iperf_opt}" for {ue.getName()}') logging.info(f'iperf options modified from "{self.iperf_args}" to "{iperf_opt}" for {ue.getName()}')
......
...@@ -376,20 +376,6 @@ def GetParametersFromXML(action): ...@@ -376,20 +376,6 @@ def GetParametersFromXML(action):
if (string_field is not None): if (string_field is not None):
CONTAINERS.ran_checkers['u_retx_th'] = [float(x) for x in string_field.split(',')] CONTAINERS.ran_checkers['u_retx_th'] = [float(x) for x in string_field.split(',')]
elif action == 'IperfFromContainer':
string_field = test.findtext('server_container_name')
if (string_field is not None):
CONTAINERS.svrContName = string_field
string_field = test.findtext('server_options')
if (string_field is not None):
CONTAINERS.svrOptions = string_field
string_field = test.findtext('client_container_name')
if (string_field is not None):
CONTAINERS.cliContName = string_field
string_field = test.findtext('client_options')
if (string_field is not None):
CONTAINERS.cliOptions = string_field
elif action == 'Run_LDPCTest' or action == 'Run_NRulsimTest' or action == 'Run_LDPCt1Test': elif action == 'Run_LDPCTest' or action == 'Run_NRulsimTest' or action == 'Run_LDPCt1Test':
ldpc.runargs = test.findtext('physim_run_args') ldpc.runargs = test.findtext('physim_run_args')
...@@ -873,10 +859,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -873,10 +859,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj) CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj)
if CONTAINERS.exitStatus==1: if CONTAINERS.exitStatus==1:
RAN.prematureExit = True RAN.prematureExit = True
elif action == 'IperfFromContainer':
CONTAINERS.IperfFromContainer(HTML, RAN, CiTestObj)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
elif action == 'StatsFromGenObject': elif action == 'StatsFromGenObject':
CONTAINERS.StatsFromGenObject(HTML) CONTAINERS.StatsFromGenObject(HTML)
elif action == 'Push_Images_To_Test_Servers': elif action == 'Push_Images_To_Test_Servers':
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
- Deploy_Run_PhySim - Deploy_Run_PhySim
- DeployGenObject - DeployGenObject
- UndeployGenObject - UndeployGenObject
- IperfFromContainer
- StatsFromGenObject - StatsFromGenObject
- LicenceAndFormattingCheck - LicenceAndFormattingCheck
- Push_Local_Registry - Push_Local_Registry
......
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