Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
37c7e29f
Commit
37c7e29f
authored
Sep 13, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI scripted deployment of OAI CN5G
parent
0e4b5a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
ci-scripts/epc.py
ci-scripts/epc.py
+13
-1
No files found.
ci-scripts/epc.py
View file @
37c7e29f
...
@@ -220,7 +220,7 @@ class EPCManagement():
...
@@ -220,7 +220,7 @@ class EPCManagement():
mySSH
=
SSH
.
SSHConnection
()
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
if
re
.
match
(
'ltebox'
,
self
.
Type
,
re
.
IGNORECASE
):
if
re
.
match
(
'ltebox'
,
self
.
Type
,
re
.
IGNORECASE
):
logging
.
debug
(
'Using the
sabox
simulated HSS'
)
logging
.
debug
(
'Using the
SABOX
simulated HSS'
)
mySSH
.
command
(
'if [ -d '
+
self
.
SourceCodePath
+
'/scripts ]; then echo '
+
self
.
Password
+
' | sudo -S rm -Rf '
+
self
.
SourceCodePath
+
'/scripts ; fi'
,
'\$'
,
5
)
mySSH
.
command
(
'if [ -d '
+
self
.
SourceCodePath
+
'/scripts ]; then echo '
+
self
.
Password
+
' | sudo -S rm -Rf '
+
self
.
SourceCodePath
+
'/scripts ; fi'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir -p '
+
self
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir -p '
+
self
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/hss_sim0609'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/hss_sim0609'
,
'\$'
,
5
)
...
@@ -229,6 +229,13 @@ class EPCManagement():
...
@@ -229,6 +229,13 @@ class EPCManagement():
logging
.
debug
(
'Using the sabox'
)
logging
.
debug
(
'Using the sabox'
)
mySSH
.
command
(
'cd /opt/ltebox/tools'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/ltebox/tools'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./start_sabox'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./start_sabox'
,
'\$'
,
5
)
elif
re
.
match
(
'OAI'
,
self
.
Type
,
re
.
IGNORECASE
):
logging
.
debug
(
'Starting OAI CN5G'
)
mySSH
.
command
(
'if [ -d '
+
self
.
SourceCodePath
+
'/scripts ]; then echo '
+
self
.
Password
+
' | sudo -S rm -Rf '
+
self
.
SourceCodePath
+
'/scripts ; fi'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir -p '
+
self
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./core-network.sh start nrf spgwu'
,
'\$'
,
5
)
time
.
sleep
(
20
)
#leave some time for deployment and health check
else
:
else
:
logging
.
error
(
'This option should not occur!'
)
logging
.
error
(
'This option should not occur!'
)
mySSH
.
close
()
mySSH
.
close
()
...
@@ -433,6 +440,7 @@ class EPCManagement():
...
@@ -433,6 +440,7 @@ class EPCManagement():
mySSH
=
SSH
.
SSHConnection
()
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
mySSH
.
open
(
self
.
IPAddress
,
self
.
UserName
,
self
.
Password
)
if
re
.
match
(
'ltebox'
,
self
.
Type
,
re
.
IGNORECASE
):
if
re
.
match
(
'ltebox'
,
self
.
Type
,
re
.
IGNORECASE
):
logging
.
debug
(
'Terminating SA BOX'
)
mySSH
.
command
(
'cd /opt/ltebox/tools'
,
'\$'
,
5
)
mySSH
.
command
(
'cd /opt/ltebox/tools'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./stop_sabox'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./stop_sabox'
,
'\$'
,
5
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -440,6 +448,10 @@ class EPCManagement():
...
@@ -440,6 +448,10 @@ class EPCManagement():
mySSH
.
command
(
'cd scripts'
,
'\$'
,
5
)
mySSH
.
command
(
'cd scripts'
,
'\$'
,
5
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S screen -S simulated_5g_hss -X quit'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S screen -S simulated_5g_hss -X quit'
,
'\$'
,
5
)
elif
re
.
match
(
'OAI'
,
self
.
Type
,
re
.
IGNORECASE
):
logging
.
debug
(
'Terminating OAI CN5G'
)
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S ./core-network.sh stop nrf spgwu'
,
'\$'
,
5
)
else
:
else
:
logging
.
error
(
'This should not happen!'
)
logging
.
error
(
'This should not happen!'
)
mySSH
.
close
()
mySSH
.
close
()
...
...
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