From 75711a8b77b9f8ba350563d758f15772fd6d1bd5 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux <raphael.defosseux@eurecom.fr> Date: Wed, 1 Aug 2018 11:16:38 +0200 Subject: [PATCH] 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: Raphael Defosseux <raphael.defosseux@eurecom.fr> --- ci-scripts/Jenkinsfile-tmp-ran | 18 ++++++++++++++++++ ci-scripts/main.py | 21 +++++++++++++++++---- ci-scripts/xml_files/enb_usrp210_band7.xml | 12 ++++++------ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index b03ec4f4332..796271a8d4e 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -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" + } + } + } + } } } } diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5d9cee772dd..656b1d11a7f 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -527,6 +527,9 @@ class SSHConnection(): try: useIperf3 = False 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 self.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5) result = re.search('iperf3', str(self.ssh.before)) @@ -541,7 +544,7 @@ class SSHConnection(): self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5) else: 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) self.close() @@ -605,10 +608,11 @@ class SSHConnection(): else: logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m') 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: bitrate = result.group('bitrate') packetloss = result.group('packetloss') + jitter = result.group('jitter') lock.acquire() logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m') if bitrate is not None: @@ -619,6 +623,8 @@ class SSHConnection(): logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m') lock.release() sys.exit(1) + if jitter is not None: + logging.debug('\u001B[1;34m Jitter : ' + jitter + '\u001B[0m') lock.release() self.close() @@ -826,22 +832,25 @@ class SSHConnection(): self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.command('cd ' + self.eNBSourceCodePath, '\$', 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('rm -rf build_log_*', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S rm -rf build_log_*', '\$', 5) self.close() def LogCollecteNB(self): self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.command('cd ' + self.eNBSourceCodePath, '\$', 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('rm enb*.log', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log', '\$', 5) self.close() def LogCollectPing(self): self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath, '\$', 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('rm ping*.log', '\$', 5) self.close() @@ -850,6 +859,7 @@ class SSHConnection(): self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath, '\$', 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('rm iperf*.log', '\$', 5) self.close() @@ -858,6 +868,7 @@ class SSHConnection(): self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) + self.command('rm -f hss.log.zip', '\$', 5) if re.match('OAI', self.EPCType, re.IGNORECASE): self.command('zip hss.log.zip hss*.log', '\$', 60) self.command('rm hss*.log', '\$', 5) @@ -870,6 +881,7 @@ class SSHConnection(): self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) + self.command('rm -f mme.log.zip', '\$', 5) if re.match('OAI', self.EPCType, re.IGNORECASE): self.command('zip mme.log.zip mme*.log', '\$', 60) self.command('rm mme*.log', '\$', 5) @@ -882,6 +894,7 @@ class SSHConnection(): self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) + self.command('rm -f spgw.log.zip', '\$', 5) if re.match('OAI', self.EPCType, re.IGNORECASE): self.command('zip spgw.log.zip spgw*.log', '\$', 60) self.command('rm spgw*.log', '\$', 5) diff --git a/ci-scripts/xml_files/enb_usrp210_band7.xml b/ci-scripts/xml_files/enb_usrp210_band7.xml index 5b15d546f30..4bea6d50e58 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7.xml @@ -104,22 +104,22 @@ <testCase id="040611"> <class>Iperf</class> - <desc>iperf (10MHz - DL/6Mbps/UDP)(60 sec)</desc> - <iperf_args>-u -b 6M -t 60 -i 1</iperf_args> + <desc>iperf (10MHz - DL/10Mbps/UDP)(60 sec)</desc> + <iperf_args>-u -b 10M -t 60 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> </testCase> <testCase id="040612"> <class>Iperf</class> - <desc>iperf (10MHz - DL/13Mbps/UDP)(60 sec)</desc> - <iperf_args>-u -b 13M -t 60 -i 1</iperf_args> + <desc>iperf (10MHz - DL/20Mbps/UDP)(60 sec)</desc> + <iperf_args>-u -b 20M -t 60 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> </testCase> <testCase id="040613"> <class>Iperf</class> - <desc>iperf (10MHz - DL/15Mbps/UDP)(60 sec)</desc> - <iperf_args>-u -b 15M -t 60 -i 1</iperf_args> + <desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)</desc> + <iperf_args>-u -b 30M -t 60 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> </testCase> -- GitLab