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
Michael Black
OpenXG-RAN
Commits
5723e713
Commit
5723e713
authored
Feb 17, 2023
by
Dhanuja Elizabeth Thomas
Committed by
Robert Schmidt
Feb 18, 2023
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):
...
@@ -498,6 +498,9 @@ def GetParametersFromXML(action):
string_field
=
test
.
findtext
(
'test_svr_id'
)
string_field
=
test
.
findtext
(
'test_svr_id'
)
if
(
string_field
is
not
None
):
if
(
string_field
is
not
None
):
CONTAINERS
.
testSvrId
=
string_field
CONTAINERS
.
testSvrId
=
string_field
elif
action
==
'Custom_Command'
:
RAN
.
node
=
test
.
findtext
(
'node'
)
RAN
.
command
=
test
.
findtext
(
'command'
)
else
:
else
:
logging
.
warning
(
f"unknown action
{
action
}
from option-parsing point-of-view"
)
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
...
@@ -879,6 +882,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
RAN
.
BuildeNB
(
HTML
)
RAN
.
BuildeNB
(
HTML
)
elif
action
==
'WaitEndBuild_eNB'
:
elif
action
==
'WaitEndBuild_eNB'
:
RAN
.
WaitBuildeNBisFinished
(
HTML
)
RAN
.
WaitBuildeNBisFinished
(
HTML
)
elif
action
==
'Custom_Command'
:
logging
.
info
(
f"Executing custom command"
)
RAN
.
CustomCommand
(
HTML
)
elif
action
==
'Initialize_eNB'
:
elif
action
==
'Initialize_eNB'
:
check_eNB
=
False
check_eNB
=
False
check_OAI_UE
=
False
check_OAI_UE
=
False
...
...
ci-scripts/ran.py
View file @
5723e713
...
@@ -38,6 +38,7 @@ import os
...
@@ -38,6 +38,7 @@ import os
import
time
import
time
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
from
multiprocessing
import
Process
,
Lock
,
SimpleQueue
import
yaml
import
yaml
import
cls_cmd
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -96,6 +97,8 @@ class RANManagement():
...
@@ -96,6 +97,8 @@ class RANManagement():
#checkers from xml
#checkers from xml
self
.
ran_checkers
=
{}
self
.
ran_checkers
=
{}
self
.
cmd_prefix
=
''
# prefix before {lte,nr}-softmodem
self
.
cmd_prefix
=
''
# prefix before {lte,nr}-softmodem
self
.
node
=
''
self
.
command
=
''
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -259,6 +262,21 @@ class RANManagement():
...
@@ -259,6 +262,21 @@ class RANManagement():
mySSH
.
close
()
mySSH
.
close
()
self
.
checkBuildeNB
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
self
.
backgroundBuildTestId
[
int
(
self
.
eNB_instance
)],
HTML
)
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
):
def
checkBuildeNB
(
self
,
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
,
testcaseId
,
HTML
):
HTML
.
testCase_id
=
testcaseId
HTML
.
testCase_id
=
testcaseId
...
...
ci-scripts/xml_class_list.yml
View file @
5723e713
...
@@ -51,3 +51,4 @@
...
@@ -51,3 +51,4 @@
-
Push_Local_Registry
-
Push_Local_Registry
-
Pull_Local_Registry
-
Pull_Local_Registry
-
Clean_Test_Server_Images
-
Clean_Test_Server_Images
-
Custom_Command
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