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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
1e810c08
Commit
1e810c08
authored
Nov 08, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ci): forcing no colour on grep commands
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
9f811c06
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
29 deletions
+29
-29
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+12
-12
ci-scripts/cls_module_ue.py
ci-scripts/cls_module_ue.py
+4
-4
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+5
-5
ci-scripts/epc.py
ci-scripts/epc.py
+4
-4
ci-scripts/ran.py
ci-scripts/ran.py
+4
-4
No files found.
ci-scripts/cls_containerize.py
View file @
1e810c08
...
...
@@ -222,7 +222,7 @@ class Containerize():
if
(
self
.
ranAllowMerge
):
imageTag
=
'ci-temp'
if
self
.
ranTargetBranch
==
'develop'
:
mySSH
.
command
(
'git diff HEAD..origin/develop -- docker/Dockerfile.ran'
+
self
.
dockerfileprefix
+
' | grep -i INDEX'
,
'\$'
,
5
)
mySSH
.
command
(
'git diff HEAD..origin/develop -- docker/Dockerfile.ran'
+
self
.
dockerfileprefix
+
' | grep -
-colour=never -
i INDEX'
,
'\$'
,
5
)
result
=
re
.
search
(
'index'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
forceSharedImageBuild
=
True
...
...
@@ -901,17 +901,17 @@ class Containerize():
if
svrName
==
'porcepix'
:
mySSH
.
open
(
ipAddr
,
userName
,
password
)
# Check if route to asterix gnb exists
mySSH
.
command
(
'ip route | grep "192.168.68.64/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.64/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.194'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1'
,
'\$'
,
10
)
# Check if route to obelix enb exists
mySSH
.
command
(
'ip route | grep "192.168.68.128/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.128/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.193'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev eno1'
,
'\$'
,
10
)
# Check if route to nepes gnb exists
mySSH
.
command
(
'ip route | grep "192.168.68.192/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.192/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.209'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1'
,
'\$'
,
10
)
...
...
@@ -929,17 +929,17 @@ class Containerize():
if
svrName
==
'asterix'
:
mySSH
.
open
(
ipAddr
,
userName
,
password
)
# Check if route to porcepix epc exists
mySSH
.
command
(
'ip route | grep "192.168.61.192/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.61.192/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.210'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev em1'
,
'\$'
,
10
)
# Check if route to porcepix cn5g exists
mySSH
.
command
(
'ip route | grep "192.168.70.128/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.70.128/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.210'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.70.128/26 via 192.168.18.210 dev em1'
,
'\$'
,
10
)
# Check if X2 route to obelix enb exists
mySSH
.
command
(
'ip route | grep "192.168.68.128/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.128/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.193'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev em1'
,
'\$'
,
10
)
...
...
@@ -957,17 +957,17 @@ class Containerize():
if
svrName
==
'obelix'
:
mySSH
.
open
(
ipAddr
,
userName
,
password
)
# Check if route to porcepix epc exists
mySSH
.
command
(
'ip route | grep "192.168.61.192/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.61.192/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.210'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev eno1'
,
'\$'
,
10
)
# Check if X2 route to asterix gnb exists
mySSH
.
command
(
'ip route | grep "192.168.68.64/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.64/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.194'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1'
,
'\$'
,
10
)
# Check if X2 route to nepes gnb exists
mySSH
.
command
(
'ip route | grep "192.168.68.192/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.192/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.209'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1'
,
'\$'
,
10
)
...
...
@@ -985,12 +985,12 @@ class Containerize():
if
svrName
==
'nepes'
:
mySSH
.
open
(
ipAddr
,
userName
,
password
)
# Check if route to porcepix epc exists
mySSH
.
command
(
'ip route | grep "192.168.61.192/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.61.192/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.210'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev enp0s31f6'
,
'\$'
,
10
)
# Check if X2 route to obelix enb exists
mySSH
.
command
(
'ip route | grep "192.168.68.128/26"'
,
'\$'
,
10
)
mySSH
.
command
(
'ip route | grep
--colour=never
"192.168.68.128/26"'
,
'\$'
,
10
)
result
=
re
.
search
(
'192.168.18.193'
,
mySSH
.
getBefore
())
if
result
is
None
:
mySSH
.
command
(
'echo '
+
password
+
' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev enp0s31f6'
,
'\$'
,
10
)
...
...
ci-scripts/cls_module_ue.py
View file @
1e810c08
...
...
@@ -63,7 +63,7 @@ class Module_UE:
#if not it will be started
def
CheckCMProcess
(
self
,
CNType
):
HOST
=
self
.
HostUsername
+
'@'
+
self
.
HostIPAddress
COMMAND
=
"ps aux | grep "
+
self
.
Process
[
'Name'
]
+
" | grep -v grep "
COMMAND
=
"ps aux | grep
--colour=never
"
+
self
.
Process
[
'Name'
]
+
" | grep -v grep "
logging
.
debug
(
COMMAND
)
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
result
=
ssh
.
stdout
.
readlines
()
...
...
@@ -81,7 +81,7 @@ class Module_UE:
#checking the process
time
.
sleep
(
5
)
HOST
=
self
.
HostUsername
+
'@'
+
self
.
HostIPAddress
COMMAND
=
"ps aux | grep "
+
self
.
Process
[
'Name'
]
+
" | grep -v grep "
COMMAND
=
"ps aux | grep
--colour=never
"
+
self
.
Process
[
'Name'
]
+
" | grep -v grep "
logging
.
debug
(
COMMAND
)
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
result
=
ssh
.
stdout
.
readlines
()
...
...
@@ -108,7 +108,7 @@ class Module_UE:
response
=
[]
tentative
=
3
while
(
len
(
response
)
==
0
)
and
(
tentative
>
0
):
COMMAND
=
"ip a show dev "
+
self
.
UENetwork
+
" | grep inet | grep "
+
self
.
UENetwork
COMMAND
=
"ip a show dev "
+
self
.
UENetwork
+
" | grep
--colour=never
inet | grep "
+
self
.
UENetwork
logging
.
debug
(
COMMAND
)
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
response
=
ssh
.
stdout
.
readlines
()
...
...
@@ -136,7 +136,7 @@ class Module_UE:
response
=
[]
tentative
=
3
while
(
len
(
response
)
==
0
)
and
(
tentative
>
0
):
COMMAND
=
"ip a show dev "
+
self
.
UENetwork
+
" | grep mtu"
COMMAND
=
"ip a show dev "
+
self
.
UENetwork
+
" | grep
--colour=never
mtu"
logging
.
debug
(
COMMAND
)
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
response
=
ssh
.
stdout
.
readlines
()
...
...
ci-scripts/cls_oaicitest.py
View file @
1e810c08
...
...
@@ -192,16 +192,16 @@ class OaiCiTest():
result
=
re
.
search
(
'LAST_BUILD_INFO'
,
SSH
.
getBefore
())
if
result
is
not
None
:
mismatch
=
False
SSH
.
command
(
'grep SRC_COMMIT LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
SSH
.
command
(
'grep
--colour=never
SRC_COMMIT LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
result
=
re
.
search
(
self
.
ranCommitID
,
SSH
.
getBefore
())
if
result
is
None
:
mismatch
=
True
SSH
.
command
(
'grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
SSH
.
command
(
'grep
--colour=never
MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
if
self
.
ranAllowMerge
:
result
=
re
.
search
(
'YES'
,
SSH
.
getBefore
())
if
result
is
None
:
mismatch
=
True
SSH
.
command
(
'grep TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
SSH
.
command
(
'grep
--colour=never
TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
if
self
.
ranTargetBranch
==
''
:
result
=
re
.
search
(
'develop'
,
SSH
.
getBefore
())
else
:
...
...
@@ -660,7 +660,7 @@ class OaiCiTest():
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
count
=
0
while
count
<
5
:
SSH
.
command
(
'echo '
+
self
.
ADBPassword
+
' | sudo -S lsof | grep ttyUSB0'
,
'\$'
,
10
)
SSH
.
command
(
'echo '
+
self
.
ADBPassword
+
' | sudo -S lsof | grep
--colour=never
ttyUSB0'
,
'\$'
,
10
)
result
=
re
.
search
(
'picocom'
,
SSH
.
getBefore
())
if
result
is
None
:
count
=
10
...
...
@@ -1328,7 +1328,7 @@ class OaiCiTest():
SSH
=
sshconnection
.
SSHConnection
()
SSH
.
open
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
)
if
self
.
ADBCentralized
:
SSH
.
command
(
'lsusb | egrep "Future Technology Devices International, Ltd FT2232C" | sed -e "s#:.*##" -e "s# #_#g"'
,
'\$'
,
15
)
SSH
.
command
(
'lsusb | egrep
--colour=never
"Future Technology Devices International, Ltd FT2232C" | sed -e "s#:.*##" -e "s# #_#g"'
,
'\$'
,
15
)
#self.CatMDevices = re.findall("\\\\r\\\\n([A-Za-z0-9_]+)",SSH.getBefore())
self
.
CatMDevices
=
re
.
findall
(
"
\\\\
r
\\\\
n([A-Za-z0-9_]+)"
,
SSH
.
getBefore
())
else
:
...
...
ci-scripts/epc.py
View file @
1e810c08
...
...
@@ -404,7 +404,7 @@ class EPCManagement():
elif
re
.
match
(
'OAI-Rel14-CUPS'
,
self
.
Type
,
re
.
IGNORECASE
):
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S killall --signal SIGINT oai_hss || true'
,
'\$'
,
5
)
time
.
sleep
(
2
)
mySSH
.
command
(
'stdbuf -o0 ps -aux | grep hss | grep -v grep'
,
'\$'
,
5
)
mySSH
.
command
(
'stdbuf -o0 ps -aux | grep
--colour=never
hss | grep -v grep'
,
'\$'
,
5
)
result
=
re
.
search
(
'oai_hss -j'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S killall --signal SIGKILL oai_hss || true'
,
'\$'
,
5
)
...
...
@@ -412,7 +412,7 @@ class EPCManagement():
elif
re
.
match
(
'OAI'
,
self
.
Type
,
re
.
IGNORECASE
):
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S killall --signal SIGINT run_hss oai_hss || true'
,
'\$'
,
5
)
time
.
sleep
(
2
)
mySSH
.
command
(
'stdbuf -o0 ps -aux | grep hss | grep -v grep'
,
'\$'
,
5
)
mySSH
.
command
(
'stdbuf -o0 ps -aux | grep
--colour=never
hss | grep -v grep'
,
'\$'
,
5
)
result
=
re
.
search
(
'\/bin\/bash .\/run_'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
mySSH
.
command
(
'echo '
+
self
.
Password
+
' | sudo -S killall --signal SIGKILL run_hss oai_hss || true'
,
'\$'
,
5
)
...
...
@@ -520,7 +520,7 @@ class EPCManagement():
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'./core-network.sh stop nrf spgwu'
,
'\$'
,
60
)
time
.
sleep
(
2
)
mySSH
.
command
(
'tshark -r /tmp/oai-cn5g.pcap | egrep "Tracking area update" '
,
'\$'
,
30
)
mySSH
.
command
(
'tshark -r /tmp/oai-cn5g.pcap | egrep
--colour=never
"Tracking area update" '
,
'\$'
,
30
)
result
=
re
.
search
(
'Tracking area update request'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
message
=
'UE requested '
+
mySSH
.
getBefore
().
count
(
'Tracking area update request'
)
+
'Tracking area update request(s)'
...
...
@@ -719,7 +719,7 @@ class EPCManagement():
mySSH
.
command
(
'docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_'
+
self
.
testCase_id
+
'.pcap'
,
'\$'
,
60
)
else
:
mySSH
.
command
(
'docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_'
+
self
.
testCase_id
+
'.pcap'
,
'\$'
,
60
)
mySSH
.
command
(
'tshark -r mme_'
+
self
.
testCase_id
+
'.pcap | egrep "Tracking area update"'
,
'\$'
,
60
)
mySSH
.
command
(
'tshark -r mme_'
+
self
.
testCase_id
+
'.pcap | egrep
--colour=never
"Tracking area update"'
,
'\$'
,
60
)
result
=
re
.
search
(
'Tracking area update request'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
message
=
'UE requested '
+
mySSH
.
getBefore
().
count
(
'Tracking area update request'
)
+
'Tracking area update request(s)'
...
...
ci-scripts/ran.py
View file @
1e810c08
...
...
@@ -165,16 +165,16 @@ class RANManagement():
result
=
re
.
search
(
'LAST_BUILD_INFO'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
mismatch
=
False
mySSH
.
command
(
'grep SRC_COMMIT LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
mySSH
.
command
(
'grep
--colour=never
SRC_COMMIT LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
result
=
re
.
search
(
self
.
ranCommitID
,
mySSH
.
getBefore
())
if
result
is
None
:
mismatch
=
True
mySSH
.
command
(
'grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
mySSH
.
command
(
'grep
--colour=never
MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
if
(
self
.
ranAllowMerge
):
result
=
re
.
search
(
'YES'
,
mySSH
.
getBefore
())
if
result
is
None
:
mismatch
=
True
mySSH
.
command
(
'grep TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
mySSH
.
command
(
'grep
--colour=never
TGT_BRANCH LAST_BUILD_INFO.txt'
,
'\$'
,
2
)
if
self
.
ranTargetBranch
==
''
:
result
=
re
.
search
(
'develop'
,
mySSH
.
getBefore
())
else
:
...
...
@@ -446,7 +446,7 @@ class RANManagement():
else
:
mySSH
.
command
(
'sed -i -e
\'
s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/
\'
'
+
ci_full_config_file
,
'\$'
,
2
);
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
False
mySSH
.
command
(
'grep enable_enb_m2 '
+
ci_full_config_file
,
'\$'
,
2
);
mySSH
.
command
(
'grep
--colour=never
enable_enb_m2 '
+
ci_full_config_file
,
'\$'
,
2
);
result
=
re
.
search
(
'yes'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
self
.
eNBmbmsEnables
[
int
(
self
.
eNB_instance
)]
=
True
...
...
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