Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
7dabcfe0
Commit
7dabcfe0
authored
Feb 07, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-34-test_framework' into develop
parents
71821e94
c303b942
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
570 additions
and
51 deletions
+570
-51
cmake_targets/autotests/README.txt
cmake_targets/autotests/README.txt
+8
-0
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
+2
-0
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+474
-25
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+7
-26
cmake_targets/autotests/tools/lib_autotest.py
cmake_targets/autotests/tools/lib_autotest.py
+33
-0
cmake_targets/tools/start_bladerf.py
cmake_targets/tools/start_bladerf.py
+46
-0
No files found.
cmake_targets/autotests/README.txt
View file @
7dabcfe0
...
...
@@ -163,6 +163,14 @@ Obj.# Case# Test# Description
01 63 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 63 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 65 00 lte-softmodem tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 65 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 65 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 65 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 65 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 65 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 65 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 64 lte-softmodem-noS1 tests
02 Functional test case
...
...
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
View file @
7dabcfe0
...
...
@@ -60,7 +60,9 @@ import paramiko
import
subprocess
import
commands
sys
.
path
.
append
(
'/opt/ssh'
)
sys
.
path
.
append
(
os
.
path
.
expandvars
(
'$OPENAIR_DIR/cmake_targets/autotests/tools/'
))
from
lib_autotest
import
*
import
ssh
from
ssh
import
SSHSession
import
argparse
...
...
cmake_targets/autotests/test_case_list.xml
View file @
7dabcfe0
This diff is collapsed.
Click to expand it.
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
View file @
7dabcfe0
...
...
@@ -21,6 +21,10 @@ 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
...
...
@@ -159,34 +163,11 @@ def reset_ue():
VendorId
=
res
[
0
][
2
]
ProductId
=
res
[
0
][
3
]
usb_dir
=
find_usb_path
(
VendorId
,
ProductId
)
print
usb_dir
print
"Bandrich 4G LTE Adapter found in..."
+
usb_dir
cmd
=
"sudo sh -c
\"
echo 0 > "
+
usb_dir
+
"/authorized
\"
"
os
.
system
(
cmd
+
" ; sleep 5"
)
os
.
system
(
cmd
+
" ; sleep
1
5"
)
cmd
=
"sudo sh -c
\"
echo 1 > "
+
usb_dir
+
"/authorized
\"
"
os
.
system
(
cmd
+
" ; sleep 5"
)
def
read_file
(
filename
):
try
:
file
=
open
(
filename
,
'r'
)
return
file
.
read
()
except
Exception
,
e
:
#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
"
,
""
)
#print "tmpdir = " + tmpdir + " tmpidVendor = " + tmpidVendor + " tmpidProduct = " + tmpidProduct
if
tmpidVendor
==
idVendor
and
tmpidProduct
==
idProduct
:
return
tmpdir
return
''
os
.
system
(
cmd
+
" ; sleep 30"
)
i
=
1
gw
=
'192.172.0.1'
...
...
cmake_targets/autotests/tools/lib_autotest.py
0 → 100644
View file @
7dabcfe0
#!/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
''
cmake_targets/tools/start_bladerf.py
0 → 100755
View file @
7dabcfe0
#!/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"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment