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
canghaiwuhen
OpenXG-RAN
Commits
f3a67460
Commit
f3a67460
authored
Nov 26, 2020
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ci-ul-iperf-from-trf-container' into rh_ci_fix_autoterminate
parents
29618c5e
86c1ba3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
11 deletions
+42
-11
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+42
-11
No files found.
ci-scripts/cls_oaicitest.py
View file @
f3a67460
...
...
@@ -1934,15 +1934,34 @@ class OaiCiTest():
ret
=
subprocess
.
run
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
encoding
=
'utf-8'
)
if
ret
.
stdout
is
not
None
:
EPC_Iperf_UE_IPAddress
=
ret
.
stdout
.
strip
()
# When using a docker-based deployment, IPERF client shall be launched from trf container
launchFromTrfContainer
=
False
if
re
.
match
(
'OAI-Rel14-Docker'
,
EPC
.
Type
,
re
.
IGNORECASE
):
launchFromTrfContainer
=
True
SSH
.
open
(
EPC
.
IPAddress
,
EPC
.
UserName
,
EPC
.
Password
)
SSH
.
command
(
'docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen'
,
'\$'
,
5
)
result
=
re
.
search
(
'TRF_IP_ADDR = (?P<trf_ip_addr>[0-9\.]+)'
,
SSH
.
getBefore
())
if
result
is
not
None
:
EPC_Iperf_UE_IPAddress
=
result
.
group
(
'trf_ip_addr'
)
SSH
.
close
()
port
=
5001
+
idx
udpOptions
=
''
if
udpIperf
:
udpOptions
=
'-u '
if
launchFromEpc
:
SSH
.
open
(
EPC
.
IPAddress
,
EPC
.
UserName
,
EPC
.
Password
)
SSH
.
command
(
'cd '
+
EPC
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
SSH
.
command
(
'rm -f iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
,
'\$'
,
5
)
if
udpIperf
:
SSH
.
command
(
'echo $USER; nohup iperf -u -s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log &'
,
EPC
.
UserName
,
5
)
if
launchFromTrfContainer
:
if
self
.
ueIperfVersion
==
self
.
dummyIperfVersion
:
prefix
=
''
else
:
prefix
=
''
if
self
.
ueIperfVersion
==
'2.0.5'
:
prefix
=
'/iperf-2.0.5/bin/'
SSH
.
command
(
'docker exec -d prod-trf-gen /bin/bash -c "nohup '
+
prefix
+
'iperf '
+
udpOptions
+
'-s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log &"'
,
'\$'
,
5
)
else
:
SSH
.
command
(
'echo $USER; nohup iperf -s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log &'
,
EPC
.
UserName
,
5
)
SSH
.
command
(
'echo $USER; nohup iperf
'
+
udpOptions
+
'
-s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log &'
,
EPC
.
UserName
,
5
)
SSH
.
close
()
else
:
if
self
.
ueIperfVersion
==
self
.
dummyIperfVersion
:
...
...
@@ -1951,10 +1970,7 @@ class OaiCiTest():
prefix
=
''
if
self
.
ueIperfVersion
==
'2.0.5'
:
prefix
=
'/opt/iperf-2.0.5/bin/'
if
udpIperf
:
cmd
=
'nohup '
+
prefix
+
'iperf -u -s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log 2>&1 &'
else
:
cmd
=
'nohup '
+
prefix
+
'iperf -s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log 2>&1 &'
cmd
=
'nohup '
+
prefix
+
'iperf '
+
udpOptions
+
'-s -i 1 -p '
+
str
(
port
)
+
' > iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log 2>&1 &'
logging
.
debug
(
cmd
)
subprocess
.
run
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
encoding
=
'utf-8'
)
time
.
sleep
(
0.5
)
...
...
@@ -2000,6 +2016,9 @@ class OaiCiTest():
# Kill iperf server on EPC side
if
launchFromEpc
:
SSH
.
open
(
EPC
.
IPAddress
,
EPC
.
UserName
,
EPC
.
Password
)
if
launchFromTrfContainer
:
SSH
.
command
(
'docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"'
,
'\$'
,
5
)
else
:
SSH
.
command
(
'killall --signal SIGKILL iperf'
,
EPC
.
UserName
,
5
)
SSH
.
close
()
else
:
...
...
@@ -2014,6 +2033,10 @@ class OaiCiTest():
time
.
sleep
(
1
)
if
(
os
.
path
.
isfile
(
'iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
)):
os
.
remove
(
'iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
)
if
launchFromTrfContainer
:
SSH
.
open
(
EPC
.
IPAddress
,
EPC
.
UserName
,
EPC
.
Password
)
SSH
.
command
(
'docker cp prod-trf-gen:/iperf-2.0.5/iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log '
+
EPC
.
SourceCodePath
+
'/scripts'
,
'\$'
,
5
)
SSH
.
close
()
SSH
.
copyin
(
EPC
.
IPAddress
,
EPC
.
UserName
,
EPC
.
Password
,
EPC
.
SourceCodePath
+
'/scripts/iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
,
'.'
)
self
.
Iperf_analyzeV2Server
(
lock
,
UE_IPAddress
,
device_id
,
statusQueue
,
modified_options
)
# in case of OAI-UE
...
...
@@ -2212,8 +2235,16 @@ class OaiCiTest():
else
:
SSH
.
copyin
(
self
.
ADBIPAddress
,
self
.
ADBUserName
,
self
.
ADBPassword
,
EPC
.
SourceCodePath
+
'/scripts/iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
,
'.'
)
# fromdos has to be called on the python executor not on ADB server
cmd
=
'fromdos -o iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log'
cmd
=
'fromdos -o iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log 2>&1 > /dev/null'
try
:
subprocess
.
run
(
cmd
,
shell
=
True
)
except
:
pass
cmd
=
'dos2unix -o iperf_server_'
+
self
.
testCase_id
+
'_'
+
device_id
+
'.log 2>&1 > /dev/null'
try
:
subprocess
.
run
(
cmd
,
shell
=
True
)
except
:
pass
self
.
Iperf_analyzeV2Server
(
lock
,
UE_IPAddress
,
device_id
,
statusQueue
,
modified_options
)
# in case of OAI UE:
...
...
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