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
spbro
OpenXG-RAN
Commits
3fd8b17e
Commit
3fd8b17e
authored
Mar 30, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ci-fixes-mar-2022' into integration_2022_wk13
parents
426ded6e
a02adbdc
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
193 additions
and
59 deletions
+193
-59
ci-scripts/Jenkinsfile-push-registry
ci-scripts/Jenkinsfile-push-registry
+3
-1
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+2
-0
ci-scripts/cls_module_ue.py
ci-scripts/cls_module_ue.py
+2
-1
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+31
-31
ci-scripts/cls_static_code_analysis.py
ci-scripts/cls_static_code_analysis.py
+67
-20
ci-scripts/provideUniqueImageTag.py
ci-scripts/provideUniqueImageTag.py
+54
-0
ci-scripts/ran.py
ci-scripts/ran.py
+2
-2
ci-scripts/xml_files/container_nsa_b200_quectel.xml
ci-scripts/xml_files/container_nsa_b200_quectel.xml
+32
-4
No files found.
ci-scripts/Jenkinsfile-push-registry
View file @
3fd8b17e
...
...
@@ -55,7 +55,9 @@ pipeline {
stage
(
"Push to DockerHub"
)
{
steps
{
script
{
WEEK_TAG
=
sh
returnStdout:
true
,
script:
'date +"%Y.w%U"'
WEEK_REF
=
sh
returnStdout:
true
,
script:
'date +"%Y.w%V"'
WEEK_REF
=
WEEK_REF
.
trim
()
WEEK_TAG
=
sh
returnStdout:
true
,
script:
'python3 ./ci-scripts/provideUniqueImageTag.py --start_tag '
+
WEEK_REF
WEEK_TAG
=
WEEK_TAG
.
trim
()
withCredentials
([
...
...
ci-scripts/cls_containerize.py
View file @
3fd8b17e
...
...
@@ -606,6 +606,8 @@ class Containerize():
if
containerToKill
:
mySSH
.
command
(
'docker kill --signal INT '
+
containerName
,
'\$'
,
30
)
time
.
sleep
(
5
)
mySSH
.
command
(
'docker kill --signal KILL '
+
containerName
,
'\$'
,
30
)
time
.
sleep
(
5
)
mySSH
.
command
(
'docker logs '
+
containerName
+
' > '
+
lSourcePath
+
'/cmake_targets/'
+
self
.
eNB_logFile
[
self
.
eNB_instance
],
'\$'
,
30
)
mySSH
.
command
(
'docker rm -f '
+
containerName
,
'\$'
,
30
)
# Forcing the down now to remove the networks and any artifacts
...
...
ci-scripts/cls_module_ue.py
View file @
3fd8b17e
...
...
@@ -76,7 +76,8 @@ class Module_UE:
logging
.
debug
(
'Starting '
+
self
.
Process
[
'Name'
])
mySSH
=
sshconnection
.
SSHConnection
()
mySSH
.
open
(
self
.
HostIPAddress
,
self
.
HostUsername
,
self
.
HostPassword
)
mySSH
.
command
(
'echo $USER; echo '
+
self
.
HostPassword
+
' | nohup sudo -S '
+
self
.
Process
[
'Cmd'
]
+
' '
+
self
.
Process
[
'Apn'
][
CNType
]
+
' > /dev/null 2>&1 &'
,
'\$'
,
5
)
mySSH
.
command
(
'sudo rm -f /tmp/quectel-cm.log'
,
'\$'
,
5
)
mySSH
.
command
(
'echo $USER; echo '
+
self
.
HostPassword
+
' | nohup sudo -S stdbuf -o0 '
+
self
.
Process
[
'Cmd'
]
+
' '
+
self
.
Process
[
'Apn'
][
CNType
]
+
' > /tmp/quectel-cm.log 2>&1 &'
,
'\$'
,
5
)
mySSH
.
close
()
#checking the process
time
.
sleep
(
5
)
...
...
ci-scripts/cls_oaicitest.py
View file @
3fd8b17e
This diff is collapsed.
Click to expand it.
ci-scripts/cls_static_code_analysis.py
View file @
3fd8b17e
...
...
@@ -35,6 +35,7 @@ import sys # arg
import
re
# reg
import
logging
import
os
from
pathlib
import
Path
import
time
#-----------------------------------------------------------
...
...
@@ -51,7 +52,7 @@ class CppCheckResults():
def
__init__
(
self
):
self
.
variants
=
[
'
xenial'
,
'bionic
'
]
self
.
variants
=
[
'
bionic'
,
'focal
'
]
self
.
versions
=
[
''
,
''
]
self
.
nbErrors
=
[
0
,
0
]
self
.
nbWarnings
=
[
0
,
0
]
...
...
@@ -116,12 +117,22 @@ class StaticCodeAnalysis():
# if the commit ID is provided use it to point to it
if
self
.
ranCommitID
!=
''
:
mySSH
.
command
(
'git checkout -f '
+
self
.
ranCommitID
,
'\$'
,
30
)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true'
,
'\$'
,
60
)
mySSH
.
command
(
'docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1'
,
'\$'
,
600
)
# if the branch is not develop, then it is a merge request and we need to do
# the potential merge. Note that merge conflicts should already been checked earlier
if
(
self
.
ranAllowMerge
):
if
self
.
ranTargetBranch
==
''
:
if
(
self
.
ranBranch
!=
'develop'
)
and
(
self
.
ranBranch
!=
'origin/develop'
):
mySSH
.
command
(
'git merge --ff origin/develop -m "Temporary merge for CI"'
,
'\$'
,
5
)
else
:
logging
.
debug
(
'Merging with the target branch: '
+
self
.
ranTargetBranch
)
mySSH
.
command
(
'git merge --ff origin/'
+
self
.
ranTargetBranch
+
' -m "Temporary merge for CI"'
,
'\$'
,
5
)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true'
,
'\$'
,
60
)
mySSH
.
command
(
'sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic'
,
'\$'
,
6
)
mySSH
.
command
(
'docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1'
,
'\$'
,
600
)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true'
,
'\$'
,
30
)
mySSH
.
command
(
'sed -e "s@xenial@focal@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.focal'
,
'\$'
,
6
)
mySSH
.
command
(
'docker build --tag oai-cppcheck:focal --file ci-scripts/docker/Dockerfile.cppcheck.focal . > cmake_targets/log/cppcheck-focal.txt 2>&1'
,
'\$'
,
600
)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true'
,
'\$'
,
30
)
# Analyzing the logs
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/cmake_targets'
,
'\$'
,
5
)
...
...
@@ -131,8 +142,22 @@ class StaticCodeAnalysis():
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/build_log_'
+
self
.
testCase_id
+
'/*'
,
'.'
)
CCR
=
CppCheckResults
()
CCR_ref
=
CppCheckResults
()
vId
=
0
for
variant
in
CCR
.
variants
:
refAvailable
=
False
if
self
.
ranAllowMerge
:
refFolder
=
str
(
Path
.
home
())
+
'/cppcheck-references'
if
(
os
.
path
.
isfile
(
refFolder
+
'/cppcheck-'
+
variant
+
'.txt'
)):
refAvailable
=
True
with
open
(
refFolder
+
'/cppcheck-'
+
variant
+
'.txt'
,
'r'
)
as
refFile
:
for
line
in
refFile
:
ret
=
re
.
search
(
' (?P<nb_errors>[0-9\.]+) errors'
,
str
(
line
))
if
ret
is
not
None
:
CCR_ref
.
nbErrors
[
vId
]
=
int
(
ret
.
group
(
'nb_errors'
))
ret
=
re
.
search
(
' (?P<nb_warnings>[0-9\.]+) warnings'
,
str
(
line
))
if
ret
is
not
None
:
CCR_ref
.
nbWarnings
[
vId
]
=
int
(
ret
.
group
(
'nb_warnings'
))
if
(
os
.
path
.
isfile
(
'./cppcheck-'
+
variant
+
'.txt'
)):
xmlStart
=
False
with
open
(
'./cppcheck-'
+
variant
+
'.txt'
,
'r'
)
as
logfile
:
...
...
@@ -167,21 +192,43 @@ class StaticCodeAnalysis():
CCR
.
nbPtrAddNotNull
[
vId
]
+=
1
if
re
.
search
(
'id="oppositeInnerCondition"'
,
str
(
line
))
is
not
None
:
CCR
.
nbOppoInnerCondition
[
vId
]
+=
1
logging
.
debug
(
'======== Variant '
+
variant
+
' - '
+
CCR
.
versions
[
vId
]
+
' ========'
)
logging
.
debug
(
' '
+
str
(
CCR
.
nbErrors
[
vId
])
+
' errors'
)
logging
.
debug
(
' '
+
str
(
CCR
.
nbWarnings
[
vId
])
+
' warnings'
)
logging
.
debug
(
' -- Details --'
)
logging
.
debug
(
' Memory leak: '
+
str
(
CCR
.
nbMemLeaks
[
vId
]))
logging
.
debug
(
' Possible null pointer deference: '
+
str
(
CCR
.
nbNullPtrs
[
vId
]))
logging
.
debug
(
' Uninitialized variable: '
+
str
(
CCR
.
nbUninitVars
[
vId
]))
logging
.
debug
(
' Undefined behaviour shifting: '
+
str
(
CCR
.
nbTooManyBitsShift
[
vId
]))
logging
.
debug
(
' Signed integer overflow: '
+
str
(
CCR
.
nbIntegerOverflow
[
vId
]))
logging
.
debug
(
''
)
logging
.
debug
(
' Printf formatting issue: '
+
str
(
CCR
.
nbInvalidPrintf
[
vId
]))
logging
.
debug
(
' Modulo result is predetermined: '
+
str
(
CCR
.
nbModuloAlways
[
vId
]))
logging
.
debug
(
' Opposite Condition -> dead code: '
+
str
(
CCR
.
nbOppoInnerCondition
[
vId
]))
logging
.
debug
(
' Wrong Scanf Nb Args: '
+
str
(
CCR
.
nbWrongScanfArg
[
vId
]))
logging
.
debug
(
''
)
vMsg
=
''
vMsg
+=
'======== Variant '
+
variant
+
' - '
+
CCR
.
versions
[
vId
]
+
' ========
\n
'
vMsg
+=
' '
+
str
(
CCR
.
nbErrors
[
vId
])
+
' errors
\n
'
vMsg
+=
' '
+
str
(
CCR
.
nbWarnings
[
vId
])
+
' warnings
\n
'
vMsg
+=
' -- Details --
\n
'
vMsg
+=
' Memory leak: '
+
str
(
CCR
.
nbMemLeaks
[
vId
])
+
'
\n
'
vMsg
+=
' Possible null pointer deference: '
+
str
(
CCR
.
nbNullPtrs
[
vId
])
+
'
\n
'
vMsg
+=
' Uninitialized variable: '
+
str
(
CCR
.
nbUninitVars
[
vId
])
+
'
\n
'
vMsg
+=
' Undefined behaviour shifting: '
+
str
(
CCR
.
nbTooManyBitsShift
[
vId
])
+
'
\n
'
vMsg
+=
' Signed integer overflow: '
+
str
(
CCR
.
nbIntegerOverflow
[
vId
])
+
'
\n
'
vMsg
+=
'
\n
'
vMsg
+=
' Printf formatting issue: '
+
str
(
CCR
.
nbInvalidPrintf
[
vId
])
+
'
\n
'
vMsg
+=
' Modulo result is predetermined: '
+
str
(
CCR
.
nbModuloAlways
[
vId
])
+
'
\n
'
vMsg
+=
' Opposite Condition -> dead code: '
+
str
(
CCR
.
nbOppoInnerCondition
[
vId
])
+
'
\n
'
vMsg
+=
' Wrong Scanf Nb Args: '
+
str
(
CCR
.
nbWrongScanfArg
[
vId
])
+
'
\n
'
for
vLine
in
vMsg
.
split
(
'
\n
'
):
logging
.
debug
(
vLine
)
if
self
.
ranAllowMerge
and
refAvailable
:
if
CCR_ref
.
nbErrors
[
vId
]
==
CCR
.
nbErrors
[
vId
]:
logging
.
debug
(
' No change in number of errors'
)
elif
CCR_ref
.
nbErrors
[
vId
]
>
CCR
.
nbErrors
[
vId
]:
logging
.
debug
(
' Good! Decrease in number of errors'
)
else
:
logging
.
debug
(
' Bad! increase in number of errors'
)
if
CCR_ref
.
nbWarnings
[
vId
]
==
CCR
.
nbWarnings
[
vId
]:
logging
.
debug
(
' No change in number of warnings'
)
elif
CCR_ref
.
nbWarnings
[
vId
]
>
CCR
.
nbWarnings
[
vId
]:
logging
.
debug
(
' Good! Decrease in number of warnings'
)
else
:
logging
.
debug
(
' Bad! increase in number of warnings'
)
# Create new reference file
if
not
self
.
ranAllowMerge
:
refFolder
=
str
(
Path
.
home
())
+
'/cppcheck-references'
if
not
os
.
path
.
isdir
(
refFolder
):
os
.
mkdir
(
refFolder
)
with
open
(
refFolder
+
'/cppcheck-'
+
variant
+
'.txt'
,
'w'
)
as
refFile
:
refFile
.
write
(
vMsg
)
vId
+=
1
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
...
...
ci-scripts/provideUniqueImageTag.py
0 → 100644
View file @
3fd8b17e
import
argparse
import
os
import
re
import
subprocess
import
sys
AUTH_SERVICE
=
'registry.docker.io'
AUTH_SCOPE
=
'repository:rdefosseoai/oai-enb:pull'
def
main
()
->
None
:
args
=
_parse_args
()
cmd
=
'curl -fsSL "https://auth.docker.io/token?service='
+
AUTH_SERVICE
+
'&scope='
+
AUTH_SCOPE
+
'" | jq --raw-output ".token"'
token
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
universal_newlines
=
True
)
token
=
str
(
token
).
strip
()
cmd
=
'curl -fsSL -H "Authorization: Bearer '
+
token
+
'" "https://index.docker.io/v2/rdefosseoai/oai-enb/tags/list" | jq .'
listOfTags
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
universal_newlines
=
True
)
foundTag
=
False
for
tag
in
listOfTags
.
split
(
'
\n
'
):
if
re
.
search
(
'"'
+
args
.
start_tag
+
'"'
,
tag
)
is
not
None
:
foundTag
=
True
if
not
foundTag
:
print
(
args
.
start_tag
)
sys
.
exit
(
0
)
proposedVariants
=
[
'a'
,
'b'
,
'c'
,
'd'
]
for
variant
in
proposedVariants
:
foundTag
=
False
currentVariant
=
variant
for
tag
in
listOfTags
.
split
(
'
\n
'
):
if
re
.
search
(
'"'
+
args
.
start_tag
+
variant
+
'"'
,
tag
)
is
not
None
:
foundTag
=
True
break
if
not
foundTag
:
break
if
not
foundTag
:
print
(
args
.
start_tag
+
currentVariant
)
def
_parse_args
()
->
argparse
.
Namespace
:
parser
=
argparse
.
ArgumentParser
(
description
=
'Provides an unique new image tag for DockerHub'
)
parser
.
add_argument
(
'--start_tag'
,
'-st'
,
action
=
'store'
,
required
=
True
,
help
=
'Proposed Starting Tag'
,
)
return
parser
.
parse_args
()
if
__name__
==
'__main__'
:
main
()
ci-scripts/ran.py
View file @
3fd8b17e
...
...
@@ -756,11 +756,11 @@ class RANManagement():
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S mv /tmp/enb_*.pcap .'
,
'\$'
,
20
)
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S mv /tmp/gnb_*.pcap .'
,
'\$'
,
20
)
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm -f enb.log.zip'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log
.pn
g log/*/*.log log/*/*.pcap'
,
'\$'
,
60
)
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log
* iperf*.lo
g log/*/*.log log/*/*.pcap'
,
'\$'
,
60
)
result
=
re
.
search
(
'core.\d+'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S zip enb.log.zip core* ran_build/build/{lte,nr}-softmodem'
,
'\$'
,
60
)
# add core and executable to zip
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log
.pn
g log/*/*.log log/*/*.pcap'
,
'\$'
,
15
)
mySSH
.
command
(
'echo '
+
self
.
eNBPassword
+
' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log
* iperf*.lo
g log/*/*.log log/*/*.pcap'
,
'\$'
,
15
)
mySSH
.
close
()
def
AnalyzeLogFile_eNB
(
self
,
eNBlogFile
,
HTML
,
checkers
=
{}):
...
...
ci-scripts/xml_files/container_nsa_b200_quectel.xml
View file @
3fd8b17e
...
...
@@ -39,8 +39,9 @@
050001
070001
070000
050000
050001
070002
050002
050003
010002
000001
030202
...
...
@@ -117,10 +118,28 @@
<ping_rttavg_threshold>
15
</ping_rttavg_threshold>
</testCase>
<testCase
id=
"050002"
>
<class>
Ping
</class>
<desc>
Ping: 20pings in 20sec
</desc>
<id>
idefix
</id>
<ping_args>
-c 20
</ping_args>
<ping_packetloss_threshold>
1
</ping_packetloss_threshold>
<ping_rttavg_threshold>
15
</ping_rttavg_threshold>
</testCase>
<testCase
id=
"050003"
>
<class>
Ping
</class>
<desc>
Ping: 100pings in 20sec
</desc>
<id>
idefix
</id>
<ping_args>
-c 100 -i 0.2
</ping_args>
<ping_packetloss_threshold>
1
</ping_packetloss_threshold>
<ping_rttavg_threshold>
15
</ping_rttavg_threshold>
</testCase>
<testCase
id=
"070000"
>
<class>
Iperf
</class>
<desc>
iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile)
</desc>
<iperf_args>
-u -b 40M -t 60
</iperf_args>
<iperf_args>
-u -b 40M -t 60
-i 1 -fm
</iperf_args>
<direction>
DL
</direction>
<id>
idefix
</id>
<iperf_packetloss_threshold>
20
</iperf_packetloss_threshold>
...
...
@@ -131,7 +150,7 @@
<testCase
id=
"070001"
>
<class>
Iperf
</class>
<desc>
iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
</desc>
<iperf_args>
-u -b 3M -t 60
</iperf_args>
<iperf_args>
-u -b 3M -t 60
-i 1 -fm
</iperf_args>
<direction>
UL
</direction>
<id>
idefix
</id>
<iperf_packetloss_threshold>
1
</iperf_packetloss_threshold>
...
...
@@ -139,6 +158,15 @@
<iperf_profile>
single-ue
</iperf_profile>
</testCase>
<testCase
id=
"070002"
>
<class>
Iperf
</class>
<desc>
iperf (BIDIR TCP)(10 sec)(single-ue profile)
</desc>
<iperf_args>
-t 10 --bidir
</iperf_args>
<direction>
BIDIR
</direction>
<id>
idefix
</id>
<iperf_profile>
single-ue
</iperf_profile>
</testCase>
<testCase
id=
"030201"
>
<class>
Undeploy_Object
</class>
<desc>
Undeploy eNB
</desc>
...
...
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