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
105
Merge Requests
105
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
6e15e85f
Commit
6e15e85f
authored
Oct 25, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
4be66f90
1b8b0902
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
445 additions
and
363 deletions
+445
-363
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
+14
-0
software/ors-amarisoft/instance-epc.jinja2.cfg
software/ors-amarisoft/instance-epc.jinja2.cfg
+14
-0
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
+14
-0
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 @
6e15e85f
...
@@ -20,7 +20,7 @@ md5sum = 6e5c63c35b13f8920ea13e24c27d7b50
...
@@ -20,7 +20,7 @@ md5sum = 6e5c63c35b13f8920ea13e24c27d7b50
[template-lte-enb-epc]
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum =
c9994f2ef03edd7d6773307a6385c47c
md5sum =
7f8f92ff218c40c843a102953c7695f8
[template-lte-enb]
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
_update_hash_filename_ = instance-enb.jinja2.cfg
...
@@ -28,11 +28,11 @@ md5sum = 04dbc8396cb112e86d5d1564df033b82
...
@@ -28,11 +28,11 @@ md5sum = 04dbc8396cb112e86d5d1564df033b82
[template-lte-gnb-epc]
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
md5sum =
4b27f60eab8d71c2c47f21a845fddb47
md5sum =
d83b5569e258770774cb6028d93a4a70
[template-lte-epc]
[template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg
_update_hash_filename_ = instance-epc.jinja2.cfg
md5sum =
b17674f523adce9b0dda942c1493674d
md5sum =
d310dee0de054e10d77f036199297b3f
[template-lte-gnb]
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb-epc.jinja2.cfg
View file @
6e15e85f
{% set part_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) %}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ slave_reference }}
info = Your SIM card has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
[buildout]
[buildout]
parts =
parts =
directory
directory
lte-enb-request
lte-enb-request
lte-mme-request
lte-mme-request
publish-connection-information
publish-connection-information
{% for part in part_list -%}
{{ ' %s' % part }}
{% endfor %}
extends = {{ monitor_template }}
extends = {{ monitor_template }}
...
...
software/ors-amarisoft/instance-epc.jinja2.cfg
View file @
6e15e85f
{% set part_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) %}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ slave_reference }}
info = Your SIM card has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
[buildout]
[buildout]
parts =
parts =
directory
directory
lte-mme-request
lte-mme-request
publish-connection-information
publish-connection-information
{% for part in part_list -%}
{{ ' %s' % part }}
{% endfor %}
extends = {{ monitor_template }}
extends = {{ monitor_template }}
...
...
software/ors-amarisoft/instance-gnb-epc.jinja2.cfg
View file @
6e15e85f
{% set part_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) %}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ slave_reference }}
info = Your SIM card has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
[buildout]
[buildout]
parts =
parts =
directory
directory
lte-gnb-request
lte-gnb-request
lte-mme-request
lte-mme-request
publish-connection-information
publish-connection-information
{% for part in part_list -%}
{{ ' %s' % part }}
{% endfor %}
extends = {{ monitor_template }}
extends = {{ monitor_template }}
...
...
software/ors-amarisoft/test/test.jinja2.py
View file @
6e15e85f
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
):
conf
=
yaml
.
load
(
f
)
return
"gnb"
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
def
test_gnb_conf
(
self
):
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
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
def
test_gnb_conf2
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
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
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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
:
def
test_sim_card
(
self
):
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
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
def
test_enb_conf
(
self
):
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
'_'
:
json
.
dumps
(
enb_param_dict
),
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
)
:
conf
=
yaml
.
load
(
f
)
return
"gnb-epc"
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
(
):
def
test_gnb_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
]
)
test_gnb_conf1
(
self
)
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
def
test_mme_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
software_url
=
cls
.
getSoftwareURL
()
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"epc"
return
"epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
return
"gnb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
...
...
software/ors-amarisoft/test/testTDD1900.py
View file @
6e15e85f
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
):
conf
=
yaml
.
load
(
f
)
return
"gnb"
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
def
test_gnb_conf
(
self
):
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
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
def
test_gnb_conf2
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
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
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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
:
def
test_sim_card
(
self
):
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
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
def
test_enb_conf
(
self
):
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
'_'
:
json
.
dumps
(
enb_param_dict
),
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
)
:
conf
=
yaml
.
load
(
f
)
return
"gnb-epc"
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
(
):
def
test_gnb_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
]
)
test_gnb_conf1
(
self
)
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
def
test_mme_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
software_url
=
cls
.
getSoftwareURL
()
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"epc"
return
"epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
return
"gnb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
...
...
software/ors-amarisoft/test/testTDD2600.py
View file @
6e15e85f
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
):
conf
=
yaml
.
load
(
f
)
return
"gnb"
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
def
test_gnb_conf
(
self
):
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
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
def
test_gnb_conf2
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
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
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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
:
def
test_sim_card
(
self
):
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
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
def
test_enb_conf
(
self
):
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
'_'
:
json
.
dumps
(
enb_param_dict
),
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
)
:
conf
=
yaml
.
load
(
f
)
return
"gnb-epc"
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
(
):
def
test_gnb_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
]
)
test_gnb_conf1
(
self
)
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
def
test_mme_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
software_url
=
cls
.
getSoftwareURL
()
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"epc"
return
"epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
return
"gnb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
...
...
software/ors-amarisoft/test/testTDD3500.py
View file @
6e15e85f
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
):
conf
=
yaml
.
load
(
f
)
return
"gnb"
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
def
test_gnb_conf
(
self
):
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
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
def
test_gnb_conf2
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
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
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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
:
def
test_sim_card
(
self
):
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
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
def
test_enb_conf
(
self
):
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
'_'
:
json
.
dumps
(
enb_param_dict
),
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
)
:
conf
=
yaml
.
load
(
f
)
return
"gnb-epc"
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
(
):
def
test_gnb_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
]
)
test_gnb_conf1
(
self
)
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
def
test_mme_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
software_url
=
cls
.
getSoftwareURL
()
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"epc"
return
"epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
return
"gnb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
...
...
software/ors-amarisoft/test/testTDD3700.py
View file @
6e15e85f
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
...
@@ -94,15 +94,31 @@ enb_param_dict.update(param_dict)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict1
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
gnb_param_dict2
.
update
(
param_dict
)
class
TestGNBParameters1
(
ORSTestCase
):
def
test_enb_conf
(
self
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
):
conf
=
yaml
.
load
(
f
)
return
"gnb"
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
def
test_gnb_conf
(
self
):
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
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
...
@@ -128,15 +144,7 @@ class TestGNBParameters1(ORSTestCase):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
self
.
assertIn
(
str
(
gnb_param_dict1
[
'nr_bandwidth'
]),
l
)
class
TestGNBParameters2
(
ORSTestCase
):
def
test_gnb_conf2
(
self
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
gnb_param_dict2
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
...
@@ -148,40 +156,33 @@ class TestGNBParameters2(ORSTestCase):
for
n
in
"sd sst"
.
split
():
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
gnb_param_dict2
[
'nssai'
][
str
(
p
[
'sd'
])][
n
])
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
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'plmn'
],
param_dict
[
'epc_plmn'
])
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
:
def
test_sim_card
(
self
):
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
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
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
:
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
...
@@ -191,8 +192,27 @@ class TestENBParameters(ORSTestCase):
def
test_enb_conf
(
self
):
def
test_enb_conf
(
self
):
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
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
param_dict
)}
return
{
'_'
:
json
.
dumps
(
param_dict
)}
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
...
@@ -203,12 +223,9 @@ class TestEPCParameters(ORSTestCase):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
'_'
:
json
.
dumps
(
enb_param_dict
),
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
...
@@ -217,17 +234,17 @@ class TestENBEPCParameters(ORSTestCase):
def
test_mme_conf
(
self
):
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
test_mme_conf
(
self
)
def
test_ue_db
(
self
):
class
TestGNBEPCParameters
(
ORSTestCase
):
@
classmethod
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
def
getInstanceParameterDict
(
cls
):
self
.
slap
.
instance_directory
,
'*'
,
'ue_db.cfg'
))[
0
]
return
{
'_'
:
json
.
dumps
(
gnb_param_dict1
)}
@
classmethod
with
open
(
conf_file
,
'r'
)
as
f
:
def
getInstanceSoftwareType
(
cls
)
:
conf
=
yaml
.
load
(
f
)
return
"gnb-epc"
for
n
in
"sim_algo imsi opc sqn impu impi"
.
split
(
):
def
test_gnb_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
n
],
param_dict
[
n
]
)
test_gnb_conf1
(
self
)
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
param_dict
[
'k'
])
def
test_mme_conf
(
self
):
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
param_dict
[
'amf'
],
16
)
)
test_mme_conf
(
self
)
def
requestSlaveInstance
(
cls
,
software_type
):
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
software_url
=
cls
.
getSoftwareURL
()
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
...
@@ -248,19 +265,16 @@ class TestEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"epc"
return
"epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestENBEPCSimCard
(
ORSTestCase
):
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
...
@@ -271,19 +285,16 @@ class TestENBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
return
"enb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
@
classmethod
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
...
@@ -294,19 +305,16 @@ class TestGNBEPCSimCard(ORSTestCase):
return
default_instance
return
default_instance
@
classmethod
@
classmethod
def
requestSlaveInstance
(
cls
):
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
re
turn
re
questSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
@
classmethod
def
getInstanceParameterDict
(
cls
):
def
getInstanceParameterDict
(
cls
):
return
{
return
{
'_'
:
json
.
dumps
({
'testing'
:
True
})}
'_'
:
json
.
dumps
({
'testing'
:
True
})
}
@
classmethod
@
classmethod
def
getInstanceSoftwareType
(
cls
):
def
getInstanceSoftwareType
(
cls
):
return
"gnb-epc"
return
"gnb-epc"
def
test_sim_card
(
self
):
def
test_sim_card
(
self
):
self
.
slap
.
waitForInstance
()
# Wait until publish is done
self
.
slap
.
waitForInstance
()
# Wait until publish is done
test_
ue_db
(
self
)
test_
sim_card
(
self
)
class
TestUELTEParameters
(
ORSTestCase
):
class
TestUELTEParameters
(
ORSTestCase
):
@
classmethod
@
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