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
ZhouShuya
OpenXG-RAN
Commits
ea8a4ebc
Commit
ea8a4ebc
authored
Apr 26, 2019
by
Boris Djalal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test
Signed-off-by:
Boris Djalal
<
boris.djalal@eurecom.fr
>
parent
42f66998
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
25 deletions
+33
-25
ci-scripts/main.py
ci-scripts/main.py
+33
-25
No files found.
ci-scripts/main.py
View file @
ea8a4ebc
...
@@ -67,7 +67,7 @@ import xml.etree.ElementTree as ET
...
@@ -67,7 +67,7 @@ import xml.etree.ElementTree as ET
import
logging
import
logging
import
datetime
import
datetime
import
signal
import
signal
import
platform
#
import platform
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
logging
.
basicConfig
(
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
level
=
logging
.
DEBUG
,
...
@@ -405,9 +405,9 @@ class SSHConnection():
...
@@ -405,9 +405,9 @@ class SSHConnection():
self
.
command
(
'cd /opt/hss_sim0609'
,
'\$'
,
5
)
self
.
command
(
'cd /opt/hss_sim0609'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S rm -f hss.log daemon.log'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S rm -f hss.log daemon.log'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#
linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#
if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#
self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S echo "Starting sudo session" && sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real '
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S echo "Starting sudo session" && sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real '
,
'\$'
,
5
)
self
.
close
()
self
.
close
()
self
.
CreateHtmlTestRow
(
self
.
EPCType
,
'OK'
,
ALL_PROCESSES_OK
)
self
.
CreateHtmlTestRow
(
self
.
EPCType
,
'OK'
,
ALL_PROCESSES_OK
)
...
@@ -518,10 +518,12 @@ class SSHConnection():
...
@@ -518,10 +518,12 @@ class SSHConnection():
self
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh '
,
'\$'
,
5
)
self
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh '
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm -Rf enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm -Rf enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S -E daemon --inherit --unsafe --name=enb'
+
str
(
self
.
eNB_instance
)
+
'_daemon --chdir='
+
self
.
eNBSourceCodePath
+
'/cmake_targets -o '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
#use nohup instead of daemon
#self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
self
.
command
(
'echo $USER; nohup sudo ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
+
' > '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log'
+
' 2>&1 &'
,
self
.
eNBUserName
,
5
)
if
not
rruCheck
:
if
not
rruCheck
:
self
.
eNBLogFile
=
'enb_'
+
self
.
testCase_id
+
'.log'
self
.
eNBLogFile
=
'enb_'
+
self
.
testCase_id
+
'.log'
if
extra_options
!=
''
:
if
extra_options
!=
''
:
...
@@ -653,10 +655,12 @@ class SSHConnection():
...
@@ -653,10 +655,12 @@ class SSHConnection():
self
.
command
(
'chmod 775 ./my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'chmod 775 ./my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S rm -Rf '
+
self
.
UESourceCodePath
+
'/cmake_targets/ue_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S rm -Rf '
+
self
.
UESourceCodePath
+
'/cmake_targets/ue_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S -E daemon --inherit --unsafe --name=ue'
+
str
(
self
.
UE_instance
)
+
'_daemon --chdir='
+
self
.
UESourceCodePath
+
'/cmake_targets/ran_build/build -o '
+
self
.
UESourceCodePath
+
'/cmake_targets/ue_'
+
self
.
testCase_id
+
'.log ./my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
,
'\$'
,
5
)
#use nohup instead of daemon
self
.
command
(
'echo $USER; nohup sudo ./my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
+
' > '
+
self
.
UESourceCodePath
+
'/cmake_targets/ue_'
+
self
.
testCase_id
+
'.log '
+
' 2>&1 &'
,
self
.
UEUserName
,
5
)
#self.command('echo ' + self.UEPassword + ' | sudo -S -E daemon --inherit --unsafe --name=ue' + str(self.UE_instance) + '_daemon --chdir=' + self.UESourceCodePath + '/cmake_targets/ran_build/build -o ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5)
self
.
UELogFile
=
'ue_'
+
self
.
testCase_id
+
'.log'
self
.
UELogFile
=
'ue_'
+
self
.
testCase_id
+
'.log'
time
.
sleep
(
6
)
time
.
sleep
(
6
)
self
.
command
(
'cd ../..'
,
'\$'
,
5
)
self
.
command
(
'cd ../..'
,
'\$'
,
5
)
...
@@ -741,10 +745,12 @@ class SSHConnection():
...
@@ -741,10 +745,12 @@ class SSHConnection():
self
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm -Rf '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm -Rf '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S -E daemon --inherit --unsafe --name=enb'
+
str
(
self
.
eNB_instance
)
+
'_daemon --chdir='
+
self
.
eNBSourceCodePath
+
'/cmake_targets/ran_build/build -o '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
#use nohup instead of daemon
self
.
command
(
'echo $USER; nohup sudo ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
+
' > '
+
self
.
eNBSourceCodePath
+
'/cmake_targets/enb_'
+
self
.
testCase_id
+
'.log'
+
' 2>&1 &'
,
self
.
eNBUserName
,
5
)
#self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
self
.
eNBLogFile
=
'enb_'
+
self
.
testCase_id
+
'.log'
self
.
eNBLogFile
=
'enb_'
+
self
.
testCase_id
+
'.log'
time
.
sleep
(
6
)
time
.
sleep
(
6
)
self
.
command
(
'cd ../..'
,
'\$'
,
5
)
self
.
command
(
'cd ../..'
,
'\$'
,
5
)
...
@@ -2339,10 +2345,12 @@ class SSHConnection():
...
@@ -2339,10 +2345,12 @@ class SSHConnection():
self
.
open
(
self
.
eNBIPAddress
,
self
.
eNBUserName
,
self
.
eNBPassword
)
self
.
open
(
self
.
eNBIPAddress
,
self
.
eNBUserName
,
self
.
eNBPassword
)
self
.
command
(
'cd '
+
self
.
eNBSourceCodePath
+
'/cmake_targets'
,
'\$'
,
5
)
self
.
command
(
'cd '
+
self
.
eNBSourceCodePath
+
'/cmake_targets'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#self.command('source /etc/init.d/functions', '\$', 5)
#use nohup instead of daemon
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S daemon --name=enb'
+
str
(
self
.
eNB_instance
)
+
'_daemon --stop'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S daemon --name=enb'
+
str
(
self
.
eNB_instance
)
+
'_daemon --stop'
,
'\$'
,
5
)
#self.command('echo $USER; nohup sudo ./my-lte-softmodem-run ' + ' > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log' + ' 2>&1 &', self.eNBUserName, 5)
self
.
command
(
'rm -f my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'rm -f my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S killall --signal SIGINT '
+
self
.
air_interface
+
'-softmodem || true'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S killall --signal SIGINT '
+
self
.
air_interface
+
'-softmodem || true'
,
'\$'
,
5
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
...
@@ -2416,9 +2424,9 @@ class SSHConnection():
...
@@ -2416,9 +2424,9 @@ class SSHConnection():
self
.
command
(
'cd scripts'
,
'\$'
,
5
)
self
.
command
(
'cd scripts'
,
'\$'
,
5
)
self
.
command
(
'rm -f ./kill_hss.sh'
,
'\$'
,
5
)
self
.
command
(
'rm -f ./kill_hss.sh'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#
linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#
if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#
self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S daemon --name=simulated_hss --stop'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S daemon --name=simulated_hss --stop'
,
'\$'
,
5
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S killall --signal SIGKILL hss_sim'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
EPCPassword
+
' | sudo -S killall --signal SIGKILL hss_sim'
,
'\$'
,
5
)
...
@@ -2487,9 +2495,9 @@ class SSHConnection():
...
@@ -2487,9 +2495,9 @@ class SSHConnection():
self
.
open
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
)
self
.
open
(
self
.
UEIPAddress
,
self
.
UEUserName
,
self
.
UEPassword
)
self
.
command
(
'cd '
+
self
.
UESourceCodePath
+
'/cmake_targets'
,
'\$'
,
5
)
self
.
command
(
'cd '
+
self
.
UESourceCodePath
+
'/cmake_targets'
,
'\$'
,
5
)
#to use daemon on CentOS we need to source the function
#to use daemon on CentOS we need to source the function
linux_distro
=
platform
.
linux_distribution
()[
0
]
#
linux_distro = platform.linux_distribution()[0]
if
re
.
match
(
'(.*)CentOS(.*)'
,
linux_distro
,
re
.
IGNORECASE
):
#
if re.match('(.*)CentOS(.*)', linux_distro, re.IGNORECASE):
self
.
command
(
'source /etc/init.d/functions'
,
'\$'
,
5
)
#
self.command('source /etc/init.d/functions', '\$', 5)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S daemon --name=ue'
+
str
(
self
.
UE_instance
)
+
'_daemon --stop'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S daemon --name=ue'
+
str
(
self
.
UE_instance
)
+
'_daemon --stop'
,
'\$'
,
5
)
self
.
command
(
'rm -f my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'rm -f my-lte-uesoftmodem-run'
+
str
(
self
.
UE_instance
)
+
'.sh'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S killall --signal SIGINT '
+
self
.
air_interface
+
'-uesoftmodem || true'
,
'\$'
,
5
)
self
.
command
(
'echo '
+
self
.
UEPassword
+
' | sudo -S killall --signal SIGINT '
+
self
.
air_interface
+
'-uesoftmodem || true'
,
'\$'
,
5
)
...
...
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