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
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
dce24608
Commit
dce24608
authored
Jan 02, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
27bd6273
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
8 deletions
+85
-8
software/ors-amarisoft/test/test.py
software/ors-amarisoft/test/test.py
+85
-8
No files found.
software/ors-amarisoft/test/test.py
View file @
dce24608
...
...
@@ -126,6 +126,31 @@ PEERCELL5 = {
# XXX explain ENB does not support mixing SDR + CPRI
# {LTE,NR}_{TDD,FDD} return basic parameters for an LTE/NR cell given downlink frequency and bandwidth.
def
LTE_TDD
(
dl_earfcn
,
bandwidth
):
return
{
'cell_type'
:
'lte'
,
'rf_mode'
:
'tdd'
,
'dl_earfcn'
:
dl_earfcn
,
'bandwidth'
:
'%g MHz'
%
bandwidth
,
}
def
LTE_FDD
(
dl_earfcn
,
bandwidth
):
_
=
LTE_TDD
(
dl_earfcn
,
bandwidth
);
_
[
'rf_mode'
]
=
'fdd'
return
_
def
NR_TDD
(
dl_nr_arfcn
,
nr_band
,
bandwidth
):
return
{
'cell_type'
:
'nr'
,
'rf_mode'
:
'tdd'
,
'dl_nr_arfcn'
:
dl_nr_arfcn
,
'nr_band'
:
nr_band
,
'bandwidth'
:
bandwidth
,
}
def
NR_FDD
(
dl_nr_arfcn
,
nr_band
,
bandwidth
):
_
=
NR_TDD
(
dl_nr_arfcn
,
nr_band
,
bandwidth
);
_
[
'rf_mode'
]
=
'fdd'
return
_
# XXX doc
class
ENBTestCase
(
AmariTestCase
):
@
classmethod
...
...
@@ -134,12 +159,14 @@ class ENBTestCase(AmariTestCase):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
json
.
dumps
({...}
)
# XXX + testing=True
return
json
.
dumps
({...}
)
# XXX + testing=True enb_id, gnb_id
# XXX + generic test that verifies ^^^ to be rendered into enb.cfg
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
inst
=
super
().
requestDefaultInstance
(
state
=
state
)
cls
.
add
Shared
(
inst
)
cls
.
requestAll
Shared
(
inst
)
return
inst
# ref returns full reference of shared instance with given subreference.
...
...
@@ -151,9 +178,9 @@ class ENBTestCase(AmariTestCase):
def
ref
(
cls
,
subref
):
return
'%s.%s'
%
(
cls
.
default_partition_reference
,
subref
)
#
add
Shared adds all shared instances of the testcase over imain.
#
requestAll
Shared adds all shared instances of the testcase over imain.
@
classmethod
def
add
Shared
(
cls
,
imain
):
def
requestAll
Shared
(
cls
,
imain
):
def
_
(
subref
,
ctx
):
return
cls
.
requestShared
(
imain
,
subref
,
ctx
)
_
(
'PEER4'
,
PEER4
)
...
...
@@ -162,7 +189,7 @@ class ENBTestCase(AmariTestCase):
_
(
'PEERCELL5'
,
PEERCELL5
)
# requestShared requests shared instance over imain with specified subreference and parameters.
# requestShared requests
one
shared instance over imain with specified subreference and parameters.
@
classmethod
def
requestShared
(
cls
,
imain
,
subref
,
ctx
):
cls
.
slap
.
request
(
...
...
@@ -177,20 +204,70 @@ class ENBTestCase(AmariTestCase):
class
TestENB_SDR
(
ENBTestCase
):
@
classmethod
def
add
Shared
(
cls
,
imain
):
super
().
add
Shared
(
cls
,
imain
)
def
requestAll
Shared
(
cls
,
imain
):
super
().
requestAll
Shared
(
cls
,
imain
)
sdr0
x
4
t
sdr1
x
4
f
sdr2
x
5
t
sdr3
x
5
f
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
class
TestENB_CPRI
(
ENBTestCase
):
lo
x
{
4
t
,
4
f
,
5
t
,
5
f
}
sw
x
{
4
t
,
4
f
,
5
t
,
5
f
}
@
classmethod
def
requestAllShared
(
cls
,
imain
):
super
().
requestAllShared
(
imain
)
# Lopcomm x {4t,4f,5t,5f}
def
LO
(
i
):
return
{
'ru_type'
:
'lopcomm'
,
'ru_link_type'
:
'cpri'
,
'cpri_link'
:
{
'sdr_dev'
:
0
,
'sfp_port'
:
1
+
i
,
'mult'
:
4
,
'mapping'
:
'hw'
,
'rx_delay'
:
25.11
,
'tx_delay'
:
14.71
,
'tx_dbm'
:
63
},
'mac_addr'
:
'00:0A:45:00:00:%02x'
%
i
,
'tx_gain'
:
-
11
,
'rx_gain'
:
-
12
,
'txrx_active'
:
'INACTIVE'
,
}
cls
.
requestShared
(
imain
,
'LO1'
,
LO
(
1
))
cls
.
requestShared
(
imain
,
'LO2'
,
LO
(
2
))
cls
.
requestShared
(
imain
,
'LO3'
,
LO
(
3
))
cls
.
requestShared
(
imain
,
'LO4'
,
LO
(
4
))
def
LO_CELL
(
i
,
**
kw
):
cell
=
{
'cell_kind'
:
'enb'
,
'pci'
:
i
,
'cell_id'
:
'%x'
%
(
0x00
+
i
),
'ru'
:
{
'ru_type'
:
'ru_ref'
,
'ru_ref'
:
cls
.
ref
(
'LO%d'
%
i
),
}
}
cell
.
update
(
kw
)
cls
.
requestShared
(
imain
,
'LO%d.CELL'
%
i
,
cell
)
LO_CELL
(
1
,
{
'cell_type'
:
'lte'
,
'rf_mode'
=
'tdd'
,
'dl_earfcn'
=
...,
'bandwidth'
=
...})
LO_CELL
(
1
,
LTE_TDD
(
100
,
10
))
LO_CELL
(
1
,
LTE_FDD
(
500
,
20
))
LO_CELL
(
1
,
NR_TDD
(
100
,
10
))
# XXX + sunwave
# XXX enb - {sdr,lopcomm,sunwave}·2 - {cell_lte1fdd,2tdd, cell_nr1fdd,2tdd} + peer·2 + peercell·2
# XXX uesim - {sdr,lopcomm,sunwave}·2
...
...
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