Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Lu Xu
slapos
Commits
6ca6ea6c
Commit
6ca6ea6c
authored
Dec 27, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
daaec463
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
software/ors-amarisoft/test/setup.py
software/ors-amarisoft/test/setup.py
+1
-0
software/ors-amarisoft/test/test_ors.py
software/ors-amarisoft/test/test_ors.py
+22
-10
No files found.
software/ors-amarisoft/test/setup.py
View file @
6ca6ea6c
...
...
@@ -45,6 +45,7 @@ setup(
'slapos.core'
,
'slapos.libnetworkcache'
,
'slapos.cookbook'
,
'pcpp'
,
],
zip_safe
=
True
,
test_suite
=
'test'
,
...
...
software/ors-amarisoft/test/test_ors.py
View file @
6ca6ea6c
...
...
@@ -26,7 +26,9 @@
##############################################################################
import
os
import
io
import
yaml
import
pcpp
import
json
import
glob
import
requests
...
...
@@ -135,13 +137,27 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
# yload loads yaml config file after preprocessing it.
#
# preprocessing is needed to e.g. remove // and /* comments.
def
yload
(
path
):
with
open
(
path
,
'r'
)
as
f
:
data
=
f
.
read
()
# original input
p
=
pcpp
.
Preprocessor
()
p
.
parse
(
data
)
f
=
io
.
StringIO
()
p
.
write
(
f
)
data_
=
f
.
getvalue
()
# preprocessed input
return
yaml
.
load
(
data_
,
Loader
=
yaml
.
Loader
)
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yload
(
conf_file
)
if
'tx_gain'
in
conf
and
'rx_gain'
in
conf
:
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
...
...
@@ -181,8 +197,7 @@ def test_gnb_conf1(self):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yload
(
conf_file
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
gnb_param_dict1
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
gnb_param_dict1
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'inactivity_timer'
],
gnb_param_dict1
[
'inactivity_timer'
])
...
...
@@ -230,8 +245,7 @@ def test_gnb_conf2(self):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yload
(
conf_file
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
sd
=
hex
(
p
[
'sd'
])
...
...
@@ -243,8 +257,7 @@ def test_mme_conf(self):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yload
(
conf_file
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'core_network_plmn'
])
def
test_sim_card
(
self
):
...
...
@@ -252,8 +265,7 @@ def test_sim_card(self):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yload
(
conf_file
)
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
():
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
...
...
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