Commit c863e37b authored by Robert Schmidt's avatar Robert Schmidt

Remove old and unused testing code

parent a1de5e3d
This diff is collapsed.
This diff is collapsed.
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \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.
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then
source $OPENAIR_DIR/cmake_targets/tools/build_helper
else
echo "Error: no file in the file tree: is OPENAIR_DIR variable set?"
exit 1
fi
tdir=$OPENAIR_DIR/cmake_targets/autotests
results_file=$tdir/log/compilation_autotests.xml
# include the jUnit-like logging functions
source $OPENAIR_DIR/cmake_targets/tools/test_helper
test_compile() {
xUnit_start
test_name=$1.$2
compile_prog=$2
exec_prog=$3
build_dir=$tdir/$1/build
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
mkdir -p $tdir/$1/build
cd $build_dir
{
cmake ..
rm -f $exec_prog
make -j`nproc` $compile_prog
} >> $log_file 2>&1
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 "$results_file"
else
echo_error "$test_name $exec_prog $target compilation failed"
xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
fi
}
mkdir -p $tdir/bin $tdir/log
updated=$(svn st -q $OPENAIR_DIR)
if [ "$updated" != "" ] ; then
echo_warning "some files are not in svn:\n $updated"
fi
cd $tdir
test_compile \
010101 oaisim_nos1 \
oaisim_nos1 $tdir/bin/oaisim.r8 rel8.nos1
test_compile \
010102 oaisim_nos1 \
oaisim_nos1 $tdir/bin/oaisim.r8.nas rel8.nos1.nas
cp $tdir/010103/CMakeLists.txt.Rel8 $tdir/010103/CMakeLists.txt
test_compile \
010103 lte-softmodem \
lte-softmodem $tdir/bin/lte-softmodem.r8.rf Rel8.EXMIMO
cp $tdir/010103/CMakeLists.txt.Rel10 $tdir/010103/CMakeLists.txt
test_compile \
010103 lte-softmodem \
lte-softmodem $tdir/bin/lte-softmodem.r10.rf Rel10.EXMIMO
cp $tdir/010103/CMakeLists.txt.USRP $tdir/010103/CMakeLists.txt
test_compile \
010103 lte-softmodem \
lte-softmodem $tdir/bin/lte-softmodem.r10.rf Rel10.USRP
test_compile \
010104 dlsim \
dlsim $tdir/bin/dlsim dlsim.Rel8
test_compile \
010104 ulsim \
ulsim $tdir/bin/ulsim ulsim.Rel8
test_compile \
010104 pucchsim \
pucchsim $tdir/bin/pucchsim pucchsim.Rel8
test_compile \
010104 prachsim \
prachsim $tdir/bin/prachsim prachsim.Rel8
test_compile \
010104 pdcchsim \
pdcchsim $tdir/bin/pdcchsim pdcchsim.Rel8
test_compile \
010104 pbchsim \
pbchsim $tdir/bin/pbchim pbchsim.Rel8
test_compile \
010104 mbmssim \
mbmssim $tdir/bin/mbmssim mbmssim.Rel8
test_compile \
010104 test_secu_knas_encrypt_eia1 \
test_secu_knas_encrypt_eia1 $tdir/bin/test_secu_knas_encrypt_eia1 test_secu_knas_encrypt_eia1.Rel10
test_compile \
010104 test_secu_kenb \
test_secu_kenb $tdir/bin/test_secu_kenb test_secu_kenb.Rel10
test_compile \
010104 test_aes128_ctr_encrypt \
test_aes128_ctr_encrypt $tdir/bin/test_aes128_ctr_encrypt test_aes128_ctr_encrypt.Rel10
test_compile \
010104 test_aes128_ctr_decrypt \
test_aes128_ctr_decrypt $tdir/bin/test_aes128_ctr_decrypt test_aes128_ctr_decrypt.Rel10
test_compile \
010104 test_secu_knas_encrypt_eea2 \
test_secu_knas_encrypt_eea2 $tdir/bin/test_secu_knas_encrypt_eea2 test_secu_knas_encrypt_eea2.Rel10
test_compile \
010104 test_secu_knas \
test_secu_knas $tdir/bin/test_secu_knas test_secu_knas.Rel10
test_compile \
010104 test_secu_knas_encrypt_eea1 \
test_secu_knas_encrypt_eea1 $tdir/bin/test_secu_knas_encrypt_eea1 test_secu_knas_encrypt_eea1.Rel10
test_compile \
010104 test_kdf \
test_kdf $tdir/bin/test_kdf test_kdf.Rel10
test_compile \
010104 test_aes128_cmac_encrypt \
test_aes128_cmac_encrypt $tdir/bin/test_aes128_cmac_encrypt test_aes128_cmac_encrypt.Rel10
test_compile \
010104 test_secu_knas_encrypt_eia2 \
test_secu_knas_encrypt_eia2 $tdir/bin/test_secu_knas_encrypt_eia2 test_secu_knas_encrypt_eia2.Rel10
test_compile \
010106 oaisim \
oaisim $tdir/bin/oaisim.r8.itti Rel8.itti
test_compile \
010107 oaisim_nos1 \
oaisim_nos1 $tdir/bin/oaisim.r10 Rel10.nos1
test_compile \
010108 oaisim \
oaisim $tdir/bin/oaisim.r10.itti rel10.itti
#test_compile \ LG: RAL REMOVED
# test.0114 oaisim \
# oaisim $tdir/bin/oaisim.r8.itti.ral rel8.itti.ral
#test_compile \ LG: RAL REMOVED
# test.0115 oaisim \
# oaisim $tdir/bin/oaisim.r10.itti.ral rel10.itti.ral
test_compile \
010120 nasmesh \
CMakeFiles/nasmesh/nasmesh.ko $tdir/bin/nasmesh.ko
test_compile \
010130 rrh_gw \
rrh_gw $tdir/bin/rrh_gw
# write the test results into a file
xUnit_write "$results_file"
echo "Test Results are written to $results_file"
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>OAI5G UE Autotest Report</title>
<script type="text/javascript">
function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
}
</script>
</head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
</style>
<body>
<center>
<h2>OAI5G UE Autotest Report</h2>
</center>
<p>
<table border>
<caption>Test session configuration</caption>
<tr><td>Start time</td><td>{{test_session_start_time}}</td></tr>
<tr><td>Stop time</td><td>{{test_session_stop_time}}</td></tr>
<tr><td>Duration</td><td>{{test_session_duration}}</td></tr>
<tr><td>MTC host</td><td>{{mtc_host}}</td></tr>
<tr><td>User</td><td>{{user}}</td></tr>
<tr><td>Password</td><td>{{password}}</td></tr>
</table>
</p>
<h3>Test Setup</h3>
To be complete
<br></br>
<h3>UE phy-test performances tests results</h3>
<h4>Objectives</h4>
<p>Checks that OAI UE can achieve at least 75 percent of the theoretical throughput.</p>
<p>Tests are done for all MCS (0 to 28) for 5MHz and 10MHz bandwidth.</p>
<h4>Results</h4>
<table>
<TR><TH>ID</TH><TH>TAG</TH><TH>VERDICT</TH><TH>NB RUNS</TH><TH>PASS</TH><TH>FAILED</TH><TH>INCON</TH><TH>SKIPPED</TH><TH>SEG FAULT</TH><TH>TC Timeout</TH><TH>Start</TH><TH>Stop</TH><TH>Duration</TH><TH>Details</TH></TR>
{% for result in test_results|sort(attribute='testcase_name') %}
<TR>
<TD >{{result.testcase_name}}</TD>
<TD align="right">{{result.tags}}</TD>
{% if result.testcase_verdict == "PASS" %}
<TD align="center" style="background-color:green">{{result.testcase_verdict}}</TD>
{% elif result.testcase_verdict == "FAIL" %}
<TD align="center" style="background-color:red">{{result.testcase_verdict}}</TD>
{% else %}
<TD align="center" style="background-color:orange">{{result.testcase_verdict}}</TD>
{% endif %}
<TD align='center'>{{result.nruns}}</TD>
<TD align='center'>{{result.nb_run_pass}}</TD>
<TD align='center'>{{result.nb_run_failed}}</TD>
<TD align='center'>{{result.nb_run_inc}}</TD>
<TD align='center'>{{result.nb_run_skip}}</TD>
<TD align='center'>{{result.nb_seg_fault}}</TD>
<TD >{{result.testcase_timeout}}</TD>
<TD >{{result.testcase_time_start.strftime('%Y-%m-%d %H:%M:%S')}}</TD>
<TD >{{result.testcase_time_stop.strftime('%Y-%m-%d %H:%M:%S')}}</TD>
<TD >{{result.testcase_duration}}</TD>
<TD ><a href="{{ result.testcase_name }}/{{ result.testcase_name }}_report.html">{{ result.testcase_name }}_report.html</a></TD>
</TR>
{% endfor %}
</table>
<br></br>
<h3>UE phy-test stability tests results</h3>
<h4>Objectives</h4>
<p>To be complete</p>
<h4>Results</h4>
To be complete
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>OAI5G UE test case report</title>
<script type="text/javascript">
function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
}
</script>
</head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
</style>
<body>
<center>
<h2>OAI5G UE test case report details</h2>
</center>
<h3>Test Case description</h3>
<p>
<table border>
<tr><td>ID</td><td>{{testcase_name}}</td></tr>
<tr><td>TAG</td><td>{{tags}}</td></tr>
<tr><td>class</td><td>{{testcaseclass}}</td></tr>
<tr><td>description</td><td></td></tr>
<tr><td>timeout</td><td>{{testcase_timeout}}</td></tr>
<tr><td>number of runs</td><td>{{nruns}}</td></tr>
<tr><td>eNB machine</td><td>{{testcase_eNBMachine}}</td></tr>
<tr><td>UE machine</td><td>{{testcase_UEMachine}}</td></tr>
</table>
</p>
<h3>Test Case execution</h3>
<p>
<table border>
<tr><td>testcase_time_start</td><td>{{testcase_time_start}}</td></tr>
<tr><td>testcase_time_stop</td><td>{{testcase_time_stop}}</td></tr>
<tr><td>testcase_duration</td><td>{{testcase_duration}}</td></tr>
<tr><td>Nb runs</td><td>{{nruns}}</td></tr>
<tr><td>Nb PASS</td><td>{{nb_run_pass}}</td></tr>
<tr><td>Nb FAILED</td><td>{{nb_run_failed}}</td></tr>
<tr><td>Nb INCONCLUSIVE</td><td>{{nb_run_inc}}</td></tr>
<tr>
<td>testcase_verdict</td>
{% if testcase_verdict == "PASS" %}
<TD align="center" style="background-color:green">{{testcase_verdict}}</TD>
{% elif testcase_verdict == "FAIL" %}
<TD align="center" style="background-color:red">{{testcase_verdict}}</TD>
{% else %}
<TD align="center" style="background-color:orange">{{testcase_verdict}}</TD>
{% endif %}
</tr>
<tr><td>Nb Seg Fault</td><td>{{nb_seg_fault}}</td></tr>
</table>
</p>
<h3>Test Case runs results</h3>
{% for run_results in runs_results|sort(attribute='run_id') %}
<h4>RUN {{run_results.run_id}} </h4>
<table border>
<tr><td>run_start_time </td><td>{{run_results.run_start_time}}</td></tr>
<tr><td>run_stop_time</td><td>{{run_results.run_stop_time}}</td></tr>
<tr><td>run_duration</td><td>{{run_results.run_duration}}</td></tr>
<tr>
<td>run_verdict</td>
{% if run_results.run_verdict == "PASS" %}
<TD align="center" style="background-color:green">{{run_results.run_verdict}}</TD>
{% elif run_results.run_verdict == "FAIL" %}
<TD align="center" style="background-color:red">{{run_results.run_verdict}}</TD>
{% else %}
<TD align="center" style="background-color:orange">{{run_results.run_verdict}}</TD>
{% endif %}
</tr>
<tr><td>Seg Fault Satus</td>
{% if run_results.ue_seg_fault_status == "NO_SEG_FAULT" %}
<TD align="center" style="background-color:green">{{run_results.ue_seg_fault_status}}</TD>
{% elif run_results.ue_seg_fault_status == "SEG_FAULT" %}
<TD align="center" style="background-color:red">{{run_results.ue_seg_fault_status}}</TD>
{% else %}
<TD align="center" style="background-color:orange">unknown</TD>
{% endif %}
</tr>
</table>
{% for run_metrics in run_results.runs_metrics %}
<br></br>
<table border>
<tr><td>metric_id</td><td>{{run_metrics.metric_id}}</td></tr>
<tr><td>Description</td><td>{{run_metrics.metric_desc}}</td></tr>
<tr><td>Unit of measure</td><td>{{run_metrics.metric_uom}}</td></tr>
<tr><td>metric_min</td><td>{{run_metrics.metric_min}}</td></tr>
<tr><td>metric_max</td><td>{{run_metrics.metric_max}}</td></tr>
<tr><td>metric_mean</td><td>{{run_metrics.metric_mean}}</td></tr>
<tr><td>metric_median</td><td>{{run_metrics.metric_median}}</td></tr>
<tr><td colspan="2"></td></tr>
{% if run_metrics.pass_fail_stat is defined %}
<tr><td>Pass/fail stat</td><td>{{run_metrics.pass_fail_stat}}</td></tr>
{% endif %}
{% if run_metrics.pass_fail_min_limit is defined %}
<tr><td>Pass/fail min limit</td><td>{{run_metrics.pass_fail_min_limit}}</td></tr>
{% endif %}
{% if run_metrics.pass_fail_max_limit is defined %}
<tr><td>Pass/fail max limit</td><td>{{run_metrics.pass_fail_max_limit}}</td></tr>
{% endif %}
<tr><td colspan="2"></td></tr>
<tr><td>metric_fig</td><td><IMG src={{run_metrics.metric_fig}}></td></tr>
</table>
{% endfor %}
{% if run_results.run_traffic.traffic_count != 0 %}
<br></br>
<table border>
<TR><TH>Iperf metric</TH><TH>min</TH><TH>max</TH><TH>mean</TH><TH>median</TH><TR>
<TR><td>Bandwidth </td><td>{{run_results.run_traffic.bw_min}}</td><td>{{run_results.run_traffic.bw_max}}</td><td>{{run_results.run_traffic.bw_mean}}</td><td>{{run_results.run_traffic.bw_median}}</td><TR>
<TR><td>Jitter</td><td>{{run_results.run_traffic.jitter_min}}</td><td>{{run_results.run_traffic.jitter_max}}</td><td>{{run_results.run_traffic.jitter_mean}}</td><td>{{run_results.run_traffic.jitter_median}}</td><TR>
<TR><td>Loss rate</td><td>{{run_results.run_traffic.rl_min}}</td><td>{{run_results.run_traffic.rl_max}}</td><td>{{run_results.run_traffic.rl_mean}}</td><td>{{run_results.run_traffic.rl_median}}</td><TR>
<TR><td colspan="5"></td></TR>
<TR><td>Iperf duration</td><td>{{run_results.run_traffic.iperf_duration}}</td><td></td><td>Pass/Fail criteria (min duration)</td><td>{{run_results.run_traffic.dur_pass_fail_crit}}</td><TR>
<TR><td colspan="5"></td></TR>
<tr><td>traffic_fig</td><td colspan="4"><IMG src={{run_results.run_traffic.traffic_fig}}></td></tr>
</table>
{% endif %}
{% endfor %}
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#! /usr/bin/python
#******************************************************************************
#
# \file autotest_analyser.py
#
# \par Informations
# - \b Project : UED Autotest Framework
# - \b Software :
#
# \date 16 september 2016
#
# \version 0.1
#
# \brief helper to test lib_autotest_analyser.py
#
# \author Benoit ROBERT (benoit.robert@syrtem.com)
#
# \par Statement of Ownership
# COPYRIGHT (c) 2016 BY SYRTEM S.A.R.L
# This software is furnished under license and may be used and copied
# only in accordance with the terms of such license and with the inclusion
# of the above COPYRIGHT notice. This SOFTWARE or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the SOFTWARE is hereby transferred.
#
# The information in this SOFTWARE is subject to change without notice
# and should not be constructed as a commitment by SYRTEM.
# SYRTEM assumes no responsibility for the use or reliability of its
# SOFTWARE on equipment or platform not explicitly validated by SYRTEM.
#
# *******************************************************************************
import os
import getopt
import sys
from subprocess import call
import encoder
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
#test_cases = ('030001', '030901', '031001', '031601', '031701', '031801', '031901', '032001', '032101', '032201', '032301', '032501', '032601', '032801')
test_cases = ('032800' , '032730' )
nb_run = 2
def error_opt(msg):
print("Option error: " + msg)
def main(args):
try:
analyser = __import__("lib_autotest_analyser")
except ImportError as err:
print('Import error: ' + str(err))
exit(0)
log_path = 'log_save_2016-08-14/log/'
# metric = {}
# metric['id'] = 'UE_DLSCH_BITRATE'
# metric['description'] = 'UE downlink physical throughput'
# metric['regex'] = '(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)'
# metric['unit_of_meas'] = 'kbps'
# metric['min_limit'] = 14668.8
#AUTOTEST Metric : RRC Measurments RSRP[0]=-97.60 dBm/RE, RSSI=-72.83 dBm, RSRQ[0] 9.03 dB, N0 -125 dBm/RE, NF 7.2 dB (frame = 4490)
metric = {}
metric['id'] = 'UE_DL_RRC_MEAS'
metric['description'] = 'UE downlink RRC Measurments'
metric['nb_metric'] = 5
# metric['regex'] = 'AUTOTEST Metric : RRC Measurments (RSRP\[0\])=(-?\d+\.?\d*)\s+(.+),\s+(RSRQ\[0\])=(-?\d+\.?\d*)\s+(.+),,\s+(N0)=(-?\d+\.?\d*)\s+(.+),,\s+(NF)=(-?\d+\.?\d*)\s+(.+)\s+\(frame = (\d+)\) '
metric['regex'] = 'AUTOTEST Metric : RRC Measurments (RSRP\[0\])=(-?\d+\.?\d*)\s+(.+)\,\s+(RSSI)=(-?\d+\.?\d*)\s+(.+)\,\s+(RSRQ\[0\])=(-?\d+\.?\d*)\s+(.+)\,\s+(N0)=(-?\d+\.?\d*)\s+(.+)\,\s+(NF)=(-?\d+\.?\d*)\s+(.+)\s+\(frame = (\d+)\)'
metric['unit_of_meas'] = 'kbps'
metric['min_limit'] = 14668.8
#report_path = log_path+'/report/'
#os.system(' mkdir -p ' + report_path)
#analyser.create_report_html(report_path)
#return(0)
test_results = []
for test_case in test_cases:
for i in range(0, nb_run):
fname = '..//log//'+test_case+'/run_'+str(i)+'/UE_exec_'+str(i)+'_.log'
args = {'metric' : metric,
'file' : fname }
# cell_synch_status = analyser.check_cell_synchro(fname)
# if cell_synch_status == 'CELL_SYNCH':
# print '!!!!!!!!!!!!!! Cell synchronized !!!!!!!!!!!'
# metric_checks_flag = 0
# else :
# print '!!!!!!!!!!!!!! Cell NOT NOT synchronized !!!!!!!!!!!'
# metrics_extracted = analyser.do_extract_metrics_new(args)
# de-xmlfy test report
xml_file = '..//log//'+test_case+'/test.'+test_case+'_ng.xml'
print xml_file
# test_result =
# test_results.append(test_result)
# xmlFile = logdir_local_testcase + '/test.' + testcasename + '.xml'
# xml="\n<testcase classname=\'"+ testcaseclass + "\' name=\'" + testcasename + "."+tags + "\' Run_result=\'" + test_result_string + "\' time=\'" + str(duration) + " s \' RESULT=\'" + testcase_verdict + "\'></testcase> \n"
# write_file(xmlFile, xml, mode="w")
# xmlFile_ng = logdir_local_testcase + '/test.' + testcasename + '_ng.xml'
# xml_ng = xmlify(test_result, wrap=testcasename, indent=" ")
# write_file(xmlFile_ng, xml_ng, mode="w")
# print "min = "+ str( metric_extracted['metric_min'] )
# print "min_index = "+ str( metric_extracted['metric_min_index'] )
# print "max = "+ str( metric_extracted['metric_max'] )
# print "max_index = "+ str( metric_extracted['metric_max_index'] )
# print "mean = "+ str( metric_extracted['metric_mean'] )
# print "median = "+ str( metric_extracted['metric_median'] )
# verdict = analyser.do_check_verdict(metric, metric_extracted)
# print verdict
# fname= 'report/2016-9-8_toto/'+test_case+'/UE_metric_UE_DLSCH_BITRATE_'+str(i)+'_.png'
# fname= 'report/UE_metric_UE_DLSCH_BITRATE_'+test_case+'_'+str(i)+'.png'
# print fname
# analyser.do_img_metrics(metric, metric_extracted, fname)
# fname = 'log//'+test_case+'/run_'+str(i)+'/UE_traffic_'+str(i)+'_.log'
# args = {'file' : fname }
# traffic_metrics = analyser.do_extract_traffic_metrics(args)
# fname= 'report/iperf_'+test_case+'_'+str(i)+'.png'
# print fname
# analyser.do_img_traffic(traffic_metrics, fname)
for test_result in test_results:
cmd = 'mkdir -p ' + report_dir + '/'+ test_result['testcase_name']
result = os.system(cmd)
report_file = report_dir + '/'+ test_result['testcase_name'] + '/'+ test_result['testcase_name']+ '_report.html'
analyser.create_test_report_detailed_html(test_result, report_file )
print test_result
if __name__ == "__main__":
main(sys.argv)
#!/usr/bin/python
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
import time
import serial
import os
from socket import AF_INET
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
serial_port=''
while True:
if os.path.exists(serial_port) == True:
return serial_port
for port in range(0,100):
serial_port_tmp = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port_tmp) == True:
print 'New Serial Port : ' + serial_port_tmp
serial_port = serial_port_tmp
break
if serial_port == '':
print" Not able to detect valid serial ports. Resetting the modem now..."
reset_ue()
else :
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,port):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
self.port=port
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)
#Now we do search and replace on wvdial config file
cmd="sed -i \"s%Modem = .*%Modem = " + self.port + "%g\" " + bandrich_ppd_config
os.system(cmd)
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
time.sleep(1)
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
global serial_port
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,port=serial_port)
thread_ppp.start()
#iface='ppp0'
while 1:
time.sleep ( 2)
iface=''
#Now we check if ppp0 interface is up and running
try:
if exit_flag == 1:
break
cmd="ifconfig -a | sed 's/[ \t].*//;/^$/d' | grep ppp"
status, out = commands.getstatusoutput(cmd)
iface=out
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
print "iface = " + iface
print " Setting route now..."
#os.system("status=1; while [ \"$status\" -ne \"0\" ]; do route add -host " + gw + ' ' + iface + " ; status=$? ;sleep 1; echo \"status = $status\" ; sleep 2; done ")
os.system ('route add -host ' + gw + ' ' + iface + ' 2> /dev/null')
#ip.route('add', dst=gw, oif=iface)
os.system('sleep 5')
#print "Starting ping now..."
os.system ('ping -c 1 ' + 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
print "Sleeping now for 45 seconds...please wait..."
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" )
find_open_port()
stop_ue()
i=1
gw='192.172.0.1'
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-ue' :
print "Turning on UE..."
find_open_port()
print 'Using Serial port : ' + serial_port
start_ue()
elif arg == '--stop-ue' :
print "Turning off UE..."
find_open_port()
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
print "Resetting UE..."
find_open_port()
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
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
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
serial_port=''
while True:
if os.path.exists(serial_port) == True:
return serial_port
for port in range(2,100):
serial_port_tmp = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port_tmp) == True:
print 'New Serial Port : ' + serial_port_tmp
serial_port = serial_port_tmp
break
if serial_port == '':
print" Not able to detect valid serial ports. Resetting the modem now..."
reset_ue()
else :
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
time.sleep(1)
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():
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "Huawei E398 Adapter not found. Exiting now..."
sys.exit()
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 "Huawei E398 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" )
stop_ue()
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' :
find_open_port()
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
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import os
import commands
# Find a device ID by running sudo adb devices
# The device ID below is for Sony Xperia M4
device_id='YT9115PX1E'
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 signal_handler(signal, frame):
print('You pressed Ctrl+C!')
print('Exiting now...')
timeout=10
exit_flag=1
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
# Find all the process IDs in a phone given the name of process
def kill_processes(name):
print " Killing all processes by name..." + name
while 1:
cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"'
status, out = commands.getstatusoutput(cmd)
if status != 0:
print "Error executing command to kill process " + name
print "Error =" + out
sys.exit(1)
print "Out = " + out
if out=='':
break;
out_arr = out.split()
pid_to_kill = out_arr[1]
print "Now killing process ID " + pid_to_kill + " on Phone"
cmd = 'sudo adb -s ' + device_id +' shell "kill -9 ' + pid_to_kill + '"'
status, out = commands.getstatusoutput(cmd)
if status != 0:
print "Error execting command to kill process " + name
sys.exit(1)
print "Out = " + out
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
print 'Killing old iperf/ping sessions'
kill_processes('iperf')
kill_processes('iperf3')
kill_processes('ping')
print "Turning off airplane mode"
os.system('sudo -E adb devices')
os.system('sudo -E adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false\"')
while 1:
time.sleep ( 2)
#Now we check if ppp0 interface is up and running
try:
cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep UP'
status, out = commands.getstatusoutput(cmd)
if (out == '') :
print "Waiting for UE to connect and get IP Address..."
else :
print "UE is now connected. IP Address settings are..." + out
os.system('sleep 5')
os.system ('sudo adb -s ' + device_id + ' shell ping ' + gw)
break
except Exception, e:
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 stop_ue():
print "Turning on airplane mode"
os.system('sudo adb devices')
os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ')
print "Killing iperf/ping sessions"
kill_processes('iperf')
kill_processes('iperf3')
kill_processes('ping')
i=1
gw='192.172.0.1'
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-ue' :
start_ue()
elif arg == '--stop-ue' :
stop_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
i=i+1
elif arg == '-h' :
print "--stop-ue: Stop the UE. Turn on airplane mode"
print "--start-ue: Start the UE. Turn off airplane mode"
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
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
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=''
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 *
#Stop the USB BUS of USRPB210
def stop_usrpb210():
stringIdBandrich='National Instruments Corp.'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "USRP B210 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 "USRP B210 found in..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd)
#Start the USB bus of USRP B210
def start_usrpb210():
stringIdBandrich='National Instruments Corp.'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "USRP B210 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 "USRP B210 found in..." + usb_dir
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd)
i=1
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-usrpb210' :
start_usrpb210()
elif arg == '--stop-usrpb210' :
stop_usrpb210()
elif arg == '-h' :
print "--stop-usrpb210: Stop the USRP B210. It cannot be found in uhd_find_devices"
print "--start-usrpb210: Start the USRP B210. It can now be found in uhd_find_devices"
else :
print " Script called with wrong arguments, arg = " + arg
sys.exit()
i = i +1
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#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
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
# To free unused memory else test setup runs out of memory
mem_threshold=0.2 #If free memory is less than this threshold, then VM drop cache is called
mem_tot=`vmstat -s -S k |grep "total memory" | awk '{print $1}'`
mem_free=`vmstat -s -S k |grep "free memory" | awk '{print $1}'`
mem_frac=`bc <<< "scale=4;$mem_free/$mem_tot"`
echo $mem_frac
#mem_frac=`bc <<< "scale=4;`echo $mem_free`/`echo $mem_tot`"`
echo "Total Memory = $mem_tot k "
echo "Free Memory = $mem_free k"
echo "Fraction free memory = $mem_frac "
res=`bc <<< "$mem_frac < 0.2" `
echo "Comparison Result = $res"
if [ "$res" == "1" ]
then
echo "Free memory less than threshold = $mem_threshold"
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
fi
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#Simple script to retry git clone in case of failure
REALGIT=/usr/bin/git
RETRIES=10
DELAY=10
COUNT=1
while [ $COUNT -lt $RETRIES ]; do
$REALGIT $* >> git-clone-`hostname`-log.txt 2>&1
if [ $? -eq 0 ]; then
RETRIES=0
break
fi
let COUNT=$COUNT+1
sleep $DELAY
done
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments
args=($*)
timeout=${args[0]}
iface=${args[1]}
iperf3_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "iface = $iface"
echo "iperf3_args = ${iperf3_args[@]}"
sleep $timeout
while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5
iperf3 ${iperf3_args[@]}
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf3 arguments
args=($*)
timeout=${args[0]}
device_id=${args[1]}
iperf3_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "device_id = $device_id"
echo "iperf3_args = ${iperf3_args[@]}"
sleep $timeout
while true ; do
cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
if [ -z "$cmd" ]; then
echo "Wating for UE to connect and get IP Address..."
sleep 1
else
echo "UE is now connected. IP Address settings are... $cmd"
break
fi
done
echo "Starting iperf3 now..."
sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]}
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments
echo "Start time of script: `date`"
args=($*)
timeout=${args[0]}
iface=${args[1]}
iperf_args=(${args[@]:2})
ip_client=`echo "$iperf_args" | sed -ne 's/.*\-c[ ]*\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p'`
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "iface = $iface"
echo "iperf_args = ${iperf_args[@]}"
echo "ip_client = $ip_client"
# Test an IP address for validity:
# Usage:
# valid_ip IP_ADDRESS
# if [[ $? -eq 0 ]]; then echo good; else echo bad; fi
# OR
# if valid_ip IP_ADDRESS; then echo good; else echo bad; fi
#
function valid_ip()
{
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
if valid_ip $iface; then
echo "$iface is Valid IP Address. Checking for connectivity..."
ping -c 1 $iface >& /dev/null
while [ "$?" != "0" ]; do
ping -c 1 $iface >& /dev/null
done
echo "$iface connectivity achieved at `date`, Seconds = $SECONDS"
else
echo "Waiting for Interface $iface to come up..."
while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done
echo "$iface is now available at `date` , Seconds = $SECONDS"
fi
#if [ -n "$ip_client" ]; then
#echo "Waiting for route to be setup before iperf makes connection..."
# var=`route -n | grep $ip_client`
# if ["$var" != "" ] ; then break; fi
#
#fi
echo "Sleeping for additional $timeout seconds"
sleep $timeout
echo "Starting iperf at `date` , Seconds = $SECONDS ...."
iperf ${iperf_args[@]}
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments
args=($*)
timeout=${args[0]}
device_id=${args[1]}
iperf_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "device_id = $device_id"
echo "iperf_args = ${iperf_args[@]}"
sleep $timeout
while true ; do
cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
if [ -z "$cmd" ]; then
echo "Wating for UE to connect and get IP Address..."
sleep 1
else
echo "UE is now connected. IP Address settings are... $cmd"
break
fi
done
echo "Starting iperf now..."
sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]}
#!/usr/bin/python
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
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 ''
This diff is collapsed.
#!/bin/bash
#$1 programs to be killed and checked
echo "removing old programs..."
echo "args = $1"
echo "script name = $0"
filename=$(basename "$0")
echo "filename = $filename"
echo "programs to be killed...$1"
echo "bash PID = $$"
pid="$$"
echo "pid = $pid"
echo "Killing programs now..."
ps -aux |grep -E -i -w "$1"
var=`ps -aux |grep -E -i -w "$1" |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /"`
echo "Killing processes...$var"
#var=`ps -aux |grep -E -i '$1' |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /"`
#echo $var
if [ -n "$var" ] ; then sudo kill -9 $var ; fi
#| sudo xargs kill -9
echo "checking for old programs..."
var=`ps -aux |grep -E -i -w '$1' |grep -Ev 'grep' | grep -Ev '$filename'`
echo $var
if [ -n "$var" ]; then echo 'Match found'; else echo 'Match not found' ;fi
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
#arg0 -> Name of executable
#args[1...N] -> arguments to be passed to executable
if [ -z "$OPENAIR_DIR" ]
then
echo "OPENAIR_DIR environment not set. Exiting.."
exit
fi
source $OPENAIR_DIR/cmake_targets/tools/build_helper
args=($*)
exec_name=${args[0]}
exe_args=(${args[@]:1})
gdb_file=$OPENAIR_DIR/targets/bin/gdb_file
gdb_log=$OPENAIR_DIR/targets/bin/gdb_log.bt
echo "args = ${args[@]}"
echo "exec_name = $exec_name"
echo "exe_args = ${exe_args[@]}"
echo "gdb log file = $gdb_log"
$SUDO rm -fr $gdb_file $gdb_log
$SUDO touch $gdb_file $gdb_log
$SUDO chmod 777 $gdb_file $gdb_log
$SUDO echo "file $exec_name" >> $gdb_file
$SUDO echo "set args ${exe_args[@]}" >> $gdb_file
$SUDO echo "run" >> $gdb_file
$SUDO echo "set logging overwrite on" >> $gdb_file
$SUDO echo "set logging file $gdb_log" >> $gdb_file
$SUDO echo "set logging on" >> $gdb_file
$SUDO echo "set pagination off" >> $gdb_file
$SUDO echo "handle SIG33 pass nostop noprint" >> $gdb_file
$SUDO echo "echo backtrace:\n" >> $gdb_file
$SUDO echo "backtrace full" >> $gdb_file
$SUDO echo "echo \n\nVariables:\n" >> $gdb_file
$SUDO echo "info variables" >> $gdb_file
$SUDO echo "echo \n\nlocals:\n" >> $gdb_file
$SUDO echo "info locals" >> $gdb_file
$SUDO echo "echo \n\nregisters:\n" >> $gdb_file
$SUDO echo "info registers" >> $gdb_file
$SUDO echo "echo \n\ncurrent instructions:\n" >> $gdb_file
$SUDO echo "x/16i \$pc" >> $gdb_file
$SUDO echo "echo \n\nthreads backtrace:\n" >> $gdb_file
$SUDO echo "thread apply all backtrace" >> $gdb_file
$SUDO echo "set logging off" >> $gdb_file
$SUDO echo "quit" >> $gdb_file
echo "Contents of gdb_file...start"
$SUDO cat $gdb_file
echo "Contents of gdb_file...finish"
$SUDO gdb -n -x $gdb_file 2>&1
#!/usr/bin/python
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# \author Navid Nikaein, Rohit Gupta
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' or keyword=='GUMMEI_LIST' or keyword == 'TAI_LIST':
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
string = re.sub(r"%s\s*=\s*\(([^\$]+?)\)\s*;" % keyword, 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!
When running lsusb, if you have:
Bus 001 Device 002: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
You need to run:
usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'
After what, running lsusb should give:
Bus 001 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Values of 'Bus' and 'Device' may differ of course.
sudo /opt/ltebox/tools/stop_ltebox || true
sudo /opt/ltebox/tools/start_ltebox
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
sudo /opt/ltebox/tools/stop_ltebox || true
sudo killall -9 hss_sim || true
sudo /opt/hss_sim0609/starthss_real
The configuration for the bandrich in the test setup is a bit hackish.
Here come some notes explaining what we do here.
To get /dev/bandrich.data and /dev/bandrich.control (so that you don't need
to look for which /dev/ttyUSBx are used by your dongle, and always use
the same files, no matter what), add a udev file:
/etc/udev/rules.d/bandrich.rules
containing lines:
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
To avoid NetworkManager to play with the bandrich, add also the line:
ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MM_DEVICE_IGNORE}="1"
Maybe also add; , ENV{ID_MM_DEVICE_IGNORE}="1"
to the two other lines.
Then run: udevadm control --reload-rules
And: service network-manager restart
Change vendor_id/model_id/serial/interface num to match yours.
Use lsusb -v to find values.
At first we used /dev/ttyUSB2 linked to /dev/bandrich for both data (in
the wvdial configuration file) and control (in the python code, opening
/dev/bandrich the standard unix way and read and write into it, with no
special libusb commands).
But it turned out that using /dev/ttyUSB2 for data gives bad throughput
results. We tested downlink UDP at 15Mb/s but the maximum throughput for
a 5MHz cell was around 13, and we had a lot of packets lost at the iperf's
UDP level. Radio was looking fine (all packets acked correctly), so it was
not a radio problem. The dongle in a windows machine was working fine,
15Mbs/s. Using the wvdial configuration file from test setup v1 gave also
good results. The only difference was the use of /dev/ttyUSB0 instead of
/dev/ttyUSB2. Using /dev/ttyUSB0 solved the throughput issue.
But using /dev/ttyUSB0 for control in the pyton code did not work. The
output was incorrect.
So we decided to have /dev/bandrich.data linked to /dev/ttyUSB0 for data
(wvdial) and /dev/bandrich.control linked to /dev/ttyUSB2 for control
(in python code).
It may not be the correct way to go, but it seems to do the trick so far.
Your device may need some other solution.
Here, we get, as result of lsusb -v:
[SNIP]
Bus 003 Device 009: ID 1a8d:100d BandRich, Inc. 4G LTE adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1a8d BandRich, Inc.
idProduct 0x100d 4G LTE adapter
bcdDevice 0.00
iManufacturer 10 BandRich, Inc.
iProduct 9 BandLuxe HSPA-LTE Adapter
iSerial 11 357473040068155
[SNIP]
You can also run:
udevadm monitor
and unplug/replug the dongle. It will print some information.
The command:
udevadm info --export-db
is also important to get the right identifier to put in ENV{}. (It also
gives the correct value.)
Here is extracted what we have for our dongle:
P: /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.2/ttyUSB2/tty/ttyUSB2
N: ttyUSB2
S: bandrich
S: serial/by-id/usb-BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155-if02-port0
S: serial/by-path/pci-0000:00:1a.0-usb-0:1.2:1.2-port0
E: DEVLINKS=/dev/bandrich /dev/serial/by-id/usb-BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155-if02-port0 /dev/serial/by-path/pci-0000:00:1a.0-usb-0:1.2:1.2-port0
E: DEVNAME=/dev/ttyUSB2
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.2/ttyUSB2/tty/ttyUSB2
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=BandLuxe_HSPA-LTE_Adapter
E: ID_MODEL_ENC=BandLuxe\x20HSPA-LTE\x20Adapter
E: ID_MODEL_FROM_DATABASE=4G LTE adapter
E: ID_MODEL_ID=100d
E: ID_PATH=pci-0000:00:1a.0-usb-0:1.2:1.2
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_2_1_2
E: ID_REVISION=0000
E: ID_SERIAL=BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155
E: ID_SERIAL_SHORT=357473040068155
E: ID_TYPE=generic
E: ID_USB_DRIVER=option
E: ID_USB_INTERFACES=:ffffff:020600:0a0000:080650:
E: ID_USB_INTERFACE_NUM=02
E: ID_VENDOR=BandRich__Inc.
E: ID_VENDOR_ENC=BandRich\x2c\x20Inc.
E: ID_VENDOR_FROM_DATABASE=BandRich, Inc.
E: ID_VENDOR_ID=1a8d
E: MAJOR=188
E: MINOR=2
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=672068596
You can also run:
udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB0
udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB2
Note: after creating the udev files, you need to unplug/replug your
dongle for /dev/bandrich.data and /dev/bandrich.control to appear.
Note: the mode 0666 is for everyone to access the dongle (no need for
root privileges). If you prefer you can set it to 0600 (only root)
or 0660 (root and group).
Then you need to configure pppd, to get correct 'route' information when
you run wvdial.
The file /etc/ppp/peers/wvdial should have the following content:
noauth
name wvdial
usepeerdns
defaultroute
replacedefaultroute
The file wvdial.bandrich.conf has been created by copying some information
found on the Internet. Its content may not be fully correct. Adapt to your
situation. It seems to work here.
echo $SERVER_IP
timeout -s 9 20s iperf -c $SERVER_IP -i1
echo $SERVER_IP
echo $UDP_BANDWIDTH
timeout -s 9 20s iperf -c $SERVER_IP -i1 -u -b $UDP_BANDWIDTH
sudo rm -rf /tmp/oai_test_setup
mkdir /tmp/oai_test_setup
cd /tmp/oai_test_setup
git clone $REPOSITORY_URL oai
cd oai
git checkout $COMMIT_ID
cd /tmp/oai_test_setup/oai
source oaienv
cd cmake_targets
rm -rf log
mkdir -p log
echo $BUILD_ARGUMENTS
./build_oai $BUILD_ARGUMENTS
echo $BUILD_OUTPUT
ls $BUILD_OUTPUT
cd /tmp/oai_test_setup/oai
source oaienv
echo $EXEC $EXEC_ARGS
$EXEC $EXEC_ARGS
cd /tmp/oai_test_setup/oai
source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets
rm -rf log
mkdir -p log
echo $PRE_BUILD
bash -c "$PRE_BUILD"
echo $BUILD_PROG $BUILD_ARGUMENTS
$BUILD_PROG $BUILD_ARGUMENTS
echo $PRE_EXEC
bash -c "$PRE_EXEC"
import sys, os, select, re, time
def quit(r):
sys.stdout.flush()
os._exit(r)
class ModemResponse:
def __init__(self, retcode, retstring):
self.ret = retcode
self.data = retstring
class Modem:
def open(self):
self.i = os.open(self.devname, os.O_RDONLY)
self.o = os.open(self.devname, os.O_WRONLY)
#clear output of modem, if any is pending (not sure of this)
while True:
(ri, ro, re) = select.select([self.i], [], [self.i], 0)
if len(ri) == 0:
break
l = os.read(self.i, 65536)
print "WARNING: modem had unread data: '" + \
l.replace('\r', '\\r') + "'"
def __init__(self, devname):
self.devname = devname
self.i = -1
self.o = -1
self.open()
def send(self, s):
print "DEBUG: SEND TO MODEM: '" + s + "'"
os.write(self.o, s+"\r")
def recv(self):
return os.read(self.i, 65536)
def wait(self):
ok = '\r\nOK\r\n'
error = '\r\nERROR\r\n'
cme_error = '\r\nCME ERROR:[^\r]*\r\n'
no_carrier = '\r\nNO CARRIER\r\n'
l = ''
while True:
l = l + self.recv()
print "DEBUG: CURRENT MODEM RESPONSE: '" + \
l.replace('\r','\\r').replace('\n','\\n') + "'"
#AT returned 'things' are "\r\nXXXX\r\n", look for that.
#Check if last one matches 'ok', 'error' or 'cme_error'.
#(Hopefully this is enough and no other reply is possible.)
#This code accepts invalid responses from modem, ie. all
#that does not fit in the 'findall' is thrashed away, maybe
#we want to do something in this case?
res = re.findall('\r\n[^\r]*\r\n', l)
if len(res) == 0:
print "DEBUG: NO MATCH: wait for more input from modem"
continue
last_res = res[len(res)-1]
print "DEBUG: CURRENT LAST LINE: '" + \
last_res.replace('\r','\\r').replace('\n','\\n')+"'"
if re.match(ok, last_res) != None:
return ModemResponse(True, l)
if ( re.match(error, last_res) != None or
re.match(cme_error, last_res) != None or
re.match(no_carrier, last_res) != None):
return ModemResponse(False, l)
#TODO purge?
#re.purge()
def modem_reset_cycle(self):
#close all
os.close(self.i)
os.close(self.o)
self.i = -1
self.o = -1
print "DEBUG: RESET CYCLE: wait for modem to go away"
#wait for file descriptor to go away
while True:
try:
test = os.open(self.devname, os.O_RDONLY)
os.close(test)
time.sleep(0.1)
except BaseException, e:
break
print "DEBUG: RESET CYCLE: modem has gone away"
print "DEBUG: RESET CYCLE: wait for modem to come back"
#wait for file descriptor to be back, try to open it over and over
#TODO: use inotify here? (it's not in basic python as it seems)
while True:
try:
test = os.open(self.devname, os.O_RDONLY)
os.close(test)
break
except BaseException, e:
time.sleep(0.1)
print "DEBUG: RESET CYCLE: modem is back"
#back to business
self.open()
#enable control+C reception (to be refined if it does not work)
stty isig intr ^C
cd /tmp/oai_test_setup/oai
source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/ran_build/build
ulimit -c unlimited
sudo rm -f core
#sudo -E ./lte-softmodem -O $OPENAIR_DIR/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.conf
sudo -E ./lte-softmodem -O /tmp/enb.conf
\ No newline at end of file
stty isig intr ^C
#timeout -s 9 20s iperf -s -i1
iperf -s -i1
stty isig intr ^C
#timeout -s 9 20s iperf -s -i1 -u
iperf -s -i1 -u
#enable control+C reception (to be refined if it does not work)
stty isig intr ^C
cd /tmp/oai_test_setup/oai
source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/autotests/v2/actions
sudo python start_3276.py
sudo wvdial -C wvdial.3276.conf || true
sudo python stop_3276.py
import time
from modem import quit, Modem
try:
modem = Modem("/dev/ttyUSB0")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
if modem.wait().ret != True:
print "ERROR: no modem?"
quit(1)
#first deactivate
print "INFO: deactivate the modem"
modem.send('AT+CFUN=0')
if modem.wait().ret != True:
print "ERROR: failed deactivating the modem"
quit(1)
#activate the modem
print "INFO: activate the modem"
modem.send('AT+CFUN=1')
if modem.wait().ret != True:
print "ERROR: failed asking modem for activation"
quit(1)
#wait for modem to be connected
#timeout after one minute
print "INFO: wait for modem to be connected (timeout: one minute)"
start_time = time.time()
while True:
modem.send('AT+CGATT?')
r = modem.wait()
if r.ret != True:
print "ERROR: failed checking attachment status of modem"
quit(1)
if "+CGATT: 1" in r.data:
break
if not "CGATT: 0" in r.data:
print "ERROR: bad data when checking attachment status of modem"
quit(1)
time.sleep(0.1)
if time.time() > start_time + 60:
print "ERROR: modem not connected after one minute, close modem"
modem.send('AT+CFUN=0')
r = modem.wait()
if r.ret != True:
print "ERROR: closing modem failed"
quit(1)
print "INFO: modem is connected"
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
#enable control+C reception (to be refined if it does not work)
stty isig intr ^C
#If /dev/bandrich is not present when we start the test, what to do?
#The following commented lines are an attempt at solving this.
#This is not satisfying, so we rather do nothing.
##the UE got stuck once, I had to run usb_modeswitch by hand.
##So at this point, if /dev/bandrich does not exist, maybe the UE is
##stuck for whatever reason. Let's forcefully run usb_modeswitch.
#if [ ! -e /dev/bandrich ]; then sudo usb_modeswitch -v 1a8d -p 1000 -I -W -K; true; fi
#
##wait for /dev/bandrich (TODO: use inotify?)
##may fail if the bandrich is in a bad state
#while [ ! -e /dev/bandrich ]; do sleep 1; done
cd /tmp/oai_test_setup/oai
source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/autotests/v2/actions
python start_bandrich.py
sudo wvdial -C wvdial.bandrich.conf || true
python stop_bandrich.py
import time
from modem import quit, Modem
try:
modem = Modem("/dev/bandrich.control")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
if modem.wait().ret != True:
print "ERROR: no modem?"
quit(1)
#activate the modem, be brutal and reset it too!
print "INFO: reset and activate the modem"
modem.send('AT+CFUN=1,1')
if modem.wait().ret != True:
print "ERROR: failed asking modem for activation"
quit(1)
#modem has gone! wait for it to pop up again
modem.modem_reset_cycle()
#wait for modem to be connected
#timeout after one minute
print "INFO: wait for modem to be connected (timeout: one minute)"
start_time = time.time()
while True:
modem.send('AT+CGATT?')
r = modem.wait()
if r.ret != True:
print "ERROR: failed checking attachment status of modem"
quit(1)
if "+CGATT: 1" in r.data:
break
if not "CGATT: 0" in r.data:
print "ERROR: bad data when checking attachment status of modem"
quit(1)
time.sleep(0.1)
if time.time() > start_time + 60:
print "ERROR: modem not connected after one minute, close modem"
modem.send('AT+CFUN=4')
r = modem.wait()
if r.ret != True:
print "ERROR: closing modem failed"
quit(1)
print "INFO: modem is connected"
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
import time
from modem import quit, Modem
try:
modem = Modem("/dev/ttyUSB0")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
r = modem.wait()
if r.ret != True and "NO CARRIER" not in r.data:
print "ERROR: no modem?"
quit(1)
if "NO CARRIER" in r.data:
print "WARNING: 'NO CARRIER' detected, not sure if handled correctly"
#deactivate the modem
print "INFO: deactivate the modem"
modem.send('AT+CFUN=0')
if modem.wait().ret != True:
print "ERROR: failed asking modem for deactivation"
quit(1)
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
import time
from modem import quit, Modem
try:
modem = Modem("/dev/bandrich.control")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
r = modem.wait()
if r.ret != True and "NO CARRIER" not in r.data:
print "ERROR: no modem?"
quit(1)
if "NO CARRIER" in r.data:
print "WARNING: 'NO CARRIER' detected, not sure if handled correctly"
#deactivate the modem
print "INFO: deactivate the modem"
modem.send('AT+CFUN=4')
if modem.wait().ret != True:
print "ERROR: failed asking modem for deactivation"
quit(1)
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
[Dialer Defaults]
Modem = /dev/ttyUSB0
ISDN = off
Modem Type = Analog Modem
Baud = 9600
Init1 = ATZ
Init2 = AT&F &D2 &C1
Init3 = AT+CGDCONT=1,"IP","oai.ipv4"
Phone = *99#
Phone1 =
Phone2 =
Phone3 =
Phone4 =
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!
[Dialer Defaults]
Modem = /dev/bandrich.data
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.
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } );
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "TDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 38;
downlink_frequency = 2580000000L;
uplink_frequency_offset = 0;
Nid_cell = 0;
N_RB_DL = 50;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 0;
pdsch_referenceSignalPower = -24;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -96;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
enable_measurement_reports = "no";
///X2
enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */
tx2_reloc_overall = 2000; /* unit: millisecond */
t_dc_prep = 1000; /* unit: millisecond */
t_dc_overall = 2000; /* unit: millisecond */
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.82/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth6";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.82/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.82/24";
ENB_PORT_FOR_X2C = 36422; # Spec 36422
};
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
};
}
);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -114,7 +114,6 @@ COPY --from=phy-sim-build \
/oai-ran/cmake_targets/autotests/test_case_list.xml \
/opt/oai-physim/cmake_targets/autotests/
COPY --from=phy-sim-build \
/oai-ran/cmake_targets/autotests/tools/free_mem.bash \
/oai-ran/cmake_targets/tools/build_helper \
/oai-ran/cmake_targets/tools/test_helper \
/opt/oai-physim/cmake_targets/tools/
......
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