From ee143ac044860ec1376b4ddc762dc8adef2c68b3 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 21 Aug 2018 15:04:40 +0200 Subject: [PATCH 1/5] CI: fixing and adding more testcases Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/enb_usrp210_band7.xml | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/enb_usrp210_band7.xml b/ci-scripts/xml_files/enb_usrp210_band7.xml index 0bb8d53fcb..2871b00dee 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7.xml @@ -21,7 +21,7 @@ --> - 010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040401 040201 030201 030121 040301 040521 040621 040622 040623 040661 040401 040201 030201 + 010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040642 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040652 040401 040201 030201 030121 040301 040521 040621 040622 040623 040624 040625 040661 040662 040401 040201 030201 @@ -138,6 +138,14 @@ 50 + + Iperf + iperf (5MHz - UL/9Mbps/UDP)(60 sec)(single-ue profile) + -u -b 9M -t 60 -i 1 -R + 50 + single-ue + + Iperf iperf (10MHz - DL/10Mbps/UDP)(60 sec) @@ -182,6 +190,14 @@ 50 + + Iperf + iperf (10MHz - UL/20Mbps/UDP)(60 sec)(single-ue profile) + -u -b 20M -t 60 -i 1 -R + 50 + single-ue + + Iperf iperf (20MHz - DL/20Mbps/UDP)(60 sec) @@ -211,7 +227,7 @@ single-ue - + Iperf iperf (20MHz - DL/70Mbps/UDP)(60 sec)(unbalanced profile) -u -b 70M -t 60 -i 1 @@ -226,6 +242,14 @@ 50 + + Iperf + iperf (20MHz - UL/20Mbps/UDP)(60 sec)(single-ue profile) + -u -b 20M -t 60 -i 1 -R + 50 + single-ue + + Initialize_HSS Initialize HSS From 4bf6f26d494dc620bfdd9dd294fb99f27071e385 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 22 Aug 2018 10:19:14 +0200 Subject: [PATCH 2/5] CI: inverted last iperf UL @20MHz fix main.py help message Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 4 ++-- ci-scripts/xml_files/enb_usrp210_band7.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c3155c7699..83516d3358 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1455,8 +1455,8 @@ def Usage(): print(' --help Show this help.') print(' --mode=[Mode]') print(' TesteNB') - print(' TerminateeNB, TerminateEPC') - print(' LogCollectBuild, LogCollecteNB, LogCollectEPC, LogCollectADB') + print(' TerminateeNB, TerminateUE, TerminateHSS, TerminateMME, TerminateSPGW') + print(' LogCollectBuild, LogCollecteNB, LogCollectHSS, LogCollectMME, LogCollectSPGW, LogCollectPing, LogCollectIperf') print(' --eNBIPAddress=[eNB\'s IP Address]') print(' --eNBRepository=[eNB\'s Repository URL]') print(' --eNBBranch=[eNB\'s Branch Name]') diff --git a/ci-scripts/xml_files/enb_usrp210_band7.xml b/ci-scripts/xml_files/enb_usrp210_band7.xml index 2871b00dee..444f91f094 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7.xml @@ -21,7 +21,7 @@ --> - 010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040642 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040652 040401 040201 030201 030121 040301 040521 040621 040622 040623 040624 040625 040661 040662 040401 040201 030201 + 010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040642 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040652 040401 040201 030201 030121 040301 040521 040621 040622 040623 040624 040625 040662 040661 040401 040201 030201 From 0c83df3ff9939f508bea2bfab706b56bdb8f399c Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 22 Aug 2018 19:15:43 +0200 Subject: [PATCH 3/5] CI: added support for extra options to start eNB added more statistics on iperf server report analysis Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 53 +++++++++++++++++++--- ci-scripts/xml_files/enb_usrp210_band7.xml | 6 +-- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 83516d3358..c453558790 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -282,7 +282,13 @@ class SSHConnection(): self.command('cd ' + self.eNBSourceCodePath, '\$', 5) # Initialize_eNB_args usually start with -O and followed by the location in repository full_config_file = self.Initialize_eNB_args.replace('-O ','') - config_path, config_file = os.path.split(full_config_file) + extIdx = full_config_file.find('.conf') + if (extIdx > 0): + extra_options = full_config_file[extIdx + 5:] + full_config_file = full_config_file[:extIdx + 5] + config_path, config_file = os.path.split(full_config_file) + else: + sys.exit('Insufficient Parameter') ci_full_config_file = config_path + '/ci-' + config_file # Make a copy and adapt to EPC / eNB IP addresses self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) @@ -292,7 +298,7 @@ class SSHConnection(): # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) - self.command('echo "./lte_build_oai/build/lte-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + '" > ./my-lte-softmodem-run.sh ', '\$', 5) + self.command('echo "./lte_build_oai/build/lte-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run.sh ', '\$', 5) self.command('chmod 775 ./my-lte-softmodem-run.sh ', '\$', 5) self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + SSH.testCase_id + '.log ./my-lte-softmodem-run.sh', '\$', 5) time.sleep(6) @@ -696,7 +702,7 @@ class SSHConnection(): sys.exit(1) return result - def Iperf_analyzeV2Output(self, lock, UE_IPAddress, device_id, statusQueue): + def Iperf_analyzeV2Output(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options): result = re.search('Server Report:', str(self.ssh.before)) if result is None: result = re.search('read failed: Connection refused', str(self.ssh.before)) @@ -705,6 +711,24 @@ class SSHConnection(): else: logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m') return -1 + # Computing the requested bandwidth in float + result = re.search('-b (?P[0-9\.]+)[KMG]', str(iperf_real_options)) + if result is not None: + req_bandwidth = result.group('iperf_bandwidth') + req_bw = float(req_bandwidth) + result = re.search('-b [0-9\.]+K', str(iperf_real_options)) + if result is not None: + req_bandwidth = '%.1f Kbits/sec' % req_bw + req_bw = req_bw * 1000 + result = re.search('-b [0-9\.]+M', str(iperf_real_options)) + if result is not None: + req_bandwidth = '%.1f Mbits/sec' % req_bw + req_bw = req_bw * 1000000 + result = re.search('-b [0-9\.]+G', str(iperf_real_options)) + if result is not None: + req_bandwidth = '%.1f Gbits/sec' % req_bw + req_bw = req_bw * 1000000000 + result = re.search('Server Report:\\\\r\\\\n(?:|\[ *\d+\].*) (?P[0-9\.]+ [KMG]bits\/sec) +(?P[0-9\.]+ ms) +(\d+\/..\d+) (\((?P[0-9\.]+)%\))', str(self.ssh.before)) if result is not None: bitrate = result.group('bitrate') @@ -713,10 +737,27 @@ class SSHConnection(): lock.acquire() logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m') iperfStatus = True - msg = '' + msg = 'Req Bitrate : ' + req_bandwidth + '\n' + logging.debug('\u001B[1;34m Req Bitrate : ' + req_bandwidth + '\u001B[0m') if bitrate is not None: msg += 'Bitrate : ' + bitrate + '\n' logging.debug('\u001B[1;34m Bitrate : ' + bitrate + '\u001B[0m') + result = re.search('(?P[0-9\.]+) [KMG]bits/sec', str(bitrate)) + if result is not None: + actual_bw = float(str(result.group('real_bw'))) + result = re.search('[0-9\.]+ K', bitrate) + if result is not None: + actual_bw = actual_bw * 1000 + result = re.search('[0-9\.]+ M', bitrate) + if result is not None: + actual_bw = actual_bw * 1000000 + result = re.search('[0-9\.]+ G', bitrate) + if result is not None: + actual_bw = actual_bw * 1000000000 + br_loss = 100 * actual_bw / req_bw + bitperf = '%.2f ' % br_loss + msg += 'Bitrate Perf: ' + bitperf + '%\n' + logging.debug('\u001B[1;34m Bitrate Perf: ' + bitperf + '%\u001B[0m') if packetloss is not None: msg += 'Packet Loss : ' + packetloss + '%\n' logging.debug('\u001B[1;34m Packet Loss : ' + packetloss + '%\u001B[0m') @@ -916,7 +957,7 @@ class SSHConnection(): self.command('rm -f iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) self.command('stdbuf -o0 adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '" 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) - clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue) + clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue, modified_options) # Launch iperf server on EPC side self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) @@ -990,7 +1031,7 @@ class SSHConnection(): else: self.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) - clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue) + clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue, modified_options) self.close() self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) diff --git a/ci-scripts/xml_files/enb_usrp210_band7.xml b/ci-scripts/xml_files/enb_usrp210_band7.xml index 444f91f094..b8a2439106 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7.xml @@ -33,19 +33,19 @@ Initialize_eNB Initialize eNB (FDD/Band7/5MHz) - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --codingw --fepw Initialize_eNB Initialize eNB (FDD/Band7/10MHz) - -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf + -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --codingw --fepw Initialize_eNB Initialize eNB (FDD/Band7/20MHz) - -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf + -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf --codingw --fepw From 8b46aea34d7b942aa2a27e073c3a096f425b2968 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 24 Aug 2018 11:57:13 +0200 Subject: [PATCH 4/5] CI: optimization on scripts Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.100PRB.usrpb210.conf | 2 +- .../enb.band7.tm1.25PRB.usrpb210.conf | 2 +- .../enb.band7.tm1.50PRB.usrpb210.conf | 2 +- ci-scripts/main.py | 18 ++++++++++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index 2bd28a60df..4380bd30be 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -33,7 +33,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 100; diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index 102fc89a13..dded9cfdeb 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -33,7 +33,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 25; diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index fe6e2f0b59..7c4292eb61 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -33,7 +33,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c453558790..c08db90946 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -308,17 +308,25 @@ class SSHConnection(): loopCounter = loopCounter - 1 if (loopCounter == 0): doLoop = False + # Checking if process is still alive + self.command('stdbuf -o0 ps -aux | grep -v grep | grep --color=never lte-softmodem', '\$', 5) + result = re.search('lte-softmodem', str(self.ssh.before)) + if result is None: + logging.debug('\u001B[1;37;41m eNB process is already down \u001B[0m') + self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'KO', 0) + self.CreateHtmlFooter() + sys.exit(1) logging.debug('\u001B[1;30;43m eNB logging system did not show got sync! See with attach later \u001B[0m') - self.CreateHtmlTestRow(config_file, 'eNB not showing got sync!', 0) + self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'eNB not showing got sync!', 0) # Not getting got sync is bypassed for the moment #sys.exit(1) - self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | grep -i sync', '\$', 10) + self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | grep --color=never -i sync', '\$', 10) result = re.search('got sync', str(self.ssh.before)) if result is None: time.sleep(6) else: doLoop = False - self.CreateHtmlTestRow(config_file, 'OK', 0) + self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', 0) logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') self.close() @@ -650,6 +658,7 @@ class SSHConnection(): if (status_queue.empty()): self.CreateHtmlTestRow(self.ping_args, 'KO', len(self.UEDevices)) + self.CreateHtmlFooter() sys.exit(1) else: ping_status = True @@ -695,7 +704,7 @@ class SSHConnection(): else: iperf_bandwidth_new = residualBW iperf_bandwidth_str = '-b ' + iperf_bandwidth - iperf_bandwidth_str_new = '-b ' + str(iperf_bandwidth_new) + iperf_bandwidth_str_new = '-b ' + ('%.2f' % iperf_bandwidth_new) result = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(self.iperf_args)) if result is None: logging.debug('\u001B[1;37;41m Calculate Iperf bandwidth Failed! \u001B[0m') @@ -1074,6 +1083,7 @@ class SSHConnection(): if (status_queue.empty()): self.CreateHtmlTestRow(self.iperf_args, 'KO', len(self.UEDevices)) + self.CreateHtmlFooter() sys.exit(1) else: iperf_status = True From e469680d8049a01bad372238a0b9e95c3aa43403 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 24 Aug 2018 14:37:40 +0200 Subject: [PATCH 5/5] CI: fix in python Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c08db90946..d172d66545 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -300,6 +300,7 @@ class SSHConnection(): self.command('cd cmake_targets', '\$', 5) self.command('echo "./lte_build_oai/build/lte-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run.sh ', '\$', 5) self.command('chmod 775 ./my-lte-softmodem-run.sh ', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf enb_' + SSH.testCase_id + '.log', '\$', 5) self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + SSH.testCase_id + '.log ./my-lte-softmodem-run.sh', '\$', 5) time.sleep(6) doLoop = True @@ -309,26 +310,34 @@ class SSHConnection(): if (loopCounter == 0): doLoop = False # Checking if process is still alive - self.command('stdbuf -o0 ps -aux | grep -v grep | grep --color=never lte-softmodem', '\$', 5) - result = re.search('lte-softmodem', str(self.ssh.before)) - if result is None: - logging.debug('\u001B[1;37;41m eNB process is already down \u001B[0m') - self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'KO', 0) - self.CreateHtmlFooter() - sys.exit(1) + #self.command('stdbuf -o0 ps -aux | grep -v grep | grep --color=never lte-softmodem', '\$', 5) + #result = re.search('lte-softmodem', str(self.ssh.before)) + #if result is None: + # self.command('rsync -v enb_' + SSH.testCase_id + '.log enb_' + SSH.testCase_id + '.txt; stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | egrep --color=never -i "segmentation fault"', '\$', 5) + # result = re.search('egmentation fault', str(self.ssh.before)) + # logging.debug('\u001B[1;37;41m eNB process is already down \u001B[0m') + # if result is not None: + # logging.debug('\u001B[1;37;41m Segmentation fault \u001B[0m') + # logging.debug(str(self.ssh.before)) + # self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'KO', 0) + # self.CreateHtmlFooter() + # self.close() + # sys.exit(1) logging.debug('\u001B[1;30;43m eNB logging system did not show got sync! See with attach later \u001B[0m') self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'eNB not showing got sync!', 0) # Not getting got sync is bypassed for the moment #sys.exit(1) - self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | grep --color=never -i sync', '\$', 10) - result = re.search('got sync', str(self.ssh.before)) - if result is None: - time.sleep(6) else: - doLoop = False - self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', 0) - logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') + self.command('rsync -v enb_' + SSH.testCase_id + '.log enb_' + SSH.testCase_id + '.txt; stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | grep --color=never -i sync', '\$', 4) + result = re.search('got sync', str(self.ssh.before)) + if result is None: + time.sleep(6) + else: + doLoop = False + self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', 0) + logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') + self.command('rm -f enb_' + SSH.testCase_id + '.txt', '\$', 5) self.close() def InitializeUE_common(self, device_id):