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
常顺宇
OpenXG-RAN
Commits
190ff5df
Commit
190ff5df
authored
Jul 05, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python_v2/Jenkinsfile-testinfra-as-code
parent
2d4e8cc3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
337 additions
and
0 deletions
+337
-0
ci-scripts/python_v2/cls_cn.py
ci-scripts/python_v2/cls_cn.py
+6
-0
ci-scripts/python_v2/cls_ran.py
ci-scripts/python_v2/cls_ran.py
+6
-0
ci-scripts/python_v2/cls_ue.py
ci-scripts/python_v2/cls_ue.py
+6
-0
ci-scripts/python_v2/main.py
ci-scripts/python_v2/main.py
+56
-0
ci-scripts/python_v2/test-example.yaml
ci-scripts/python_v2/test-example.yaml
+33
-0
ci-scripts/python_v2/test_read_yaml_struct.py
ci-scripts/python_v2/test_read_yaml_struct.py
+61
-0
ci-scripts/python_v2/testinfra-as-code.yaml
ci-scripts/python_v2/testinfra-as-code.yaml
+169
-0
No files found.
ci-scripts/python_v2/cls_cn.py
0 → 100644
View file @
190ff5df
class
CN
:
def
__init__
(
self
,
infra
,
config
,
deployment
):
self
.
Deployment
=
deployment
self
.
Infra
=
infra
for
k
,
v
in
config
.
items
():
setattr
(
self
,
k
,
v
)
\ No newline at end of file
ci-scripts/python_v2/cls_ran.py
0 → 100644
View file @
190ff5df
class
NodeB
:
def
__init__
(
self
,
infra
,
config
,
deployment
):
self
.
Deployment
=
deployment
self
.
Infra
=
infra
for
k
,
v
in
config
.
items
():
setattr
(
self
,
k
,
v
)
\ No newline at end of file
ci-scripts/python_v2/cls_ue.py
0 → 100644
View file @
190ff5df
class
UE
:
def
__init__
(
self
,
infra
,
config
,
deployment
):
self
.
Deployment
=
deployment
self
.
Infra
=
infra
for
k
,
v
in
config
.
items
():
setattr
(
self
,
k
,
v
)
\ No newline at end of file
ci-scripts/python_v2/main.py
0 → 100644
View file @
190ff5df
#loading xml action list from yaml
import
yaml
import
cls_ue
import
cls_ran
import
cls_cn
#from yaml description of test infrastructure, return infrastructure data model
def
GetTestInfrastructure
(
filename
):
with
open
(
filename
,
'r'
)
as
f
:
infra
=
yaml
.
load
(
f
)
return
infra
#from yaml description of testcase, return configuration data model
def
GetTestConfig
(
filename
):
with
open
(
filename
,
'r'
)
as
f
:
test_config
=
yaml
.
load
(
f
)
return
test_config
def
GetTestObjects
(
key
,
infrastructure
,
test_cfg
):
part
=
test_cfg
[
'config'
][
key
][
'key'
]
#identify the relevant infra part from test config naming ex : RAN_0
elements
=
test_cfg
[
'config'
][
key
][
key
].
keys
()
#retrieve the effective elements under test
#create dict of Objects under test
OBJ
=
{}
for
n
in
elements
:
deployment
=
test_cfg
[
'config'
][
key
][
key
][
n
][
'Deploy'
]
obj_part
=
infrastructure
[
part
][
n
]
#retrieve the infra part of the element under test only
if
key
==
'RAN'
:
OBJ
[
n
]
=
cls_ran
.
NodeB
(
infrastructure
,
obj_part
,
deployment
)
elif
key
==
'CN'
:
OBJ
[
n
]
=
cls_cn
.
CN
(
infrastructure
,
obj_part
,
deployment
)
elif
key
==
'UE'
:
OBJ
[
n
]
=
cls_ue
.
UE
(
infrastructure
,
obj_part
,
deployment
)
else
:
pass
return
OBJ
#dictionary of objects under test
if
__name__
==
"__main__"
:
testbench
=
'testinfra-as-code.yaml'
test
=
'test-example.yaml'
infrastructure
=
GetTestInfrastructure
(
testbench
)
test_cfg
=
GetTestConfig
(
test
)
RAN
=
GetTestObjects
(
'RAN'
,
infrastructure
,
test_cfg
)
CN
=
GetTestObjects
(
'CN'
,
infrastructure
,
test_cfg
)
UEs
=
GetTestObjects
(
'UE'
,
infrastructure
,
test_cfg
)
ci-scripts/python_v2/test-example.yaml
0 → 100644
View file @
190ff5df
config
:
filename
:
testinfra-as-code.yaml
RAN
:
key
:
RAN_1
RAN
:
eNB_0
:
Deploy
:
Bare
gNB_0
:
Deploy
:
Container
UE
:
key
:
myUEs
UE
:
idefix_0
:
Deploy
:
None
oppo
:
Deploy
:
None
oaiue
:
Deploy
:
Bare
CN
:
key
:
CN_0
CN
:
LTEBox_0
:
Deploy
:
Bare
OAICN5G
:
Deploy
:
Compose
#list needed for iteration
Tests
:
-
t1.xml
-
t2.xml
-
t3.xml
-
t4.xml
\ No newline at end of file
ci-scripts/python_v2/test_read_yaml_struct.py
0 → 100644
View file @
190ff5df
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 29 09:38:02 2021
@author: hardy
"""
class
NodeB
:
def
__init__
(
self
,
infra
,
config
,
deployment
):
self
.
deployment
=
deployment
self
.
infra
=
infra
for
k
,
v
in
config
.
items
():
setattr
(
self
,
k
,
v
)
class
UE
:
def
__init__
(
self
,
infra
,
config
):
self
.
infra
=
infra
for
k
,
v
in
config
.
items
():
setattr
(
self
,
k
,
v
)
#loading xml action list from yaml
import
yaml
yaml_file
=
'testinfra-as-code.yaml'
with
open
(
yaml_file
,
'r'
)
as
f
:
infra
=
yaml
.
load
(
f
)
yaml_file
=
'test-example.yaml'
with
open
(
yaml_file
,
'r'
)
as
f
:
test
=
yaml
.
load
(
f
)
#RAN spec from test
ran_key
=
test
[
'config'
][
'RAN'
][
'key'
]
nodes_key
=
test
[
'config'
][
'RAN'
][
'Nodes'
].
keys
()
#create dict of RAN objects RAN under Test
RAN
=
{}
for
n
in
nodes_key
:
deployment
=
test
[
'config'
][
'RAN'
][
'Nodes'
][
n
][
'Deploy'
]
config
=
infra
[
ran_key
][
n
]
RAN
[
n
]
=
NodeB
(
infra
,
config
,
deployment
)
#UE spec from test
ue_key
=
test
[
'config'
][
'UE'
][
'key'
]
allues_key
=
test
[
'config'
][
'UE'
][
'UEs'
].
keys
()
#create dict of UE objects UE under Test
UEs
=
{}
for
u
in
allues_key
:
config
=
infra
[
ue_key
][
u
]
UEs
[
u
]
=
UE
(
infra
,
config
)
ci-scripts/python_v2/testinfra-as-code.yaml
0 → 100755
View file @
190ff5df
RAN_1
:
eNB_0
:
ID
:
eNB_0
Name
:
toto
Type
:
eNB
Deploy
:
Bare
:
Kind
:
bare
IPAddress
:
192.168.18.193
#on Obelix
Username
:
oaicicd
SourceCodePath
:
/tmp/my-CI-NSA-eNB
Container
:
Kind
:
docker
Args
:
Cluster
:
Kind
:
openshift
Args
:
gNB_0
:
ID
:
gNB_0
Name
:
titi
Type
:
eNB
Deploy
:
Bare
:
Kind
:
Bare
IPAddress
:
192.168.18.194
#on Obelix
Username
:
oaicicd
SourceCodePath
:
/tmp/my-CI-NSA-gNB
Container
:
Kind
:
docker
Args
:
Cluster
:
Kind
:
openshift
Args
:
eNB_1
:
ID
:
eNB_0
Name
:
tata
Type
:
eNB
Deploy
:
Bare
:
Kind
:
Bare
IPAddress
:
192.168.18.195
#on Obelix
Username
:
oaicicd
SourceCodePath
:
/tmp/my-CI-NSA-eNB
Container
:
Kind
:
docker
Args
:
Cluster
:
Kind
:
openshift
Args
:
CN_0
:
LTEBox_0
:
ID
:
LTEBox_0
Name
:
LTE_box_on_nikaia
Type
:
LTEBOX
Deploy
:
bare
:
Kind
:
bare
IPAddress
:
192.168.18.99
#on Nikaia
Username
:
oaicicd
SourceCodePath
:
/tmp/
SABox_0
:
ID
:
SABox_0
Name
:
SA_box_on_newserver
Type
:
SABOX
Deploy
:
Bare
:
Kind
:
Bare
IPAddress
:
192.168.18.999
#on
Username
:
oaicicd
SourceCodePath
:
/tmp/
OAICN5G
:
ID
:
OAICN5G
Name
:
Type
:
Deploy
:
Compose
:
Kind
:
Compose
IPAddress
:
192.168.18.999
#on
Username
:
oaicicd
SourceCodePath
:
/tmp/
myUEs
:
oaiue
:
Deploy
:
bare
:
Kind
:
bare
IPAddress
:
192.168.18.99
#on Nikaia
Username
:
oaicicd
SourceCodePath
:
/tmp/
idefix_0
:
Name
:
idefix0
State
:
enabled
Kind
:
module
Type
:
quectel
Process
:
Name
:
quectel-CM
Cmd
:
/home/oaicicd/quectel-CM/quectel-CM -s oai.ipv4 -4
WakeupScript
:
ci_ctl_qtel.py /dev/ttyUSB2 wup
DetachScript
:
ci_ctl_qtel.py /dev/ttyUSB2 detach
PLMN
:
22201
UENetwork
:
wwan0
HostIPAddress
:
192.168.18.188
HostUsername
:
oaicicd
HostPassword
:
oaicicd
HostSourceCodePath
:
none
porcepix_0
:
Name
:
porcepix0
State
:
enabled
Kind
:
module
Type
:
quectel
Process
:
Name
:
quectel-CM
Cmd
:
/home/oaicicd/quectel-CM/quectel-CM -s oai.ipv4 -4
WakeupScript
:
ci_ctl_qtel.py /dev/ttyUSB2 wup
DetachScript
:
ci_ctl_qtel.py /dev/ttyUSB2 detach
PLMN
:
22201
UENetwork
:
wwan0
HostIPAddress
:
192.168.18.188
HostUsername
:
oaicicd
HostPassword
:
oaicicd
HostSourceCodePath
:
none
porcepix_1
:
Name
:
porcepix1
State
:
enabled
Kind
:
module
Type
:
quectel
Process
:
Name
:
quectel-CM
Cmd
:
/home/oaicicd/quectel-CM/quectel-CM -s oai.ipv4 -4
WakeupScript
:
ci_ctl_qtel.py /dev/ttyUSB2 wup
DetachScript
:
ci_ctl_qtel.py /dev/ttyUSB2 detach
PLMN
:
22201
UENetwork
:
wwan0
HostIPAddress
:
192.168.18.188
HostUsername
:
oaicicd
HostPassword
:
oaicicd
HostSourceCodePath
:
none
oppo
:
Name
:
opporeno5g
State
:
enabled
Kind
:
mobile
ADBIPAddress
:
192.168.18.196
ADBUsername
:
oaici
ADBPassword
:
KkexF6CErOi1fNuebCPsuIVK
ADBIdentifier
:
9d690a12
Sequences
:
Airplane
:
-
adb shell input keyevent KEYCODE_POWER
-
adb shell input swipe 300 700 300
0
-
adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS
-
adb shell input keyevent
20
-
adb shell input tap 968
324
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