Merge branch 'develop-nr-merge' into develop-nr
lte-softmodem, lte-uesoftmodem, nr-softmodem, nr-uesoftmodem, polartest, ldpctest, ulsim, dlsim all compile functionality and performance to be tested by CI
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/groovy
|
||||
#!/Bin/groovy
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -41,7 +41,7 @@ pipeline {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test-FDD-Band7"])
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Build gNb-usrp", "Build nr-UE-usrp", "Analysis with cppcheck", "Test phy-sim", "Test-FDD-Band7"])
|
||||
ansiColor('xterm')
|
||||
}
|
||||
|
||||
@@ -146,6 +146,16 @@ pipeline {
|
||||
stage ("Start VM -- ue-ethernet") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
|
||||
stage ("Start VM -- gnb-usrp") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- nu-ue-usrp") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +182,20 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build 5G gNB-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build gNb-usrp") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build 5G NR-UE-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build nr-UE-usrp") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build phy-sim") {
|
||||
@@ -179,20 +203,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-ethernet") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-ethernet") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build UE-ethernet") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build UE-ethernet") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-USRP on Red Hat") {
|
||||
when {
|
||||
expression {doRedHatBuild}
|
||||
@@ -218,7 +228,7 @@ pipeline {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "zip -r -qq vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck enb_eth ue_eth red_hat"
|
||||
sh "zip -r -qq vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck enb_eth ue_eth gnb_usrp nrue_usrp red_hat"
|
||||
}
|
||||
if(fileExists('archives/vm_build_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
|
||||
|
||||
+38
-4
@@ -48,6 +48,8 @@ function usage {
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo " Specify the variant to build."
|
||||
@@ -68,6 +70,8 @@ function variant_usage {
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo ""
|
||||
@@ -147,11 +151,27 @@ case $key in
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
VM_MEMORY=8192
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
|
||||
shift
|
||||
;;
|
||||
-v5)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
ARCHIVES_LOC=gnb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
shift
|
||||
;;
|
||||
-v6)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
ARCHIVES_LOC=nrue_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
shift
|
||||
;;
|
||||
-v7)
|
||||
@@ -196,11 +216,25 @@ case $key in
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
VM_MEMORY=8192
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c"
|
||||
;;
|
||||
gnb-usrp)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
ARCHIVES_LOC=gnb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
;;
|
||||
nu-ue-usrp)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
ARCHIVES_LOC=nrue_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
;;
|
||||
enb-ethernet)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
|
||||
+21
-2
@@ -45,6 +45,8 @@ function usage {
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo " Specify the variant to build."
|
||||
@@ -62,6 +64,8 @@ function variant_usage {
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo ""
|
||||
@@ -115,7 +119,15 @@ case $key in
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
VM_MEMORY=8192
|
||||
shift
|
||||
;;
|
||||
-v5)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
shift
|
||||
;;
|
||||
-v6)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
shift
|
||||
;;
|
||||
-v7)
|
||||
@@ -140,7 +152,13 @@ case $key in
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
VM_MEMORY=8192
|
||||
;;
|
||||
gnb-usrp)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
;;
|
||||
nu-ue-usrp)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
;;
|
||||
enb-ethernet)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
@@ -176,6 +194,7 @@ fi
|
||||
VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"`
|
||||
VM_CMDS=${VM_NAME}_cmds.txt
|
||||
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_MEMORY = $VM_MEMORY MBytes"
|
||||
|
||||
echo "############################################################"
|
||||
|
||||
+433
-47
@@ -45,7 +45,7 @@ import xml.etree.ElementTree as ET
|
||||
import logging
|
||||
import datetime
|
||||
import signal
|
||||
from multiprocessing import Process,Lock
|
||||
from multiprocessing import Process, Lock, SimpleQueue
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
|
||||
@@ -154,6 +154,34 @@ class SSHConnection():
|
||||
else:
|
||||
logging.debug('\u001B[1;37;41m Unexpected Others \u001B[0m')
|
||||
|
||||
def copy(self, ipaddress, username, password, source, destination):
|
||||
logging.debug('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination)
|
||||
scp_spawn = pexpect.spawn('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination, timeout = 5)
|
||||
scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
scp_spawn.sendline('yes')
|
||||
scp_spawn.expect('password:')
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
pass
|
||||
else:
|
||||
logging.debug('1 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 1:
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
pass
|
||||
else:
|
||||
logging.debug('2 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 2:
|
||||
pass
|
||||
else:
|
||||
logging.debug('3 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
|
||||
def BuildeNB(self):
|
||||
if self.eNBIPAddress == '' or self.eNBRepository == '' or self.eNBBranch == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '':
|
||||
Usage()
|
||||
@@ -254,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)
|
||||
@@ -264,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)
|
||||
@@ -274,7 +308,7 @@ class SSHConnection():
|
||||
loopCounter = loopCounter - 1
|
||||
if (loopCounter == 0):
|
||||
doLoop = False
|
||||
logging.debug('\u001B[1;37;43m eNB logging system did not show got sync! See with attach later \u001B[0m')
|
||||
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)
|
||||
# Not getting got sync is bypassed for the moment
|
||||
#sys.exit(1)
|
||||
@@ -319,21 +353,32 @@ class SSHConnection():
|
||||
job.join()
|
||||
self.CreateHtmlTestRow('N/A', 'OK', 0)
|
||||
|
||||
def AttachUE_common(self, device_id):
|
||||
def AttachUE_common(self, device_id, statusQueue, lock):
|
||||
try:
|
||||
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
|
||||
self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/on', '\$', 60)
|
||||
time.sleep(2)
|
||||
count = 45
|
||||
max_count = 45
|
||||
count = max_count
|
||||
while count > 0:
|
||||
self.command('stdbuf -o0 adb -s ' + device_id + ' shell dumpsys telephony.registry | grep mDataConnectionState', '\$', 15)
|
||||
result = re.search('mDataConnectionState.*=(?P<state>[0-9\-]+)', str(self.ssh.before))
|
||||
if result is None:
|
||||
logging.debug('\u001B[1;37;41m mDataConnectionState Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put('mDataConnectionState Not Found!')
|
||||
lock.release()
|
||||
break
|
||||
mDataConnectionState = int(result.group('state'))
|
||||
if mDataConnectionState == 2:
|
||||
logging.debug('\u001B[1mUE (' + device_id + ') Attach Completed\u001B[0m')
|
||||
lock.acquire()
|
||||
statusQueue.put(max_count - count)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put('Attach Completed')
|
||||
lock.release()
|
||||
break
|
||||
count = count - 1
|
||||
if count == 15 or count == 30:
|
||||
@@ -342,11 +387,15 @@ class SSHConnection():
|
||||
time.sleep(0.5)
|
||||
self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/on', '\$', 60)
|
||||
time.sleep(0.5)
|
||||
logging.debug('\u001B[1mWait UE (' + device_id + ') a second until mDataConnectionState=2 (' + str(45-count) + ' times)\u001B[0m')
|
||||
logging.debug('\u001B[1mWait UE (' + device_id + ') a second until mDataConnectionState=2 (' + str(max_count-count) + ' times)\u001B[0m')
|
||||
time.sleep(1)
|
||||
if count == 0:
|
||||
logging.debug('\u001B[1;37;41m UE (' + device_id + ') Attach Failed \u001B[0m')
|
||||
sys.exit(1)
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put('Attach Failed')
|
||||
lock.release()
|
||||
self.close()
|
||||
except:
|
||||
os.kill(os.getppid(),signal.SIGUSR1)
|
||||
@@ -358,14 +407,39 @@ class SSHConnection():
|
||||
initialize_eNB_flag = False
|
||||
self.CheckProcessExist(initialize_eNB_flag)
|
||||
multi_jobs = []
|
||||
status_queue = SimpleQueue()
|
||||
lock = Lock()
|
||||
for device_id in self.UEDevices:
|
||||
p = Process(target = SSH.AttachUE_common, args = (device_id,))
|
||||
p = Process(target = SSH.AttachUE_common, args = (device_id, status_queue, lock,))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
multi_jobs.append(p)
|
||||
for job in multi_jobs:
|
||||
job.join()
|
||||
self.CreateHtmlTestRow('N/A', 'OK', len(self.UEDevices))
|
||||
|
||||
if (status_queue.empty()):
|
||||
self.CreateHtmlTestRow('N/A', 'KO', len(self.UEDevices))
|
||||
sys.exit(1)
|
||||
else:
|
||||
attach_status = True
|
||||
html_queue = SimpleQueue()
|
||||
while (not status_queue.empty()):
|
||||
count = status_queue.get()
|
||||
if (count < 0):
|
||||
attach_status = False
|
||||
device_id = status_queue.get()
|
||||
message = status_queue.get()
|
||||
if (count < 0):
|
||||
html_cell = "<pre>UE (" + device_id + ")\n" + message + "</pre>"
|
||||
else:
|
||||
html_cell = "<pre>UE (" + device_id + ")\n" + message + ' in ' + str(count + 2) + ' seconds</pre>'
|
||||
html_queue.put(html_cell)
|
||||
if (attach_status):
|
||||
self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue)
|
||||
else:
|
||||
self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue)
|
||||
self.CreateHtmlFooter()
|
||||
sys.exit(1)
|
||||
|
||||
def DetachUE_common(self, device_id):
|
||||
try:
|
||||
@@ -481,7 +555,7 @@ class SSHConnection():
|
||||
self.UEIPAddresses.append(UE_IPAddress)
|
||||
self.close()
|
||||
|
||||
def Ping_common(self, lock, UE_IPAddress, device_id):
|
||||
def Ping_common(self, lock, UE_IPAddress, device_id,statusQueue):
|
||||
try:
|
||||
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
|
||||
self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
|
||||
@@ -490,32 +564,65 @@ class SSHConnection():
|
||||
self.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee -a ping_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
|
||||
result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before))
|
||||
if result is None:
|
||||
logging.debug('\u001B[1;37;41m Packet Loss Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
message = 'Packet Loss Not Found!'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(message)
|
||||
lock.release()
|
||||
return
|
||||
packetloss = result.group('packetloss')
|
||||
if float(packetloss) == 100:
|
||||
logging.debug('\u001B[1;37;41m Packet Loss is 100% \u001B[0m')
|
||||
sys.exit(1)
|
||||
message = 'Packet Loss is 100%'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(message)
|
||||
lock.release()
|
||||
return
|
||||
result = re.search('rtt min\/avg\/max\/mdev = (?P<rtt_min>[0-9\.]+)\/(?P<rtt_avg>[0-9\.]+)\/(?P<rtt_max>[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before))
|
||||
if result is None:
|
||||
logging.debug('\u001B[1;37;41m Ping RTT_Min RTT_Avg RTT_Max Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(message)
|
||||
lock.release()
|
||||
return
|
||||
rtt_min = result.group('rtt_min')
|
||||
rtt_avg = result.group('rtt_avg')
|
||||
rtt_max = result.group('rtt_max')
|
||||
pal_msg = 'Packet Loss : ' + packetloss + '%'
|
||||
min_msg = 'RTT(Min) : ' + rtt_min + ' ms'
|
||||
avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms'
|
||||
max_msg = 'RTT(Max) : ' + rtt_max + ' ms'
|
||||
lock.acquire()
|
||||
logging.debug('\u001B[1;37;44m ping result (' + UE_IPAddress + ') \u001B[0m')
|
||||
logging.debug('\u001B[1;34m Packet Loss : ' + packetloss + '%\u001B[0m')
|
||||
logging.debug('\u001B[1;34m RTT(Min) : ' + rtt_min + ' ms' + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m RTT(Avg) : ' + rtt_avg + ' ms' + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m RTT(Max) : ' + rtt_max + ' ms' + '\u001B[0m')
|
||||
lock.release()
|
||||
logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m')
|
||||
qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg
|
||||
packetLossOK = True
|
||||
if packetloss is not None:
|
||||
if float(packetloss) > float(self.ping_packetloss_threshold):
|
||||
qMsg += '\nPacket Loss too high'
|
||||
logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m')
|
||||
sys.exit(1)
|
||||
packetLossOK = False
|
||||
elif float(packetloss) > 0:
|
||||
qMsg += '\nPacket Loss is not 0%'
|
||||
logging.debug('\u001B[1;37;43m Packet Loss is not 0% \u001B[0m')
|
||||
if (packetLossOK):
|
||||
statusQueue.put(0)
|
||||
else:
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put(qMsg)
|
||||
lock.release()
|
||||
self.close()
|
||||
except:
|
||||
os.kill(os.getppid(),signal.SIGUSR1)
|
||||
@@ -530,16 +637,38 @@ class SSHConnection():
|
||||
multi_jobs = []
|
||||
i = 0
|
||||
lock = Lock()
|
||||
status_queue = SimpleQueue()
|
||||
for UE_IPAddress in self.UEIPAddresses:
|
||||
device_id = self.UEDevices[i]
|
||||
p = Process(target = SSH.Ping_common, args = (lock,UE_IPAddress,device_id,))
|
||||
p = Process(target = SSH.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
multi_jobs.append(p)
|
||||
i = i + 1
|
||||
for job in multi_jobs:
|
||||
job.join()
|
||||
self.CreateHtmlTestRow(self.ping_args, 'OK', 0)
|
||||
|
||||
if (status_queue.empty()):
|
||||
self.CreateHtmlTestRow(self.ping_args, 'KO', len(self.UEDevices))
|
||||
sys.exit(1)
|
||||
else:
|
||||
ping_status = True
|
||||
html_queue = SimpleQueue()
|
||||
while (not status_queue.empty()):
|
||||
count = status_queue.get()
|
||||
if (count < 0):
|
||||
ping_status = False
|
||||
device_id = status_queue.get()
|
||||
ip_addr = status_queue.get()
|
||||
message = status_queue.get()
|
||||
html_cell = "<pre>UE (" + device_id + ")\nIP Address : " + ip_addr + "\n" + message + "</pre>"
|
||||
html_queue.put(html_cell)
|
||||
if (ping_status):
|
||||
self.CreateHtmlTestRowQueue(self.ping_args, 'OK', len(self.UEDevices), html_queue)
|
||||
else:
|
||||
self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue)
|
||||
self.CreateHtmlFooter()
|
||||
sys.exit(1)
|
||||
|
||||
def Iperf_ComputeTime(self):
|
||||
result = re.search('-t (?P<iperf_time>\d+)', str(self.iperf_args))
|
||||
@@ -573,7 +702,7 @@ class SSHConnection():
|
||||
sys.exit(1)
|
||||
return result
|
||||
|
||||
def Iperf_analyzeV2Output(self, lock, UE_IPAddress):
|
||||
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))
|
||||
@@ -581,7 +710,25 @@ class SSHConnection():
|
||||
logging.debug('\u001B[1;37;41m Could not connect to iperf server! \u001B[0m')
|
||||
else:
|
||||
logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
return -1
|
||||
# Computing the requested bandwidth in float
|
||||
result = re.search('-b (?P<iperf_bandwidth>[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<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')
|
||||
@@ -589,41 +736,201 @@ class SSHConnection():
|
||||
jitter = result.group('jitter')
|
||||
lock.acquire()
|
||||
logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m')
|
||||
iperfStatus = True
|
||||
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<real_bw>[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')
|
||||
if float(packetloss) > float(self.iperf_packetloss_threshold):
|
||||
msg += 'Packet Loss too high!\n'
|
||||
logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m')
|
||||
lock.release()
|
||||
sys.exit(1)
|
||||
iperfStatus = False
|
||||
if jitter is not None:
|
||||
msg += 'Jitter : ' + jitter + '\n'
|
||||
logging.debug('\u001B[1;34m Jitter : ' + jitter + '\u001B[0m')
|
||||
if (iperfStatus):
|
||||
statusQueue.put(0)
|
||||
else:
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put(msg)
|
||||
lock.release()
|
||||
return 0
|
||||
|
||||
def Iperf_analyzeV2Server(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options):
|
||||
if (not os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')):
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put('Could not analyze from server log')
|
||||
lock.release()
|
||||
return
|
||||
# Computing the requested bandwidth in float
|
||||
result = re.search('-b (?P<iperf_bandwidth>[0-9\.]+)[KMG]', str(iperf_real_options))
|
||||
if result is None:
|
||||
logging.debug('Iperf bandwidth Not Found!')
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put('Could not compute Iperf bandwidth!')
|
||||
lock.release()
|
||||
return
|
||||
else:
|
||||
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
|
||||
|
||||
server_file = open('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', 'r')
|
||||
br_sum = 0.0
|
||||
ji_sum = 0.0
|
||||
pl_sum = 0
|
||||
ps_sum = 0
|
||||
row_idx = 0
|
||||
for line in server_file.readlines():
|
||||
result = re.search('(?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?P<jitter>[0-9\.]+ ms) +(?P<lostPack>[0-9]+)/ +(?P<sentPack>[0-9]+)', str(line))
|
||||
if result is not None:
|
||||
bitrate = result.group('bitrate')
|
||||
jitter = result.group('jitter')
|
||||
packetlost = result.group('lostPack')
|
||||
packetsent = result.group('sentPack')
|
||||
br = bitrate.split(' ')
|
||||
ji = jitter.split(' ')
|
||||
row_idx = row_idx + 1
|
||||
curr_br = float(br[0])
|
||||
pl_sum = pl_sum + int(packetlost)
|
||||
ps_sum = ps_sum + int(packetsent)
|
||||
if (br[1] == 'Kbits/sec'):
|
||||
curr_br = curr_br * 1000
|
||||
if (br[1] == 'Mbits/sec'):
|
||||
curr_br = curr_br * 1000 * 1000
|
||||
br_sum = curr_br + br_sum
|
||||
ji_sum = float(ji[0]) + ji_sum
|
||||
if (row_idx > 0):
|
||||
br_sum = br_sum / row_idx
|
||||
ji_sum = ji_sum / row_idx
|
||||
br_loss = 100 * br_sum / req_bw
|
||||
if (br_sum > 1000):
|
||||
br_sum = br_sum / 1000
|
||||
if (br_sum > 1000):
|
||||
br_sum = br_sum / 1000
|
||||
bitrate = '%.2f Mbits/sec' % br_sum
|
||||
else:
|
||||
bitrate = '%.2f Kbits/sec' % br_sum
|
||||
else:
|
||||
bitrate = '%.2f bits/sec' % br_sum
|
||||
bitperf = '%.2f ' % br_loss
|
||||
bitperf += '%'
|
||||
jitter = '%.2f ms' % (ji_sum)
|
||||
if (ps_sum > 0):
|
||||
pl = float(100 * pl_sum / ps_sum)
|
||||
packetloss = '%2.1f ' % (pl)
|
||||
packetloss += '%'
|
||||
else:
|
||||
packetloss = 'unknown'
|
||||
lock.acquire()
|
||||
if (br_loss < 90):
|
||||
statusQueue.put(1)
|
||||
else:
|
||||
statusQueue.put(0)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
req_msg = 'Req Bitrate : ' + req_bandwidth
|
||||
bir_msg = 'Bitrate : ' + bitrate
|
||||
brl_msg = 'Bitrate Perf: ' + bitperf
|
||||
jit_msg = 'Jitter : ' + jitter
|
||||
pal_msg = 'Packet Loss : ' + packetloss
|
||||
statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n')
|
||||
logging.debug('\u001B[1;37;45m iperf result (' + UE_IPAddress + ') \u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + req_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + bir_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + brl_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + jit_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + pal_msg + '\u001B[0m')
|
||||
lock.release()
|
||||
else:
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put('Could not analyze from server log')
|
||||
lock.release()
|
||||
|
||||
def Iperf_analyzeV3Output(self, lock, UE_IPAddress):
|
||||
server_file.close()
|
||||
|
||||
|
||||
def Iperf_analyzeV3Output(self, lock, UE_IPAddress, device_id, statusQueue):
|
||||
result = re.search('(?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?:|[0-9\.]+ ms +\d+\/\d+ \((?P<packetloss>[0-9\.]+)%\)) +(?:|receiver)\\\\r\\\\n(?:|\[ *\d+\] Sent \d+ datagrams)\\\\r\\\\niperf Done\.', str(self.ssh.before))
|
||||
if result is None:
|
||||
result = re.search('(?P<error>iperf: error - [a-zA-Z0-9 :]+)', str(self.ssh.before))
|
||||
lock.acquire()
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
if result is not None:
|
||||
logging.debug('\u001B[1;37;41m ' + result.group('error') + ' \u001B[0m')
|
||||
statusQueue.put(result.group('error'))
|
||||
else:
|
||||
logging.debug('\u001B[1;37;41m Bitrate and/or Packet Loss Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
statusQueue.put('Bitrate and/or Packet Loss Not Found!')
|
||||
lock.release()
|
||||
|
||||
bitrate = result.group('bitrate')
|
||||
packetloss = result.group('packetloss')
|
||||
lock.acquire()
|
||||
logging.debug('\u001B[1;37;44m iperf result (' + UE_IPAddress + ') \u001B[0m')
|
||||
logging.debug('\u001B[1;34m Bitrate : ' + bitrate + '\u001B[0m')
|
||||
msg = 'Bitrate : ' + bitrate + '\n'
|
||||
iperfStatus = True
|
||||
if packetloss is not None:
|
||||
logging.debug('\u001B[1;34m Packet Loss : ' + packetloss + '%\u001B[0m')
|
||||
msg += 'Packet Loss : ' + packetloss + '%\n'
|
||||
if float(packetloss) > float(self.iperf_packetloss_threshold):
|
||||
logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m')
|
||||
lock.release()
|
||||
sys.exit(1)
|
||||
msg += 'Packet Loss too high!\n'
|
||||
iperfStatus = False
|
||||
if (iperfStatus):
|
||||
statusQueue.put(0)
|
||||
else:
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
lock.release()
|
||||
|
||||
def Iperf_UL_common(self, lock, UE_IPAddress, device_id, idx, ue_num):
|
||||
def Iperf_UL_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue):
|
||||
ipnumbers = UE_IPAddress.split('.')
|
||||
if (len(ipnumbers) == 4):
|
||||
ipnumbers[3] = '1'
|
||||
@@ -645,25 +952,32 @@ class SSHConnection():
|
||||
time.sleep(0.5)
|
||||
|
||||
modified_options = self.Iperf_ComputeModifiedBW(idx, ue_num)
|
||||
modified_options = modified_options.replace('-R','')
|
||||
time.sleep(0.5)
|
||||
|
||||
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)
|
||||
self.Iperf_analyzeV2Output(lock, UE_IPAddress)
|
||||
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)
|
||||
self.command('killall --signal SIGKILL iperf', self.EPCUserName, 5)
|
||||
self.close()
|
||||
if (clientStatus == -1):
|
||||
time.sleep(1)
|
||||
if (os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')):
|
||||
os.remove('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')
|
||||
self.copy(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '.')
|
||||
self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options)
|
||||
|
||||
def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num):
|
||||
def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue):
|
||||
try:
|
||||
# Single-UE profile -- iperf only on one UE
|
||||
if SSH.iperf_profile == 'single-ue' and idx != 0:
|
||||
return
|
||||
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
|
||||
# if by chance ADB server and EPC are on the same remote host, at least log collection will take care 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
|
||||
@@ -672,8 +986,16 @@ class SSHConnection():
|
||||
if result is None:
|
||||
result = re.search('iperf', str(self.ssh.before))
|
||||
if result is None:
|
||||
logging.debug('\u001B[1;37;41m Neither iperf nor iperf3 installed on UE! \u001B[0m')
|
||||
sys.exit(1)
|
||||
message = 'Neither iperf nor iperf3 installed on UE!'
|
||||
lock.acquire()
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
statusQueue.put(-1)
|
||||
statusQueue.put(device_id)
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put(message)
|
||||
lock.release()
|
||||
return
|
||||
#sys.exit(1)
|
||||
else:
|
||||
useIperf3 = True
|
||||
# in case of iperf, UL has its own function
|
||||
@@ -681,7 +1003,7 @@ class SSHConnection():
|
||||
result = re.search('-R', str(self.iperf_args))
|
||||
if result is not None:
|
||||
self.close()
|
||||
self.Iperf_UL_common(lock, UE_IPAddress, device_id, idx, ue_num)
|
||||
self.Iperf_UL_common(lock, UE_IPAddress, device_id, idx, ue_num, statusQueue)
|
||||
return
|
||||
|
||||
if (useIperf3):
|
||||
@@ -704,11 +1026,12 @@ class SSHConnection():
|
||||
if (useIperf3):
|
||||
self.command('stdbuf -o0 iperf3 -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
|
||||
|
||||
self.Iperf_analyzeV3Output(lock, UE_IPAddress)
|
||||
clientStatus = 0
|
||||
self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue)
|
||||
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)
|
||||
|
||||
self.Iperf_analyzeV2Output(lock, UE_IPAddress)
|
||||
clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue, modified_options)
|
||||
self.close()
|
||||
|
||||
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
|
||||
@@ -718,6 +1041,12 @@ class SSHConnection():
|
||||
pid_iperf = result.group('pid')
|
||||
self.command('stdbuf -o0 adb -s ' + device_id + ' shell kill -KILL ' + pid_iperf, '\$', 5)
|
||||
self.close()
|
||||
if (clientStatus == -1):
|
||||
time.sleep(1)
|
||||
if (os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')):
|
||||
os.remove('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')
|
||||
self.copy(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '.')
|
||||
self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options)
|
||||
except:
|
||||
os.kill(os.getppid(),signal.SIGUSR1)
|
||||
|
||||
@@ -732,16 +1061,43 @@ class SSHConnection():
|
||||
i = 0
|
||||
ue_num = len(self.UEIPAddresses)
|
||||
lock = Lock()
|
||||
status_queue = SimpleQueue()
|
||||
for UE_IPAddress in self.UEIPAddresses:
|
||||
device_id = self.UEDevices[i]
|
||||
p = Process(target = SSH.Iperf_common, args = (lock,UE_IPAddress,device_id,i,ue_num,))
|
||||
p = Process(target = SSH.Iperf_common, args = (lock,UE_IPAddress,device_id,i,ue_num,status_queue,))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
multi_jobs.append(p)
|
||||
i = i + 1
|
||||
for job in multi_jobs:
|
||||
job.join()
|
||||
self.CreateHtmlTestRow(self.iperf_args, 'OK', 0)
|
||||
|
||||
if (status_queue.empty()):
|
||||
self.CreateHtmlTestRow(self.iperf_args, 'KO', len(self.UEDevices))
|
||||
sys.exit(1)
|
||||
else:
|
||||
iperf_status = True
|
||||
iperf_noperf = False
|
||||
html_queue = SimpleQueue()
|
||||
while (not status_queue.empty()):
|
||||
count = status_queue.get()
|
||||
if (count < 0):
|
||||
iperf_status = False
|
||||
if (count > 0):
|
||||
iperf_noperf = True
|
||||
device_id = status_queue.get()
|
||||
ip_addr = status_queue.get()
|
||||
message = status_queue.get()
|
||||
html_cell = "<pre>UE (" + device_id + ")\nIP Address : " + ip_addr + "\n" + message + "</pre>"
|
||||
html_queue.put(html_cell)
|
||||
if (iperf_noperf and iperf_status):
|
||||
self.CreateHtmlTestRowQueue(self.iperf_args, 'PERF NOT MET', len(self.UEDevices), html_queue)
|
||||
elif (iperf_status):
|
||||
self.CreateHtmlTestRowQueue(self.iperf_args, 'OK', len(self.UEDevices), html_queue)
|
||||
else:
|
||||
self.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue)
|
||||
self.CreateHtmlFooter()
|
||||
sys.exit(1)
|
||||
|
||||
def CheckProcessExist(self, initialize_eNB_flag):
|
||||
multi_jobs = []
|
||||
@@ -872,6 +1228,7 @@ class SSHConnection():
|
||||
self.command('cd /opt/ltebox/tools', '\$', 5)
|
||||
self.command('echo ' + self.EPCPassword + ' | sudo -S ./stop_mme', '\$', 5)
|
||||
self.close()
|
||||
self.CreateHtmlTestRow('N/A', 'OK', 0)
|
||||
|
||||
def TerminateSPGW(self):
|
||||
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
|
||||
@@ -1099,6 +1456,35 @@ class SSHConnection():
|
||||
i += 1
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
|
||||
def CreateHtmlTestRowQueue(self, options, status, ue_status, ue_queue):
|
||||
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
|
||||
addOrangeBK = False
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td bgcolor = "lightcyan" >' + SSH.testCase_id + '</td>\n')
|
||||
self.htmlFile.write(' <td>' + SSH.desc + '</td>\n')
|
||||
self.htmlFile.write(' <td>' + str(options) + '</td>\n')
|
||||
if (str(status) == 'OK'):
|
||||
self.htmlFile.write(' <td bgcolor = "lightgreen" >' + str(status) + '</td>\n')
|
||||
elif (str(status) == 'KO'):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcoral" >' + str(status) + '</td>\n')
|
||||
else:
|
||||
addOrangeBK = True
|
||||
self.htmlFile.write(' <td bgcolor = "orange" >' + str(status) + '</td>\n')
|
||||
i = 0
|
||||
while (i < self.htmlUEConnected):
|
||||
if (i < ue_status):
|
||||
if (not ue_queue.empty()):
|
||||
if (addOrangeBK):
|
||||
self.htmlFile.write(' <td bgcolor = "orange" >' + str(ue_queue.get()) + '</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td>' + str(ue_queue.get()) + '</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td>-</td>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <td>-</td>\n')
|
||||
i += 1
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Usage()
|
||||
#-----------------------------------------------------------
|
||||
@@ -1110,8 +1496,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]')
|
||||
|
||||
@@ -531,6 +531,27 @@ summary_table_row "UL Simulator - Release 14" ./archives/phy_sim/ulsim.Rel14.txt
|
||||
summary_table_row "Coding - Release 14" ./archives/phy_sim/coding.Rel14.txt "Built target coding" ./phy_sim_row3.html
|
||||
summary_table_footer
|
||||
|
||||
|
||||
if [ -f archives/gnb_usrp/nr-softmodem.Rel14.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build gNB -- USRP option"
|
||||
summary_table_row "LTE SoftModem - Release 15" ./archives/gnb_usrp/nr-softmodem.Rel14.txt "Built target nr-softmodem" ./gnb_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/gnb_usrp/coding.Rel14.txt "Built target coding" ./gnb_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/gnb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/gnb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./gnb_usrp_row4.html
|
||||
summary_table_footer
|
||||
fi
|
||||
|
||||
if [ -f archives/nrue_usrp/nr-uesoftmodem.Rel14.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build 5G NR UE -- USRP option"
|
||||
summary_table_row "UE SoftModem - Release 15" ./archives/nrue_usrp/nr-uesoftmodem.Rel14.txt "Built target nr-uesoftmodem" ./nrue_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/nrue_usrp/coding.Rel14.txt "Built target coding" ./nrue_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/nrue_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./nrue_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/nrue_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./nrue_usrp_row4.html
|
||||
summary_table_footer
|
||||
fi
|
||||
|
||||
summary_table_header "OAI Build eNB -- ETHERNET transport option"
|
||||
summary_table_row "LTE SoftModem w/o S1 - Release 14" ./archives/enb_eth/lte-softmodem-nos1.Rel14.txt "Built target lte-softmodem" ./enb_eth_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/enb_eth/coding.Rel14.txt "Built target coding" ./enb_eth_row2.html
|
||||
@@ -572,6 +593,15 @@ for DETAILS_TABLE in `ls ./phy_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
|
||||
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./nrue_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./enb_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
|
||||
@@ -21,31 +21,31 @@
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<TestCaseRequestedList>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 </TestCaseRequestedList>
|
||||
<TestCaseRequestedList>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 </TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
|
||||
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --codingw --fepw</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030111">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/10MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --codingw --fepw</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030121">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/20MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf --codingw --fepw</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
@@ -138,6 +138,14 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040642">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/9Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 9M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040611">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/10Mbps/UDP)(60 sec)</desc>
|
||||
@@ -182,6 +190,14 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040652">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - UL/20Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040621">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/20Mbps/UDP)(60 sec)</desc>
|
||||
@@ -211,7 +227,7 @@
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040624">
|
||||
<testCase id="040625">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
@@ -226,6 +242,14 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040662">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050101">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
|
||||
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="010102">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w BLADERF -x -c --eNB</Build_eNB_args>
|
||||
<Build_eNB_args>-w BLADERF -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030101">
|
||||
|
||||
Reference in New Issue
Block a user