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
5723e713
Commit
5723e713
authored
2 years ago
by
Dhanuja Elizabeth Thomas
Committed by
Robert Schmidt
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add custom_commad to execute arbitrary command in CI
parent
2de56bf3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
ci-scripts/main.py
ci-scripts/main.py
+6
-0
ci-scripts/ran.py
ci-scripts/ran.py
+18
-0
ci-scripts/xml_class_list.yml
ci-scripts/xml_class_list.yml
+1
-0
No files found.
ci-scripts/main.py
View file @
5723e713
...
...
@@ -498,6 +498,9 @@ def GetParametersFromXML(action):
string_field
=
test
.
findtext
(
'test_svr_id'
)
if
(
string_field
is
not
None
):
CONTAINERS
.
testSvrId
=
string_field
elif
action
==
'Custom_Command'
:
RAN
.
node
=
test
.
findtext
(
'node'
)
RAN
.
command
=
test
.
findtext
(
'command'
)
else
:
logging
.
warning
(
f"unknown action
{
action
}
from option-parsing point-of-view"
)
...
...
@@ -879,6 +882,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
RAN
.
BuildeNB
(
HTML
)
elif
action
==
'WaitEndBuild_eNB'
:
RAN
.
WaitBuildeNBisFinished
(
HTML
)
elif
action
==
'Custom_Command'
:
logging
.
info
(
f"Executing custom command"
)
RAN
.
CustomCommand
(
HTML
)
elif
action
==
'Initialize_eNB'
:
check_eNB
=
False
check_OAI_UE
=
False
...
...
This diff is collapsed.
Click to expand it.
ci-scripts/ran.py
View file @
5723e713
...
...
@@ -38,6 +38,7 @@ import os
import
time
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
import
yaml
import
cls_cmd
#-----------------------------------------------------------
...
...
@@ -96,6 +97,8 @@ class RANManagement():
#checkers from xml
self
.
ran_checkers
=
{}
self
.
cmd_prefix
=
''
# prefix before {lte,nr}-softmodem
self
.
node
=
''
self
.
command
=
''
#-----------------------------------------------------------
...
...
@@ -259,6 +262,21 @@ class RANManagement():
mySSH
.
close
()
self
.
checkBuildeNB
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
self
.
backgroundBuildTestId
[
int
(
self
.
eNB_instance
)],
HTML
)
def
CustomCommand
(
self
,
HTML
):
if
self
.
node
==
''
or
self
.
node
==
"localhost"
:
cmd
=
cls_cmd
.
LocalCmd
()
else
:
cmd
=
cls_cmd
.
RemoteCmd
(
self
.
node
)
ret
=
cmd
.
run
(
self
.
command
)
cmd
.
close
()
logging
.
debug
(
f'CustomCommand:
{
self
.
command
}
returnCode:
{
ret
.
returncode
}
output:
{
ret
.
stdout
}
'
)
html_queue
=
SimpleQueue
()
status
=
'OK'
if
ret
.
returncode
!=
0
:
html_queue
.
put
(
ret
.
stdout
)
status
=
'Warning'
HTML
.
CreateHtmlTestRow
(
self
.
command
,
status
,
1
,
html_queue
)
def
checkBuildeNB
(
self
,
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
testcaseId
,
HTML
):
HTML
.
testCase_id
=
testcaseId
...
...
This diff is collapsed.
Click to expand it.
ci-scripts/xml_class_list.yml
View file @
5723e713
...
...
@@ -51,3 +51,4 @@
-
Push_Local_Registry
-
Pull_Local_Registry
-
Clean_Test_Server_Images
-
Custom_Command
This diff is collapsed.
Click to expand it.
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