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
45ac056d
Commit
45ac056d
authored
Jun 09, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: Add Iperf2 unidirecational function
parent
9055fabe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
30 deletions
+69
-30
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+57
-29
ci-scripts/main.py
ci-scripts/main.py
+10
-0
ci-scripts/xml_class_list.yml
ci-scripts/xml_class_list.yml
+1
-0
ci-scripts/xml_files/container_4g_rfsim_fembms.xml
ci-scripts/xml_files/container_4g_rfsim_fembms.xml
+1
-1
No files found.
ci-scripts/cls_oaicitest.py
View file @
45ac056d
...
@@ -790,7 +790,6 @@ class OaiCiTest():
...
@@ -790,7 +790,6 @@ class OaiCiTest():
udpIperf
=
re
.
search
(
'-u'
,
iperf_opt
)
is
not
None
udpIperf
=
re
.
search
(
'-u'
,
iperf_opt
)
is
not
None
bidirIperf
=
re
.
search
(
'--bidir'
,
iperf_opt
)
is
not
None
bidirIperf
=
re
.
search
(
'--bidir'
,
iperf_opt
)
is
not
None
client_filename
=
f'iperf_client_
{
self
.
testCase_id
}
_
{
ue
.
getName
()
}
.log'
client_filename
=
f'iperf_client_
{
self
.
testCase_id
}
_
{
ue
.
getName
()
}
.log'
server_filename
=
f'iperf_server_
{
self
.
testCase_id
}
_
{
ue
.
getName
()
}
.log'
ymlPath
=
CONTAINERS
.
yamlPath
[
0
].
split
(
'/'
)
ymlPath
=
CONTAINERS
.
yamlPath
[
0
].
split
(
'/'
)
logPath
=
f'../cmake_targets/log/
{
ymlPath
[
1
]
}
'
logPath
=
f'../cmake_targets/log/
{
ymlPath
[
1
]
}
'
...
@@ -806,35 +805,26 @@ class OaiCiTest():
...
@@ -806,35 +805,26 @@ class OaiCiTest():
iperf_ue
=
'/data/local/tmp/iperf3'
if
re
.
search
(
'adb'
,
ue
.
getName
())
else
'iperf3'
iperf_ue
=
'/data/local/tmp/iperf3'
if
re
.
search
(
'adb'
,
ue
.
getName
())
else
'iperf3'
ue_header
=
f'UE
{
ue
.
getName
()
}
(
{
ueIP
}
)'
ue_header
=
f'UE
{
ue
.
getName
()
}
(
{
ueIP
}
)'
if
svr
.
getName
()
==
"rfsim4g_enb_fembms"
:
with
cls_cmd
.
getConnection
(
ue
.
getHost
())
as
cmd_ue
,
cls_cmd
.
getConnection
(
EPC
.
IPAddress
)
as
cmd_svr
:
with
cls_cmd
.
getConnection
(
ue
.
getHost
())
as
cmd_ue
,
cls_cmd
.
getConnection
(
EPC
.
IPAddress
)
as
cmd_svr
:
port
=
5002
+
idx
port
=
5002
+
idx
# note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False`
cmd_ue
.
run
(
f'
{
ue
.
getCmdPrefix
()
}
iperf -B
{
ueIP
}
-s -u -i1 >>
{
server_filename
}
&'
,
timeout
=
iperf_time
*
1.5
)
t
=
iperf_time
*
1.5
cmd_svr
.
run
(
f'
{
svr
.
getCmdPrefix
()
}
iperf -c
{
ueIP
}
-B
{
svrIP
}
{
iperf_opt
}
-i1 2>&1 | tee
{
client_filename
}
'
,
timeout
=
iperf_time
*
1.5
)
if
runIperf3Server
:
cmd_ue
.
run
(
f'cp
{
client_filename
}
{
logPath
}
/
{
client_filename
}
'
)
cmd_svr
.
run
(
f'
{
svr
.
getCmdPrefix
()
}
nohup timeout -vk3 iperf3 -s -B
{
svrIP
}
-p
{
port
}
-1
{
jsonReport
}
&'
,
timeout
=
t
)
cmd_ue
.
run
(
f'cp
{
server_filename
}
{
logPath
}
/
{
server_filename
}
'
)
cmd_ue
.
run
(
f'rm /tmp/
{
client_filename
}
'
,
reportNonZero
=
False
)
status
,
msg
=
Iperf_analyzeV2UDP
(
server_filename
,
self
.
iperf_bitrate_threshold
,
self
.
iperf_packetloss_threshold
,
target_bitrate
)
cmd_ue
.
run
(
f'
{
ue
.
getCmdPrefix
()
}
timeout -vk3
{
t
}
{
iperf_ue
}
-B
{
ueIP
}
-c
{
svrIP
}
-p
{
port
}
{
iperf_opt
}
{
jsonReport
}
{
serverReport
}
-O 5 >> /tmp/
{
client_filename
}
'
,
timeout
=
t
)
else
:
if
svr
.
getHost
()
==
'localhost'
:
with
cls_cmd
.
getConnection
(
ue
.
getHost
())
as
cmd_ue
,
cls_cmd
.
getConnection
(
EPC
.
IPAddress
)
as
cmd_svr
:
cmd_ue
.
run
(
f'mkdir -p
{
logPath
}
'
)
port
=
5002
+
idx
cmd_ue
.
run
(
f'cp /tmp/
{
client_filename
}
{
logPath
}
/
{
client_filename
}
'
)
# note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False`
cmd_ue
.
run
(
f'cp /tmp/
{
client_filename
}
{
client_filename
}
'
)
t
=
iperf_time
*
1.5
if
runIperf3Server
:
cmd_svr
.
run
(
f'
{
svr
.
getCmdPrefix
()
}
nohup timeout -vk3
{
t
}
iperf3 -s -B
{
svrIP
}
-p
{
port
}
-1
{
jsonReport
}
&'
,
timeout
=
t
)
cmd_ue
.
run
(
f'rm /tmp/
{
client_filename
}
'
,
reportNonZero
=
False
)
cmd_ue
.
run
(
f'
{
ue
.
getCmdPrefix
()
}
timeout -vk3
{
t
}
{
iperf_ue
}
-B
{
ueIP
}
-c
{
svrIP
}
-p
{
port
}
{
iperf_opt
}
{
jsonReport
}
{
serverReport
}
-O 5 >> /tmp/
{
client_filename
}
'
,
timeout
=
t
)
if
svr
.
getHost
()
==
'localhost'
:
cmd_ue
.
run
(
f'mkdir -p
{
logPath
}
'
)
cmd_ue
.
run
(
f'cp /tmp/
{
client_filename
}
{
logPath
}
/
{
client_filename
}
'
)
cmd_ue
.
run
(
f'cp /tmp/
{
client_filename
}
{
client_filename
}
'
)
else
:
cmd_ue
.
copyin
(
f'/tmp/
{
client_filename
}
'
,
client_filename
)
if
udpIperf
:
status
,
msg
=
Iperf_analyzeV3UDP
(
client_filename
,
self
.
iperf_bitrate_threshold
,
self
.
iperf_packetloss_threshold
,
target_bitrate
)
elif
bidirIperf
:
status
,
msg
=
Iperf_analyzeV3BIDIRJson
(
client_filename
)
else
:
else
:
status
,
msg
=
Iperf_analyzeV3TCPJson
(
client_filename
,
self
.
iperf_tcp_rate_target
)
cmd_ue
.
copyin
(
f'/tmp/
{
client_filename
}
'
,
client_filename
)
if
udpIperf
:
status
,
msg
=
Iperf_analyzeV3UDP
(
client_filename
,
self
.
iperf_bitrate_threshold
,
self
.
iperf_packetloss_threshold
,
target_bitrate
)
elif
bidirIperf
:
status
,
msg
=
Iperf_analyzeV3BIDIRJson
(
client_filename
)
else
:
status
,
msg
=
Iperf_analyzeV3TCPJson
(
client_filename
,
self
.
iperf_tcp_rate_target
)
logging
.
info
(
f'
\u001B
[1;37;45m iperf result for
{
ue_header
}
\u001B
[0m'
)
logging
.
info
(
f'
\u001B
[1;37;45m iperf result for
{
ue_header
}
\u001B
[0m'
)
for
l
in
msg
.
split
(
'
\n
'
):
for
l
in
msg
.
split
(
'
\n
'
):
...
@@ -872,6 +862,44 @@ class OaiCiTest():
...
@@ -872,6 +862,44 @@ class OaiCiTest():
HTML
.
CreateHtmlTestRowQueue
(
self
.
iperf_args
,
'KO'
,
messages
)
HTML
.
CreateHtmlTestRowQueue
(
self
.
iperf_args
,
'KO'
,
messages
)
self
.
AutoTerminateUEandeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
self
.
AutoTerminateUEandeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
def
Iperf2_Unidir
(
self
,
HTML
,
RAN
,
EPC
,
CONTAINERS
):
if
self
.
ue_ids
==
[]
or
self
.
svr_id
==
None
:
raise
Exception
(
"no module names in self.ue_ids or/and self.svr_id provided"
)
if
len
(
self
.
ue_ids
)
==
1
:
ue
=
cls_module
.
Module_UE
(
self
.
ue_ids
[
0
].
strip
())
ue_num
=
1
idx
=
0
else
:
raise
Exception
(
"multi UE test not supported by Iperf2_Unidir function"
)
svr
=
cls_module
.
Module_UE
(
self
.
svr_id
)
ueIP
=
ue
.
getIP
()
if
not
ueIP
:
return
(
False
,
f"UE
{
ue
.
getName
()
}
has no IP address"
)
svrIP
=
svr
.
getIP
()
if
not
svrIP
:
return
(
False
,
f"Iperf server
{
ue
.
getName
()
}
has no IP address"
)
client_filename
=
f'iperf_client_
{
self
.
testCase_id
}
_
{
ue
.
getName
()
}
.log'
server_filename
=
f'iperf_server_
{
self
.
testCase_id
}
_
{
ue
.
getName
()
}
.log'
ymlPath
=
CONTAINERS
.
yamlPath
[
0
].
split
(
'/'
)
logPath
=
f'../cmake_targets/log/
{
ymlPath
[
1
]
}
'
iperf_time
=
Iperf_ComputeTime
(
self
.
iperf_args
)
target_bitrate
,
iperf_opt
=
Iperf_ComputeModifiedBW
(
idx
,
ue_num
,
self
.
iperf_profile
,
self
.
iperf_args
)
with
cls_cmd
.
getConnection
(
ue
.
getHost
())
as
cmd_ue
,
cls_cmd
.
getConnection
(
EPC
.
IPAddress
)
as
cmd_svr
:
cmd_ue
.
run
(
f'
{
ue
.
getCmdPrefix
()
}
iperf -B
{
ueIP
}
-s -u -i1 >>
{
server_filename
}
&'
,
timeout
=
iperf_time
*
1.5
)
cmd_svr
.
run
(
f'
{
svr
.
getCmdPrefix
()
}
iperf -c
{
ueIP
}
-B
{
svrIP
}
{
iperf_opt
}
-i1 2>&1 | tee
{
client_filename
}
'
,
timeout
=
iperf_time
*
1.5
)
cmd_ue
.
run
(
f'cp
{
client_filename
}
{
logPath
}
/
{
client_filename
}
'
)
cmd_ue
.
run
(
f'cp
{
server_filename
}
{
logPath
}
/
{
server_filename
}
'
)
success
,
msg
=
Iperf_analyzeV2UDP
(
server_filename
,
self
.
iperf_bitrate_threshold
,
self
.
iperf_packetloss_threshold
,
target_bitrate
)
ue_header
=
f'UE
{
ue
.
getName
()
}
(
{
ueIP
}
)'
logging
.
info
(
f'
\u001B
[1;37;45m iperf result for
{
ue_header
}
\u001B
[0m'
)
for
l
in
msg
.
split
(
'
\n
'
):
logging
.
info
(
f'
\u001B
[1;35m
{
l
}
\u001B
[0m'
)
if
success
:
HTML
.
CreateHtmlTestRowQueue
(
self
.
iperf_args
,
'OK'
,
msg
)
else
:
HTML
.
CreateHtmlTestRowQueue
(
self
.
iperf_args
,
'KO'
,
msg
)
self
.
AutoTerminateUEandeNB
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
def
AnalyzeLogFile_UE
(
self
,
UElogFile
,
HTML
,
RAN
):
def
AnalyzeLogFile_UE
(
self
,
UElogFile
,
HTML
,
RAN
):
if
(
not
os
.
path
.
isfile
(
f'./
{
UElogFile
}
'
)):
if
(
not
os
.
path
.
isfile
(
f'./
{
UElogFile
}
'
)):
return
-
1
return
-
1
...
...
ci-scripts/main.py
View file @
45ac056d
...
@@ -281,6 +281,14 @@ def GetParametersFromXML(action):
...
@@ -281,6 +281,14 @@ def GetParametersFromXML(action):
logging
.
error
(
'test-case has wrong option '
+
CiTestObj
.
iperf_options
)
logging
.
error
(
'test-case has wrong option '
+
CiTestObj
.
iperf_options
)
CiTestObj
.
iperf_options
=
'check'
CiTestObj
.
iperf_options
=
'check'
elif
action
==
'Iperf2_Unidir'
:
CiTestObj
.
iperf_args
=
test
.
findtext
(
'iperf_args'
)
CiTestObj
.
ue_ids
=
test
.
findtext
(
'id'
).
split
(
' '
)
CiTestObj
.
svr_id
=
test
.
findtext
(
'svr_id'
)
or
None
CiTestObj
.
iperf_packetloss_threshold
=
test
.
findtext
(
'iperf_packetloss_threshold'
)
CiTestObj
.
iperf_bitrate_threshold
=
test
.
findtext
(
'iperf_bitrate_threshold'
)
or
'90'
CiTestObj
.
iperf_profile
=
test
.
findtext
(
'iperf_profile'
)
or
'balanced'
elif
action
==
'IdleSleep'
:
elif
action
==
'IdleSleep'
:
string_field
=
test
.
findtext
(
'idle_sleep_time_in_sec'
)
string_field
=
test
.
findtext
(
'idle_sleep_time_in_sec'
)
if
(
string_field
is
None
):
if
(
string_field
is
None
):
...
@@ -770,6 +778,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
...
@@ -770,6 +778,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
CiTestObj
.
Ping
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
CiTestObj
.
Ping
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Iperf'
:
elif
action
==
'Iperf'
:
CiTestObj
.
Iperf
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
CiTestObj
.
Iperf
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Iperf2_Unidir'
:
CiTestObj
.
Iperf2_Unidir
(
HTML
,
RAN
,
EPC
,
CONTAINERS
)
elif
action
==
'Initialize_HSS'
:
elif
action
==
'Initialize_HSS'
:
EPC
.
InitializeHSS
(
HTML
)
EPC
.
InitializeHSS
(
HTML
)
elif
action
==
'Terminate_HSS'
:
elif
action
==
'Terminate_HSS'
:
...
...
ci-scripts/xml_class_list.yml
View file @
45ac056d
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
-
CheckStatusUE
-
CheckStatusUE
-
Ping
-
Ping
-
Iperf
-
Iperf
-
Iperf2_Unidir
-
Deploy_EPC
-
Deploy_EPC
-
Undeploy_EPC
-
Undeploy_EPC
-
Initialize_HSS
-
Initialize_HSS
...
...
ci-scripts/xml_files/container_4g_rfsim_fembms.xml
View file @
45ac056d
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
</testCase>
</testCase>
<testCase
id=
"030011"
>
<testCase
id=
"030011"
>
<class>
Iperf
</class>
<class>
Iperf
2_Unidir
</class>
<desc>
Iperf UDP DL
</desc>
<desc>
Iperf UDP DL
</desc>
<id>
rfsim4g_ue_fembms
</id>
<id>
rfsim4g_ue_fembms
</id>
<svr_id>
rfsim4g_enb_fembms
</svr_id>
<svr_id>
rfsim4g_enb_fembms
</svr_id>
...
...
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