Commit e5634431 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: hotfixes

  -- log collection on enb log requires a sudo when removing log files
  -- added iperf log collection to jenkins file
  -- corrected iperf detection of packet loss ( added jitter also)
  -- increased iperf DL requested BW for 10 MHz
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent dddd4605
...@@ -387,6 +387,24 @@ pipeline { ...@@ -387,6 +387,24 @@ pipeline {
} }
} }
} }
stage('Log Collection (Iperf)') {
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
]) {
echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m'
sh "python3 ci-scripts/main.py --mode=LogCollectIperf --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
echo '\u2705 \u001B[32mLog Transfer (Iperf)\u001B[0m'
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/iperf.log.zip ./iperf.log.${env.BUILD_ID}.zip || true"
}
script {
if(fileExists("iperf.log.${env.BUILD_ID}.zip")) {
archiveArtifacts "iperf.log.${env.BUILD_ID}.zip"
}
}
}
}
} }
} }
} }
......
...@@ -527,6 +527,9 @@ class SSHConnection(): ...@@ -527,6 +527,9 @@ class SSHConnection():
try: try:
useIperf3 = False useIperf3 = False
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
# if by chance ADB server and EPC are on the same remote host, at least log collection will take of it
self.command('if [ ! -d ' + self.EPCSourceCodePath + '/scripts ]; then mkdir -p ' + self.EPCSourceCodePath + '/scripts ; fi', '\$', 5)
self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5)
# Checking if iperf / iperf3 are installed # Checking if iperf / iperf3 are installed
self.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5) self.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5)
result = re.search('iperf3', str(self.ssh.before)) result = re.search('iperf3', str(self.ssh.before))
...@@ -541,7 +544,7 @@ class SSHConnection(): ...@@ -541,7 +544,7 @@ class SSHConnection():
self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5) self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5)
else: else:
self.command('rm -f /tmp/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) self.command('rm -f /tmp/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5)
self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > /tmp/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5)
time.sleep(0.5) time.sleep(0.5)
self.close() self.close()
...@@ -605,10 +608,11 @@ class SSHConnection(): ...@@ -605,10 +608,11 @@ class SSHConnection():
else: else:
logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m')
sys.exit(1) sys.exit(1)
result = re.search('Server Report:\\\\r\\\\n(?:|\[ *\d+\].*) (?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?:|[0-9\.]+ ms +\d+\/\d+ \((?P<packetloss>[0-9\.]+)%\))', str(self.ssh.before)) result = re.search('Server Report:\\\\r\\\\n(?:|\[ *\d+\].*) (?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?P<jitter>[0-9\.]+ ms) +(\d+\/.\d+) (\((?P<packetloss>[0-9\.]+)%\))', str(self.ssh.before))
if result is not None: if result is not None:
bitrate = result.group('bitrate') bitrate = result.group('bitrate')
packetloss = result.group('packetloss') packetloss = result.group('packetloss')
jitter = result.group('jitter')
lock.acquire() lock.acquire()
logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m') logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m')
if bitrate is not None: if bitrate is not None:
...@@ -619,6 +623,8 @@ class SSHConnection(): ...@@ -619,6 +623,8 @@ class SSHConnection():
logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m') logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m')
lock.release() lock.release()
sys.exit(1) sys.exit(1)
if jitter is not None:
logging.debug('\u001B[1;34m Jitter : ' + jitter + '\u001B[0m')
lock.release() lock.release()
self.close() self.close()
...@@ -826,22 +832,25 @@ class SSHConnection(): ...@@ -826,22 +832,25 @@ class SSHConnection():
self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
self.command('cd ' + self.eNBSourceCodePath, '\$', 5) self.command('cd ' + self.eNBSourceCodePath, '\$', 5)
self.command('cd cmake_targets', '\$', 5) self.command('cd cmake_targets', '\$', 5)
self.command('rm -f build.log.zip', '\$', 5)
self.command('zip build.log.zip build_log_*/*', '\$', 60) self.command('zip build.log.zip build_log_*/*', '\$', 60)
self.command('rm -rf build_log_*', '\$', 5) self.command('echo ' + self.eNBPassword + ' | sudo -S rm -rf build_log_*', '\$', 5)
self.close() self.close()
def LogCollecteNB(self): def LogCollecteNB(self):
self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
self.command('cd ' + self.eNBSourceCodePath, '\$', 5) self.command('cd ' + self.eNBSourceCodePath, '\$', 5)
self.command('cd cmake_targets', '\$', 5) self.command('cd cmake_targets', '\$', 5)
self.command('rm -f enb.log.zip', '\$', 5)
self.command('zip enb.log.zip enb*.log', '\$', 60) self.command('zip enb.log.zip enb*.log', '\$', 60)
self.command('rm enb*.log', '\$', 5) self.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log', '\$', 5)
self.close() self.close()
def LogCollectPing(self): def LogCollectPing(self):
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
self.command('cd scripts', '\$', 5) self.command('cd scripts', '\$', 5)
self.command('rm -f ping.log.zip', '\$', 5)
self.command('zip ping.log.zip ping*.log', '\$', 60) self.command('zip ping.log.zip ping*.log', '\$', 60)
self.command('rm ping*.log', '\$', 5) self.command('rm ping*.log', '\$', 5)
self.close() self.close()
...@@ -850,6 +859,7 @@ class SSHConnection(): ...@@ -850,6 +859,7 @@ class SSHConnection():
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
self.command('cd scripts', '\$', 5) self.command('cd scripts', '\$', 5)
self.command('rm -f iperf.log.zip', '\$', 5)
self.command('zip iperf.log.zip iperf*.log', '\$', 60) self.command('zip iperf.log.zip iperf*.log', '\$', 60)
self.command('rm iperf*.log', '\$', 5) self.command('rm iperf*.log', '\$', 5)
self.close() self.close()
...@@ -858,6 +868,7 @@ class SSHConnection(): ...@@ -858,6 +868,7 @@ class SSHConnection():
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
self.command('cd scripts', '\$', 5) self.command('cd scripts', '\$', 5)
self.command('rm -f hss.log.zip', '\$', 5)
if re.match('OAI', self.EPCType, re.IGNORECASE): if re.match('OAI', self.EPCType, re.IGNORECASE):
self.command('zip hss.log.zip hss*.log', '\$', 60) self.command('zip hss.log.zip hss*.log', '\$', 60)
self.command('rm hss*.log', '\$', 5) self.command('rm hss*.log', '\$', 5)
...@@ -870,6 +881,7 @@ class SSHConnection(): ...@@ -870,6 +881,7 @@ class SSHConnection():
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
self.command('cd scripts', '\$', 5) self.command('cd scripts', '\$', 5)
self.command('rm -f mme.log.zip', '\$', 5)
if re.match('OAI', self.EPCType, re.IGNORECASE): if re.match('OAI', self.EPCType, re.IGNORECASE):
self.command('zip mme.log.zip mme*.log', '\$', 60) self.command('zip mme.log.zip mme*.log', '\$', 60)
self.command('rm mme*.log', '\$', 5) self.command('rm mme*.log', '\$', 5)
...@@ -882,6 +894,7 @@ class SSHConnection(): ...@@ -882,6 +894,7 @@ class SSHConnection():
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
self.command('cd scripts', '\$', 5) self.command('cd scripts', '\$', 5)
self.command('rm -f spgw.log.zip', '\$', 5)
if re.match('OAI', self.EPCType, re.IGNORECASE): if re.match('OAI', self.EPCType, re.IGNORECASE):
self.command('zip spgw.log.zip spgw*.log', '\$', 60) self.command('zip spgw.log.zip spgw*.log', '\$', 60)
self.command('rm spgw*.log', '\$', 5) self.command('rm spgw*.log', '\$', 5)
......
...@@ -104,22 +104,22 @@ ...@@ -104,22 +104,22 @@
<testCase id="040611"> <testCase id="040611">
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (10MHz - DL/6Mbps/UDP)(60 sec)</desc> <desc>iperf (10MHz - DL/10Mbps/UDP)(60 sec)</desc>
<iperf_args>-u -b 6M -t 60 -i 1</iperf_args> <iperf_args>-u -b 10M -t 60 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase> </testCase>
<testCase id="040612"> <testCase id="040612">
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (10MHz - DL/13Mbps/UDP)(60 sec)</desc> <desc>iperf (10MHz - DL/20Mbps/UDP)(60 sec)</desc>
<iperf_args>-u -b 13M -t 60 -i 1</iperf_args> <iperf_args>-u -b 20M -t 60 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase> </testCase>
<testCase id="040613"> <testCase id="040613">
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (10MHz - DL/15Mbps/UDP)(60 sec)</desc> <desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)</desc>
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args> <iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase> </testCase>
......
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