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
Ophélie Gagnard
slapos
Commits
1b8b0902
Commit
1b8b0902
authored
Oct 24, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ors-amarisoft: clean-up tests and add sim card info test
parent
d1f350f3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
406 additions
and
399 deletions
+406
-399
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+3
-3
software/ors-amarisoft/instance-enb-epc.jinja2.cfg
software/ors-amarisoft/instance-enb-epc.jinja2.cfg
+1
-12
software/ors-amarisoft/instance-epc.jinja2.cfg
software/ors-amarisoft/instance-epc.jinja2.cfg
+1
-12
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
+1
-12
software/ors-amarisoft/test/test.jinja2.py
software/ors-amarisoft/test/test.jinja2.py
+80
-72
software/ors-amarisoft/test/testTDD1900.py
software/ors-amarisoft/test/testTDD1900.py
+80
-72
software/ors-amarisoft/test/testTDD2600.py
software/ors-amarisoft/test/testTDD2600.py
+80
-72
software/ors-amarisoft/test/testTDD3500.py
software/ors-amarisoft/test/testTDD3500.py
+80
-72
software/ors-amarisoft/test/testTDD3700.py
software/ors-amarisoft/test/testTDD3700.py
+80
-72
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
1b8b0902
...
...
@@ -20,7 +20,7 @@ md5sum = 6e5c63c35b13f8920ea13e24c27d7b50
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum =
43a445c5c8d068da3dda96df48ae5bd4
md5sum =
7f8f92ff218c40c843a102953c7695f8
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
...
...
@@ -28,11 +28,11 @@ md5sum = 04dbc8396cb112e86d5d1564df033b82
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
md5sum =
b4d3bba128f17841558d48e5bbb0222f
md5sum =
d83b5569e258770774cb6028d93a4a70
[template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg
md5sum =
025b309dc6860e7b681f5c0e7bf864e3
md5sum =
d310dee0de054e10d77f036199297b3f
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb-epc.jinja2.cfg
View file @
1b8b0902
{% set part_list = [] -%}
{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%- if slave_instance.get('_', '') != '' %}
{%- set slave = json_module.loads(slave_instance.pop('_')) %}
{%- else %}
{%- set slave = slave_instance %}
{%- endif %}
{%- if slave.get('imsi', '') != '' %}
{%- do filtered_slave_instance_list.append(slave_instance) %}
{%- endif %}
{%- endfor -%}
{%- for i, slave in enumerate(filtered_slave_instance_list) %}
{%- for i, slave in enumerate(slave_instance_list) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) %}
...
...
software/ors-amarisoft/instance-epc.jinja2.cfg
View file @
1b8b0902
{% set part_list = [] -%}
{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%- if slave_instance.get('_', '') != '' %}
{%- set slave = json_module.loads(slave_instance.pop('_')) %}
{%- else %}
{%- set slave = slave_instance %}
{%- endif %}
{%- if slave.get('imsi', '') != '' %}
{%- do filtered_slave_instance_list.append(slave_instance) %}
{%- endif %}
{%- endfor -%}
{%- for i, slave in enumerate(filtered_slave_instance_list) %}
{%- for i, slave in enumerate(slave_instance_list) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) %}
...
...
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
View file @
1b8b0902
{% set part_list = [] -%}
{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%- if slave_instance.get('_', '') != '' %}
{%- set slave = json_module.loads(slave_instance.pop('_')) %}
{%- else %}
{%- set slave = slave_instance %}
{%- endif %}
{%- if slave.get('imsi', '') != '' %}
{%- do filtered_slave_instance_list.append(slave_instance) %}
{%- endif %}
{%- endfor -%}
{%- for i, slave in enumerate(filtered_slave_instance_list) %}
{%- for i, slave in enumerate(slave_instance_list) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) %}
...
...
software/ors-amarisoft/test/test.jinja2.py
View file @
1b8b0902
...
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_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
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_gnb_conf1
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
def
test_gnb_conf2
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
def
test_
enb
_conf
(
self
):
def
test_
mme
_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
enb
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
mme
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_mme_conf
(
self
):
def
test_sim_card
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'
etc'
,
'mme
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'
ue_db
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
))
class
TestENBParameters
(
ORSTestCase
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
p
=
self
.
requestSlaveInstance
().
getConnectionParameterDict
()
p
=
p
[
'_'
]
if
'_'
in
p
else
p
self
.
assertIn
(
'info'
,
p
)
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
class
TestGNBParameters1
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf2
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
),
}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
...
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
)
:
return
"gnb-epc"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
...
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
...
...
software/ors-amarisoft/test/testTDD1900.py
View file @
1b8b0902
...
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_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
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_gnb_conf1
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
def
test_gnb_conf2
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
def
test_
enb
_conf
(
self
):
def
test_
mme
_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
enb
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
mme
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_mme_conf
(
self
):
def
test_sim_card
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'
etc'
,
'mme
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'
ue_db
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
))
class
TestENBParameters
(
ORSTestCase
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
p
=
self
.
requestSlaveInstance
().
getConnectionParameterDict
()
p
=
p
[
'_'
]
if
'_'
in
p
else
p
self
.
assertIn
(
'info'
,
p
)
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
class
TestGNBParameters1
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf2
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
),
}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
...
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
)
:
return
"gnb-epc"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
...
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
...
...
software/ors-amarisoft/test/testTDD2600.py
View file @
1b8b0902
...
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_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
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_gnb_conf1
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
def
test_gnb_conf2
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
def
test_
enb
_conf
(
self
):
def
test_
mme
_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
enb
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
mme
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_mme_conf
(
self
):
def
test_sim_card
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'
etc'
,
'mme
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'
ue_db
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
))
class
TestENBParameters
(
ORSTestCase
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
p
=
self
.
requestSlaveInstance
().
getConnectionParameterDict
()
p
=
p
[
'_'
]
if
'_'
in
p
else
p
self
.
assertIn
(
'info'
,
p
)
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
class
TestGNBParameters1
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf2
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
),
}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
...
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
)
:
return
"gnb-epc"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
...
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
...
...
software/ors-amarisoft/test/testTDD3500.py
View file @
1b8b0902
...
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_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
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_gnb_conf1
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
def
test_gnb_conf2
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
def
test_
enb
_conf
(
self
):
def
test_
mme
_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
enb
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
mme
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_mme_conf
(
self
):
def
test_sim_card
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'
etc'
,
'mme
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'
ue_db
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
))
class
TestENBParameters
(
ORSTestCase
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
p
=
self
.
requestSlaveInstance
().
getConnectionParameterDict
()
p
=
p
[
'_'
]
if
'_'
in
p
else
p
self
.
assertIn
(
'info'
,
p
)
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
class
TestGNBParameters1
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf2
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
),
}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
...
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
)
:
return
"gnb-epc"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
...
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
...
...
software/ors-amarisoft/test/testTDD3700.py
View file @
1b8b0902
...
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_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
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_gnb_conf1
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
def
test_gnb_conf2
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
def
test_
enb
_conf
(
self
):
def
test_
mme
_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
enb
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'
mme
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'cell_default'
][
'inactivity_timer'
],
enb_param_dict
[
'inactivity_timer'
])
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'dl_earfcn'
],
enb_param_dict
[
'dl_earfcn'
])
self
.
assertEqual
(
conf
[
'enb_id'
],
int
(
enb_param_dict
[
'enb_id'
],
16
))
self
.
assertEqual
(
conf
[
'cell_list'
][
0
][
'n_id_cell'
],
enb_param_dict
[
'pci'
])
for
p
in
conf
[
'cell_list'
][
0
][
'plmn_list'
]:
for
n
in
"plmn attach_without_pdn reserved"
.
split
():
self
.
assertEqual
(
p
[
n
],
enb_param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'mme_list'
]:
self
.
assertEqual
(
p
[
'mme_addr'
],
enb_param_dict
[
'mme_list'
][
p
[
'mme_addr'
]][
'mme_addr'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define N_RB_DL'
):
self
.
assertIn
(
str
(
enb_param_dict
[
'n_rb_dl'
]),
l
)
def
test_mme_conf
(
self
):
def
test_sim_card
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'
etc'
,
'mme
.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'
ue_db
.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
))
class
TestENBParameters
(
ORSTestCase
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
p
=
self
.
requestSlaveInstance
().
getConnectionParameterDict
()
p
=
p
[
'_'
]
if
'_'
in
p
else
p
self
.
assertIn
(
'info'
,
p
)
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
class
TestGNBParameters1
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
class
TestGNBParameters2
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
test_gnb_conf2
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
),
}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
...
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
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'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
)
:
return
"gnb-epc"
def
test_gnb_conf
(
self
):
test_gnb_conf1
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
...
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
...
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
...
...
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