Commit e70213cd authored by Robert Schmidt's avatar Robert Schmidt

CI: declare variable before use

parent f43090fa
...@@ -519,6 +519,7 @@ class OaiCiTest(): ...@@ -519,6 +519,7 @@ class OaiCiTest():
ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} 2>&1 | tee /tmp/{ping_log_file}' ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} 2>&1 | tee /tmp/{ping_log_file}'
cmd = cls_cmd.getConnection(ue.getHost()) cmd = cls_cmd.getConnection(ue.getHost())
response = cmd.run(ping_cmd, timeout=int(ping_time[0])*1.5) response = cmd.run(ping_cmd, timeout=int(ping_time[0])*1.5)
ue_header = f'UE {ue.getName()} ({ueIP})'
if response.returncode != 0: if response.returncode != 0:
message = ue_header + ': ping crashed: TIMEOUT?' message = ue_header + ': ping crashed: TIMEOUT?'
logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m') logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m')
...@@ -528,7 +529,6 @@ class OaiCiTest(): ...@@ -528,7 +529,6 @@ class OaiCiTest():
cmd.copyin(src=f'/tmp/{ping_log_file}', tgt=local_ping_log_file) cmd.copyin(src=f'/tmp/{ping_log_file}', tgt=local_ping_log_file)
cmd.close() cmd.close()
ue_header = f'UE {ue.getName()} ({ueIP})'
with open(local_ping_log_file, 'r') as f: with open(local_ping_log_file, 'r') as f:
ping_output = "".join(f.readlines()) ping_output = "".join(f.readlines())
result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output)
......
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