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
lizhongxiao
OpenXG-RAN
Commits
fb0aa111
Commit
fb0aa111
authored
Jun 18, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab CI: minor fixes to bandrich UE conf
parent
22bf711a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
13 deletions
+43
-13
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+26
-6
cmake_targets/tools/build_helper
cmake_targets/tools/build_helper
+17
-7
No files found.
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
View file @
fb0aa111
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
import
time
import
time
import
serial
import
serial
import
os
import
os
from
socket
import
AF_INET
from
pyroute2
import
IPRoute
from
pyroute2
import
IPRoute
import
sys
import
sys
import
re
import
re
...
@@ -97,11 +98,12 @@ signal.signal(signal.SIGINT, signal_handler)
...
@@ -97,11 +98,12 @@ signal.signal(signal.SIGINT, signal_handler)
#ser.isOpen()
#ser.isOpen()
class
pppThread
(
threading
.
Thread
):
class
pppThread
(
threading
.
Thread
):
def
__init__
(
self
,
threadID
,
name
,
counter
):
def
__init__
(
self
,
threadID
,
name
,
counter
,
port
):
threading
.
Thread
.
__init__
(
self
)
threading
.
Thread
.
__init__
(
self
)
self
.
threadID
=
threadID
self
.
threadID
=
threadID
self
.
name
=
name
self
.
name
=
name
self
.
counter
=
counter
self
.
counter
=
counter
self
.
port
=
port
def
run
(
self
):
def
run
(
self
):
print
"Starting "
+
self
.
name
print
"Starting "
+
self
.
name
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
...
@@ -111,6 +113,10 @@ class pppThread (threading.Thread):
...
@@ -111,6 +113,10 @@ class pppThread (threading.Thread):
print
"Starting wvdial now..."
print
"Starting wvdial now..."
print
'exit_flag = '
+
str
(
exit_flag
)
print
'exit_flag = '
+
str
(
exit_flag
)
send_command
(
'AT+CGATT=1'
,
'OK'
,
300
)
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
+
''
)
os
.
system
(
'wvdial -C '
+
bandrich_ppd_config
+
''
)
if
exit_flag
==
1
:
if
exit_flag
==
1
:
print
"Exit flag set to true. Exiting pppThread now"
print
"Exit flag set to true. Exiting pppThread now"
...
@@ -146,6 +152,7 @@ def send_command (cmd, response, timeout):
...
@@ -146,6 +152,7 @@ def send_command (cmd, response, timeout):
def
start_ue
()
:
def
start_ue
()
:
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
global
serial_port
timeout
=
60
#timeout in seconds
timeout
=
60
#timeout in seconds
send_command
(
'AT'
,
'OK'
,
timeout
)
send_command
(
'AT'
,
'OK'
,
timeout
)
send_command
(
'AT+CFUN=1'
,
'OK'
,
timeout
)
send_command
(
'AT+CFUN=1'
,
'OK'
,
timeout
)
...
@@ -153,23 +160,33 @@ def start_ue () :
...
@@ -153,23 +160,33 @@ def start_ue () :
send_command
(
'AT+CGATT=1'
,
'OK'
,
300
)
send_command
(
'AT+CGATT=1'
,
'OK'
,
300
)
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
thread_ppp
=
pppThread
(
1
,
"ppp_thread"
,
1
)
thread_ppp
=
pppThread
(
1
,
"ppp_thread"
,
1
,
port
=
serial_port
)
thread_ppp
.
start
()
thread_ppp
.
start
()
iface
=
'ppp0'
#
iface='ppp0'
while
1
:
while
1
:
time
.
sleep
(
2
)
time
.
sleep
(
2
)
iface
=
''
#Now we check if ppp0 interface is up and running
#Now we check if ppp0 interface is up and running
try
:
try
:
if
exit_flag
==
1
:
if
exit_flag
==
1
:
break
break
cmd
=
"ifconfig -a | sed 's/[
\t
].*//;/^$/d' | grep ppp"
status
,
out
=
commands
.
getstatusoutput
(
cmd
)
iface
=
out
ip
=
IPRoute
()
ip
=
IPRoute
()
idx
=
ip
.
link_lookup
(
ifname
=
iface
)[
0
]
idx
=
ip
.
link_lookup
(
ifname
=
iface
)[
0
]
os
.
system
(
'route add '
+
gw
+
' ppp0'
)
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'
)
os
.
system
(
'sleep 5'
)
os
.
system
(
'ping '
+
gw
)
#print "Starting ping now..."
break
os
.
system
(
'ping -c 1 '
+
gw
)
#break
except
Exception
,
e
:
except
Exception
,
e
:
error
=
' Interface '
+
iface
+
'does not exist...'
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
+
' In function: '
+
sys
.
_getframe
().
f_code
.
co_name
+
': *** Caught exception: '
+
str
(
e
.
__class__
)
+
" : "
+
str
(
e
)
...
@@ -214,14 +231,17 @@ gw='192.172.0.1'
...
@@ -214,14 +231,17 @@ gw='192.172.0.1'
while
i
<
len
(
sys
.
argv
):
while
i
<
len
(
sys
.
argv
):
arg
=
sys
.
argv
[
i
]
arg
=
sys
.
argv
[
i
]
if
arg
==
'--start-ue'
:
if
arg
==
'--start-ue'
:
print
"Turning on UE..."
find_open_port
()
find_open_port
()
print
'Using Serial port : '
+
serial_port
print
'Using Serial port : '
+
serial_port
start_ue
()
start_ue
()
elif
arg
==
'--stop-ue'
:
elif
arg
==
'--stop-ue'
:
print
"Turning off UE..."
find_open_port
()
find_open_port
()
print
'Using Serial port : '
+
serial_port
print
'Using Serial port : '
+
serial_port
stop_ue
()
stop_ue
()
elif
arg
==
'--reset-ue'
:
elif
arg
==
'--reset-ue'
:
print
"Resetting UE..."
find_open_port
()
find_open_port
()
reset_ue
()
reset_ue
()
elif
arg
==
'-gw'
:
elif
arg
==
'-gw'
:
...
...
cmake_targets/tools/build_helper
View file @
fb0aa111
...
@@ -226,7 +226,22 @@ check_install_additional_tools (){
...
@@ -226,7 +226,22 @@ check_install_additional_tools (){
valgrind \
valgrind \
vlan \
vlan \
ctags \
ctags \
ntpdate
ntpdate \
iperf3 \
android-tools-adb
$SUDO pip install paramiko
$SUDO pip install pyroute2
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
echo "Installing Netinterfaces packge...."
$SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces
wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz
tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp
cd /tmp/netifaces-0.10.4
$SUDO python setup.py install
cd -
}
}
check_install_oai_software() {
check_install_oai_software() {
...
@@ -293,8 +308,7 @@ check_install_oai_software() {
...
@@ -293,8 +308,7 @@ check_install_oai_software() {
python-numpy \
python-numpy \
sshpass \
sshpass \
libxslt1-dev \
libxslt1-dev \
android-tools-adb \
android-tools-adb
iperf3
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
...
@@ -303,11 +317,7 @@ check_install_oai_software() {
...
@@ -303,11 +317,7 @@ check_install_oai_software() {
install_nettle_from_source
install_nettle_from_source
install_gnutls_from_source
install_gnutls_from_source
$SUDO pip install paramiko
$SUDO pip install pyroute2
install_asn1c_from_source
install_asn1c_from_source
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
}
}
install_asn1c_from_source(){
install_asn1c_from_source(){
...
...
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