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
71807db4
Commit
71807db4
authored
Sep 23, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom_Command(): no need for class members
parent
61ea76e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
25 deletions
+23
-25
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+19
-0
ci-scripts/main.py
ci-scripts/main.py
+4
-4
ci-scripts/ran.py
ci-scripts/ran.py
+0
-21
No files found.
ci-scripts/cls_oaicitest.py
View file @
71807db4
...
...
@@ -220,6 +220,25 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos
pal_msg
+=
f' (too high! >
{
self
.
iperf_packetloss_threshold
}
%)'
return
(
result
,
f'
{
req_msg
}
\n
{
bir_msg
}
\n
{
brl_msg
}
\n
{
jit_msg
}
\n
{
pal_msg
}
'
)
def
Custom_Command
(
HTML
,
node
,
command
,
command_fail
):
logging
.
info
(
f"Executing custom command on
{
node
}
"
)
cmd
=
cls_cmd
.
getConnection
(
node
)
ret
=
cmd
.
run
(
command
)
cmd
.
close
()
logging
.
debug
(
f"Custom_Command:
{
command
}
on node:
{
node
}
-
{
'OK, command succeeded'
if
ret
.
returncode
==
0
else
f'Error, return code:
{
ret
.
returncode
}
'
}
"
)
status
=
'OK'
message
=
[]
if
ret
.
returncode
!=
0
and
not
command_fail
:
message
=
[
ret
.
stdout
]
logging
.
warning
(
f'Custom_Command output:
{
message
}
'
)
status
=
'Warning'
if
ret
.
returncode
!=
0
and
command_fail
:
message
=
[
ret
.
stdout
]
logging
.
error
(
f'Custom_Command failed: output:
{
message
}
'
)
status
=
'KO'
HTML
.
CreateHtmlTestRowQueue
(
command
,
status
,
message
)
return
status
==
'OK'
or
status
==
'Warning'
#-----------------------------------------------------------
# OaiCiTest Class Definition
#-----------------------------------------------------------
...
...
ci-scripts/main.py
View file @
71807db4
...
...
@@ -450,10 +450,10 @@ def ExecuteActionWithParam(action):
RAN
.
prematureExit
=
True
elif
action
==
'Custom_Command'
:
RAN
.
node
=
test
.
findtext
(
'node'
)
RAN
.
command
=
test
.
findtext
(
'command'
)
RAN
.
command_fail
=
test
.
findtext
(
'command_fail'
)
in
[
'True'
,
'true'
,
'Yes'
,
'yes'
]
RAN
.
CustomCommand
(
HTML
)
node
=
test
.
findtext
(
'node'
)
command
=
test
.
findtext
(
'command'
)
command_fail
=
test
.
findtext
(
'command_fail'
)
in
[
'True'
,
'true'
,
'Yes'
,
'yes'
]
cls_oaicitest
.
Custom_Command
(
HTML
,
node
,
command
,
command_fail
)
elif
action
==
'Pull_Cluster_Image'
:
string_field
=
test
.
findtext
(
'images_to_pull'
)
...
...
ci-scripts/ran.py
View file @
71807db4
...
...
@@ -224,27 +224,6 @@ class RANManagement():
mySSH
.
close
()
self
.
checkBuildeNB
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
self
.
testCase_id
,
HTML
)
def
CustomCommand
(
self
,
HTML
):
logging
.
info
(
f"Executing custom command on
{
self
.
node
}
"
)
cmd
=
cls_cmd
.
getConnection
(
self
.
node
)
ret
=
cmd
.
run
(
self
.
command
)
cmd
.
close
()
logging
.
debug
(
f"CustomCommand:
{
self
.
command
}
on node:
{
self
.
node
}
-
{
'OK, command succeeded'
if
ret
.
returncode
==
0
else
f'Error, return code:
{
ret
.
returncode
}
'
}
"
)
status
=
'OK'
message
=
[]
if
ret
.
returncode
!=
0
and
not
self
.
command_fail
:
message
=
[
ret
.
stdout
]
logging
.
warning
(
f'CustomCommand output:
{
message
}
'
)
status
=
'Warning'
if
self
.
command_fail
:
# important command since it would make the pipeline fail, so show output in HTML
message
=
[
ret
.
stdout
]
if
ret
.
returncode
!=
0
and
self
.
command_fail
:
message
=
[
ret
.
stdout
]
logging
.
error
(
f'CustomCommand failed: output:
{
message
}
'
)
status
=
'KO'
self
.
prematureExit
=
True
HTML
.
CreateHtmlTestRowQueue
(
self
.
command
,
status
,
message
)
def
checkBuildeNB
(
self
,
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
testcaseId
,
HTML
):
HTML
.
testCase_id
=
testcaseId
...
...
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