Commit b65065fa authored by Navid Nikaein's avatar Navid Nikaein

merge with the develop

parents ba735d18 8028652a
job1:
script:
- echo $PWD
- echo $USER
- echo $OAI_USER
- echo $OAI_EXTRA_ARGS
- echo $NFS_SHARE_DIR
- echo $EXTERNAL_SHARE_DIR
- echo $SHELL
- git rev-parse --abbrev-ref HEAD
- git_repo=`git config --get remote.origin.url`
- git_head=`git rev-parse HEAD`
- echo $git_head
- tmp=`git show-ref --head | grep $git_head`
- tmp=(${tmp///// })
- git_branch=${tmp[@]:(-1)}
- echo $git_branch
- source oaienv
- echo $OPENAIR_DIR
- NFS_TEST_RESULTS_DIR=$NFS_SHARE_DIR/$git_branch/$git_head
- EXTERNAL_SHARE_RESULTS_DIR=$EXTERNAL_SHARE_DIR/$git_branch/$git_head
- echo $NFS_TEST_RESULTS_DIR
- echo $EXTERNAL_SHARE_RESULTS_DIR
- echo $NRUNS_LTE_SOFTMODEM
- echo $TIMEOUT_CMD
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file log.py
# \brief provides primitives and defines how the logs and statistics are generated
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import sys
import re
import time
import datetime
import array
import xml.etree.ElementTree as ET
debug = False
docfile = ''
start_time = time.time()
testcase_starttime = start_time
debug = 0
stats = {'passed':0, 'failed':0, 'skipped':0, 'internal_errors':0, 'cmd':0}
# xml result (jUnit like)
xUnitTestsuites = ET.Element( 'testsuites' )
xUnitTestsuite = ET.SubElement( xUnitTestsuites, 'testsuite' )
xUnitTestsuite.set( 'name', 'OAI' )
xUnitTestsuite.set( 'timestamp', datetime.datetime.fromtimestamp(start_time).strftime('%Y-%m-%dT%H:%M:%S') )
xUnitTestsuite.set( 'hostname', 'localhost' )
#xUnitSystemOut = ET.SubElement( xUnitTestsuite, 'system-out' )
class bcolors:
header = '\033[95m'
okblue = '\033[94m'
okgreen = '\033[92m'
warning = '\033[93m'
fail = '\033[91m'
normal = '\033[0m'
def __init__(self):
if not sys.stdout.isatty():
self.disable()
def disable(self):
self.header = ''
self.okblue = ''
self.okgreen = ''
self.warning = ''
self.fail = ''
self.normal = ''
class err(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def writefile(logfile, message):
F_testlog = open(logfile, 'a')
F_testlog.write(message + '\n')
F_testlog.close()
def sleep(seconds):
time.sleep(seconds)
def start():
"""Start the timer for the following testcase."""
global testcase_starttime
testcase_starttime = time.time()
def set_debug_level(level):
debug = level
def statistics(logfile):
global start_time
#if stats['passed'] == 0:
# print "no test executed...exiting"
# sys.exit()
total_tests = stats['passed'] + stats['failed'] + stats['skipped']
total_ex_tests = stats['passed'] + stats['failed']
elapsed_time = time.gmtime(time.time() - start_time)
print '\n'
log_record('info', '===============================================')
log_record('info', 'Total tests performed ' + repr(total_tests))
log_record('info', 'Tests passed ' + repr(stats['passed']))
log_record('info', 'Tests failed ' + repr(stats['failed']))
log_record('info', 'Tests skipped ' + repr(stats['skipped']))
log_record('info', '')
log_record('info', 'Total commands sent ' + repr(stats['cmd']))
log_record('info', 'Total elapsed time (h:m:s) ' + time.strftime('%H:%M:%S', elapsed_time))
log_record('info', '===============================================')
log_record('info', 'Testing pass rate ' + repr((stats['passed'] * 100) / total_tests) + '%')
log_record('info', '===============================================')
writefile(logfile, '\n=====================Results===================')
writefile(logfile, 'Total tests performed ' + repr(total_tests))
writefile(logfile, 'Tests passed ' + repr(stats['passed']))
writefile(logfile, 'Tests failed ' + repr(stats['failed']))
writefile(logfile, 'Tests skipped ' + repr(stats['skipped']))
writefile(logfile, '')
writefile(logfile, 'Total commands sent ' + repr(stats['cmd']))
writefile(logfile, 'Total elapsed time (h:m:s) ' + time.strftime('%H:%M:%S', elapsed_time))
writefile(logfile, '===============================================')
writefile(logfile, 'Testing pass rate ' + repr((stats['passed'] * 100) / total_tests) + '%')
writefile(logfile, '===============================================\n')
xUnitTestsuite.set( 'tests', repr(total_tests) )
xUnitTestsuite.set( 'failures', repr(stats['failed']) )
xUnitTestsuite.set( 'skipped', repr(stats['skipped']) )
xUnitTestsuite.set( 'errors', '0' )
time_delta = datetime.datetime.now() - datetime.datetime.fromtimestamp(start_time)
xUnitTestsuite.set( 'time', repr(time_delta.total_seconds()) )
writefile( logfile + '.xml', ET.tostring( xUnitTestsuites, encoding="utf-8", method="xml" ) )
def log_record(level, message):
ts = time.strftime('%d %b %Y %H:%M')
message = ts + ' [' + level + '] ' + message
if level == 'passed' :
print bcolors.okgreen + message + bcolors.normal
elif level == 'failed' :
print bcolors.fail + message + bcolors.normal
elif level == 'skipped' :
print bcolors.warning + message + bcolors.normal
else :
print message
def fail(case, testnum, testname, conf, message, diag, output,trace):
# report(case, testnum, testname, conf, 'failed', output, diag, message)
report(case, testnum, testname, conf, 'failed', output, diag)
log_record('failed', case + testnum + ' : ' + testname + ' ('+ conf+')')
if message :
log_record('failed', "Output follows:\n" + message )
if trace :
log_record('failed', "trace file can be found in " + trace + "\n" )
stats['failed'] += 1
def failquiet(case, testnum, testname, conf):
log_record('failed', case + testnum + ' :' + testname + ' ('+ conf+')')
stats['failed'] += 1
def ok(case, testnum, testname, conf, message, output):
report(case, testnum, testname, conf, 'passed', output)
log_record('passed', case + testnum + ' : ' + testname + ' ('+ conf+')')
if message :
print bcolors.okgreen + message + bcolors.normal
stats['passed'] += 1
def skip(case, testnum, testname, conf, message=None, diag=None, output=None):
log_record('skipped', case + testnum + ' :' + testname + ' ('+ conf+')')
report(case, testnum, testname, conf, 'skipped', output, diag)
if message :
log_record('skipped', "Output follows:\n" + message )
if diag :
log_record('skipped', "Diagnostic: \n" + diag )
stats['skipped'] += 1
def report(case, test, name, conf, status, output, diag=None, desc=None):
writefile (output, '[' +status+ '] ' + case + test + ' : ' + name + ' ('+ conf+')')
if diag :
writefile (output, '-------> ' + diag)
if desc:
writefile(output, desc)
#log_record('report', + case + test + ' documented')
e = ET.SubElement( xUnitTestsuite, 'testcase' )
e.set( 'name', case + '_' + test + '_' + name )
e.set( 'classname', 'shellscript' )
e.set( 'time', repr( time.time() - testcase_starttime ) )
if status == 'failed':
e = ET.SubElement( e, 'failure' )
e.set( 'message', 'failed' )
e.text = diag
if status == 'skipped':
e = ET.SubElement( e, 'skipped' )
This diff is collapsed.
......@@ -20,7 +20,7 @@ test_compile() {
compile_prog=$2
exec_prog=$3
build_dir=$tdir/$1/build
log_file=$tdir/log/test.$1.txt
log_file=$tdir/log/test.$1.$2.$5.txt
target=$5
echo "Compiling test case $test_name. Log file = $log_file"
rm -fr $build_dir
......@@ -34,10 +34,10 @@ test_compile() {
if [ -s $exec_prog ] ; then
cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
echo_success "$test_name $exec_prog $target compiled"
xUnit_success "compilation" $test_name "PASS" 1
xUnit_success "compilation" $test_name "PASS" 1 "$results_file"
else
echo_error "$test_name $exec_prog $target compilation failed"
xUnit_fail "compilation" $test_name "FAIL" 1
xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
fi
}
......
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import os
import commands
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
serial_port=''
ser=serial.Serial()
openair_dir = os.environ.get('OPENAIR_DIR')
if openair_dir == None:
print "Error getting OPENAIR_DIR environment variable"
sys.exit(1)
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
from lib_autotest import *
def find_open_port():
global serial_port, ser
max_ports=100
if os.path.exists(serial_port) == True:
return serial_port
for port in range(2,100):
serial_port = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port) == True:
print 'New Serial Port : ' + serial_port
break
ser = serial.Serial(port=serial_port)
return
#serial_port = '/dev/ttyUSB2'
bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
exit_flag=0
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
print('Resetting the UE to detached state')
timeout=10
exit_flag=1
send_command('AT+CGATT=0' , 'OK' , timeout)
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#ser.open()
#ser.isOpen()
class pppThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print "Starting " + self.name
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
#while 1:
while 1:
time.sleep(5) #Hard coded, do not reduce this number!
print "Starting wvdial now..."
print 'exit_flag = ' + str(exit_flag)
send_command('AT+CGATT=1','OK', 300)
os.system('wvdial -C ' + bandrich_ppd_config + '' )
if exit_flag == 1:
print "Exit flag set to true. Exiting pppThread now"
print "Terminating wvdial now..."
def send_command (cmd, response, timeout):
count=0
sleep_duration = 1
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
global serial_port, ser
while count <= timeout:
try:
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
if os.path.exists(serial_port) == False:
find_open_port()
ser.write (cmd + '\r\n')
out = ''
time.sleep(sleep_duration)
count = count + sleep_duration
while ser.inWaiting() > 0:
out += ser.read(1)
print 'out = <' + out + '> response = <' + response + '> \n'
if re.search(response, out):
break
except Exception, e:
error = ' cmd : ' + cmd + ' response : ' + response
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
timeout=60 #timeout in seconds
send_command('AT', 'OK' , timeout)
send_command('AT+CFUN=1' , 'OK' , timeout)
#send_command('AT+CGATT=0' , 'OK' , timeout)
send_command('AT+CGATT=1','OK', 300)
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
thread_ppp = pppThread(1, "ppp_thread", 1)
thread_ppp.start()
iface='ppp0'
while 1:
time.sleep ( 2)
#Now we check if ppp0 interface is up and running
try:
if exit_flag == 1:
break
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add ' + gw + ' ppp0')
os.system('sleep 5')
os.system ('ping ' + gw)
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
thread_ppp.join()
def stop_ue():
timeout=60
os.system('killall wvdial')
send_command('AT', 'OK' , timeout)
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
send_command('AT+CFUN=4' , 'OK' , timeout)
#reset the USB BUS of Bandrich UE
def reset_ue():
stringIdBandrich='BandRich, Inc. 4G LTE adapter'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "Bandrich 4G LTE Adapter not found. Exiting now..."
sys.exit()
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
res=p.findall(out)
BusId=res[0][0]
DeviceId=res[0][1]
VendorId=res[0][2]
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print "Bandrich 4G LTE Adapter found in..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 15" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 30" )
i=1
gw='192.172.0.1'
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
start_ue()
elif arg == '--stop-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
reset_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
i=i+1
elif arg == '-h' :
print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
print "--stop-ue: Stop the UE. Send DETACH command"
print "--start-ue: Start the UE. Send ATTACH command"
print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
else :
print " Script called with wrong arguments, arg = " + arg
sys.exit()
i = i +1
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import os
import commands
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
serial_port=''
ser=serial.Serial()
openair_dir = os.environ.get('OPENAIR_DIR')
if openair_dir == None:
print "Error getting OPENAIR_DIR environment variable"
sys.exit(1)
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
from lib_autotest import *
def find_open_port():
global serial_port, ser
max_ports=100
if os.path.exists(serial_port) == True:
return serial_port
for port in range(0,100):
serial_port = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port) == True:
print 'New Serial Port : ' + serial_port
break
ser = serial.Serial(port=serial_port)
return
#serial_port = '/dev/ttyUSB2'
bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
exit_flag=0
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
print('Resetting the UE to detached state')
timeout=10
exit_flag=1
send_command('AT+CGATT=0' , 'OK' , timeout)
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#ser.open()
#ser.isOpen()
class pppThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print "Starting " + self.name
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
#while 1:
while 1:
time.sleep(5) #Hard coded, do not reduce this number!
print "Starting wvdial now..."
print 'exit_flag = ' + str(exit_flag)
send_command('AT+CGATT=1','OK', 300)
os.system('wvdial -C ' + bandrich_ppd_config + '' )
if exit_flag == 1:
print "Exit flag set to true. Exiting pppThread now"
print "Terminating wvdial now..."
def send_command (cmd, response, timeout):
count=0
sleep_duration = 1
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
global serial_port, ser
while count <= timeout:
try:
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
if os.path.exists(serial_port) == False:
find_open_port()
ser.write (cmd + '\r\n')
out = ''
time.sleep(sleep_duration)
count = count + sleep_duration
while ser.inWaiting() > 0:
out += ser.read(1)
print 'out = <' + out + '> response = <' + response + '> \n'
if re.search(response, out):
break
except Exception, e:
error = ' cmd : ' + cmd + ' response : ' + response
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
timeout=60 #timeout in seconds
send_command('AT', 'OK' , timeout)
#send_command('AT+CFUN=1' , 'OK' , timeout)
#send_command('AT+CGATT=0' , 'OK' , timeout)
send_command('AT+CGATT=1','OK', 300)
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
thread_ppp = pppThread(1, "ppp_thread", 1)
thread_ppp.start()
iface='ppp0'
while 1:
time.sleep ( 2)
#Now we check if ppp0 interface is up and running
try:
if exit_flag == 1:
break
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add ' + gw + ' ppp0')
os.system('sleep 5')
os.system ('ping ' + gw)
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
thread_ppp.join()
def stop_ue():
timeout=60
os.system('killall wvdial')
send_command('AT', 'OK' , timeout)
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
#send_command('AT+CFUN=4' , 'OK' , timeout)
#reset the USB BUS of Bandrich UE
def reset_ue():
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "Bandrich 4G LTE Adapter not found. Exiting now..."
sys.exit()
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
res=p.findall(out)
BusId=res[0][0]
DeviceId=res[0][1]
VendorId=res[0][2]
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print "Bandrich 4G LTE Adapter found in..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 15" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 30" )
i=1
gw='192.172.0.1'
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
start_ue()
elif arg == '--stop-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
reset_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
i=i+1
elif arg == '-h' :
print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
print "--stop-ue: Stop the UE. Send DETACH command"
print "--start-ue: Start the UE. Send ATTACH command"
print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
else :
print " Script called with wrong arguments, arg = " + arg
sys.exit()
i = i +1
#!/bin/bash
#arg1 idVendor
#arg2 idProduct
argIdVendor=$1
argIdProduct=$2
echo $1
echo $2
for X in /sys/bus/usb/devices/*; do
#echo "$X"
idVendor=`cat "$X/idVendor" 2>/dev/null`
idProduct=`cat "$X/idProduct" 2>/dev/null`
if [ "$argIdVendor" == "$idVendor" ] && [ "$argIdProduct" == "$idProduct" ]
then
echo "$X"
fi
done
#!/bin/bash
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments
args=($*)
timeout=${args[0]}
iface=${args[1]}
iperf_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "iface = $iface"
echo "iperf_args = ${iperf_args[@]}"
sleep $timeout
while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5
iperf ${iperf_args[@]}
#!/usr/bin/python
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import commands
def read_file(filename):
try:
file = open(filename, 'r')
return file.read()
except Exception, e:
# WE just ignore the exception as some files are probably not present
#error = ' Filename ' + filename
#error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
#error = error + traceback.format_exc()
#print error
return ''
def find_usb_path(idVendor, idProduct):
for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False):
for name in dirs:
tmpdir= os.path.join(root, name)
tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","")
tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","")
if tmpidVendor == idVendor and tmpidProduct == idProduct:
return tmpdir
return ''
#!/usr/bin/python
import sys
import re
import os
#Arg 1 name of file
#Arg 2 keyword
#arg 3 replacement text
#Note that these should be seperated by spaces
if len(sys.argv) != 4:
print "search_repl.py: Wrong number of arguments. This program needs 3 arguments. The number of arguments supplied : " + str(sys.argv)
sys.exit()
filename = os.path.expandvars(sys.argv[1])
keyword = sys.argv[2]
replacement_text = sys.argv[3]
file = open(filename, 'r')
string = file.read()
file.close()
if keyword == 'mme_ip_address':
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'IPV4_LIST':
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'rrh_gw_config':
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
else :
replacement_text = keyword + ' = ' + replacement_text + ' ; '
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
#else :
# replacement_text = keyword + ' =\"' + replacement_text + '\" ; '
# string = re.sub(r"%s\s*=\s*\"([^\$]+?)\"\s*;" % keyword , replacement_text, string, re.M)
file = open(filename, 'w')
file.write(string)
file.close()
[Dialer Defaults]
Modem = /dev/ttyUSB0
ISDN = off
Modem Type = Analog Modem
Baud = 9600
Init = ATZ
Init2 = AT+CPIN?
Init3 = AT+CGREG?
Init4 = AT+COPS?
Init5 = AT+CSQ
Init6 =
Init7 = AT+CGATT=1
Init8 =
Init9 =
Phone = *99***1#
Phone1 =
Phone2 =
Phone3 =
Phone4 =
Dial Prefix =
Dial Attempts = 1
Dial Command = ATM1L3DT
Ask Password = off
Password = ''
Username = ImaginLab
Auto Reconnect = off
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = on
Idle Seconds = 0
Auto DNS = on
;Minimize = off
;Dock = off
;Do NOT edit this file by hand!
This diff is collapsed.
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ASN_DEBUG False)
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
......@@ -47,9 +49,9 @@ set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 False )
set ( OPENAIR2 False )
set ( OPENAIR_LTE F )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "epc_test" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
......@@ -74,4 +76,4 @@ set ( SMBV False )
set ( TEST_OMG False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XER_PRINT True )
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME "unitary_tests_simulators")
set(PHYSIM True)
set(RF_BOARD None)
set(XFORMS False)
set(XFORMS True)
set(DEBUG_PHY False)
set(MU_RECIEVER False)
......
cmake_minimum_required(VERSION 2.8)
set(ENABLE_VCD_FIFO False )
set(ENABLE_ITTI False )
set(RF_BOARD "ETHERNET")
set(PACKAGE_NAME "\"rrh_gw\"")
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
This diff is collapsed.
......@@ -22,7 +22,7 @@
# Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
#
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
#
......@@ -121,6 +121,7 @@ function main()
echo "Cleaning TEST_EPC"
fi
rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
rm -Rf build 2>&1
mkdir -m 777 -p -v build
fi
......@@ -140,6 +141,13 @@ function main()
compilations \
epc_test test_epc_generate_scenario \
test_epc_generate_scenario $dbin/test_epc_generate_scenario
compilations \
epc_test test_epc_play_scenario \
test_epc_play_scenario $dbin/test_epc_play_scenario
$SUDO cp -upv test_epc_generate_scenario /usr/local/bin
$SUDO cp -upv test_epc_play_scenario /usr/local/bin
}
......
n=oarf_get_num_detected_cards;
for i=n-1:0
oarf_stop(i);
end
This diff is collapsed.
57,61d56
< /* SystemInformation-r8-IEs */
< typedef struct SystemInformation_r8_IEs {
< struct SystemInformation_r8_IEs__sib_TypeAndInfo {
< A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
< SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
79c74,78
< } choice;
---
> };
>
> struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
> SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
> union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
83c82,87
< } ) list;
---
> };
>
> /* SystemInformation-r8-IEs */
> typedef struct SystemInformation_r8_IEs {
> struct SystemInformation_r8_IEs__sib_TypeAndInfo {
> A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
283c283
< int dynamic = 0;
---
> //int dynamic = 0;
290c290
< dynamic = 1;
---
> //dynamic = 1;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
283c283
< int dynamic = 0;
---
> //int dynamic = 0;
290c290
< dynamic = 1;
---
> //dynamic = 1;
29,31c29
< /* X2ap-CriticalityDiagnostics-IE-List */
< typedef struct X2ap_CriticalityDiagnostics_IE_List {
< A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member {
---
> struct X2ap_CriticalityDiagnostics_IE_List__Member {
43c41,46
< } ) list;
---
> };
>
> /* X2ap-CriticalityDiagnostics-IE-List */
> typedef struct X2ap_CriticalityDiagnostics_IE_List {
> A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member
> ) list;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
File mode changed from 100644 to 100755
......@@ -68,7 +68,7 @@ declare MAX_RATE=1000
# set paths to the required binaries and check if the required binaries are available
ENB_CONFIG=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
OAISIM_EXEC=$OPENAIR_DIR/targets/bin/oaisim_nos1
OAISIM_EXEC=$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1
BYPASSE_ITTI=0
OTGPLOT="$OPENAIR2_DIR/UTIL/OTG/OTGplot"
PS2PDF="ps2pdf"
......@@ -301,8 +301,8 @@ oaisim_otg_stats(){
sync
if [ ! -f $OAISIM_EXEC ]; then
echo_info "3.1 compiling OAISIM ($OPENAIR_TARGETS/cmake_targets/build_oai --oaisim -c)"
($OPENAIR_TARGETS/cmake_targets/build_oai --oaisim -c >> results/perf_log.txt 2>&1 )
echo_info "3.1 compiling OAISIM ($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1)"
($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1 >> results/perf_log.txt 2>&1 )
build_stats=$?
if [ $build_stats != 0 ] ; then
echo_error "$OAISIM_EXEC cannot be built, check results/perf_log.txt file"
......
......@@ -29,9 +29,9 @@
################################################################################
# file run_enb_s1_usrp
# brief run script for eNB USRP.
# author Lionel GAUTHIER
# author Lionel GAUTHIER and Navid Nikaein
# company Eurecom
# email: lionel.gauthier@eurecom.fr
# email: lionel.gauthier@eurecom.fr and navid.nikaein@eurecom.fr
################################
......@@ -56,6 +56,8 @@ function help()
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -e, --ulsch-max-errors num-errs maximum allowed number of uplink errors"
echo_error " -f, --rf-config-file filename RF specific configuration file"
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
......@@ -137,7 +139,27 @@ function main()
shift;
exit 0
;;
-K | --itti-dump-file)
-e | --ulsch-max-errors)
ulsch_max_errors=$2
echo "setting --ulsch-max-errors to $ulsch_max_errors"
exe_arguments="$exe_arguments --ulsch-max-errors=$ulsch_max_errors"
shift 2;
;;
-f | --rf-config-file)
rf_config_file=$2
# can omit file name if last arg on the line
if [ "x$rf_config_file" = "x" ]; then
rf_config_file=null
shift 1;
else
shift 2;
fi
if [ "$rf_config_file" != "null" ]; then
echo "setting --rf-config-file to $rf_config_file"
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
fi
;;
-K | --itti-dump-file)
itti_dump_file=$2
# can omit file name if last arg on the line
if [ "x$itti_dump_file" = "x" ]; then
......
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import commands
if os.environ.get('OPENAIR_DIR') == None:
print "Error getting OPENAIR_DIR environment variable"
sys.exit(1)
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
from lib_autotest import *
def reset_bladerf():
stringIdBladeRF='OpenMoko, Inc'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBladeRF + '\'')
if (out == '') :
print "BladeRF not found. Exiting now..."
sys.exit()
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
res=p.findall(out)
BusId=res[0][0]
DeviceId=res[0][1]
VendorId=res[0][2]
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print "BladeRF Found in directory..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
os.system ('sudo -E bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img')
print "Resettting BladeRF..."
reset_bladerf()
os.system ("dmesg|tail")
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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