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
Nirina Malard
slapos
Commits
94a92c84
Commit
94a92c84
authored
Aug 22, 2022
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
7618c299
9b0e8316
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1737 additions
and
33 deletions
+1737
-33
component/trafficserver/buildout.cfg
component/trafficserver/buildout.cfg
+2
-2
software/html5as/buildout.hash.cfg
software/html5as/buildout.hash.cfg
+1
-1
software/html5as/instance_html5as.cfg.in
software/html5as/instance_html5as.cfg.in
+1
-1
software/metabase/software.cfg
software/metabase/software.cfg
+2
-2
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+9
-9
software/ors-amarisoft/config/enb.jinja2.cfg
software/ors-amarisoft/config/enb.jinja2.cfg
+1
-3
software/ors-amarisoft/config/mme.jinja2.cfg
software/ors-amarisoft/config/mme.jinja2.cfg
+6
-6
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+11
-1
software/ors-amarisoft/instance-gnb.jinja2.cfg
software/ors-amarisoft/instance-gnb.jinja2.cfg
+11
-1
software/ors-amarisoft/instance-mme.jinja2.cfg
software/ors-amarisoft/instance-mme.jinja2.cfg
+12
-3
software/ors-amarisoft/promise/check_interface_up.jinja2.py
software/ors-amarisoft/promise/check_interface_up.jinja2.py
+6
-1
software/ors-amarisoft/promise/check_sdr_busy.jinja2.py
software/ors-amarisoft/promise/check_sdr_busy.jinja2.py
+6
-0
software/ors-amarisoft/render-templates
software/ors-amarisoft/render-templates
+5
-0
software/ors-amarisoft/test/README.md
software/ors-amarisoft/test/README.md
+1
-0
software/ors-amarisoft/test/setup.py
software/ors-amarisoft/test/setup.py
+51
-0
software/ors-amarisoft/test/test.jinja2.py
software/ors-amarisoft/test/test.jinja2.py
+311
-0
software/ors-amarisoft/test/testTDD1900.py
software/ors-amarisoft/test/testTDD1900.py
+311
-0
software/ors-amarisoft/test/testTDD2600.py
software/ors-amarisoft/test/testTDD2600.py
+311
-0
software/ors-amarisoft/test/testTDD3500.py
software/ors-amarisoft/test/testTDD3500.py
+311
-0
software/ors-amarisoft/test/testTDD3700.py
software/ors-amarisoft/test/testTDD3700.py
+311
-0
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+7
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+17
-1
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+2
-2
stack/erp5/instance-zope.cfg.in
stack/erp5/instance-zope.cfg.in
+26
-0
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+5
-0
No files found.
component/trafficserver/buildout.cfg
View file @
94a92c84
...
...
@@ -24,8 +24,8 @@ min_version = 8
[trafficserver]
recipe = slapos.recipe.cmmi
url = https://dlcdn.apache.org/trafficserver/trafficserver-9.1.
2
.tar.bz2
md5sum =
4dbe434e6cc2bd6ab9a0bf48af312f4b
url = https://dlcdn.apache.org/trafficserver/trafficserver-9.1.
3
.tar.bz2
md5sum =
020e09019d38704a2cf96f4ae8450709
shared = true
patch-options = -p1
configure-options =
...
...
software/html5as/buildout.hash.cfg
View file @
94a92c84
...
...
@@ -21,7 +21,7 @@ md5sum = ef264514b64a4b2c77c9965c587c6d34
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum =
a48e0026e2b949cc334efcb21478a6ed
md5sum =
743f7ec8718de67f31720a68258a5ff2
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
...
...
software/html5as/instance_html5as.cfg.in
View file @
94a92c84
...
...
@@ -204,7 +204,7 @@ post = kill -USR1 $(cat ${html5as:path_pid})
# Publish nginx address
[publish-connection-information]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
.serialised
# By extending monitor publish, all the section deploying monitoring will
# be deployed. The parameters needed for accessing monitoring will be published
<= monitor-publish
...
...
software/metabase/software.cfg
View file @
94a92c84
...
...
@@ -22,8 +22,8 @@ part = python3
[metabase.jar]
recipe = slapos.recipe.build:download
url = https://downloads.metabase.com/v0.4
3
.1/metabase.jar
md5sum =
8033ba58825239e7dff29be8d4c885a7
url = https://downloads.metabase.com/v0.4
4
.1/metabase.jar
md5sum =
a97e8e67a0cc647f7c44ca787eb9a41a
[instance-profile]
recipe = slapos.recipe.template
...
...
software/ors-amarisoft/buildout.hash.cfg
View file @
94a92c84
...
...
@@ -24,7 +24,7 @@ md5sum = b10c10a9408a934052fd0960f31a75fc
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = c
5a82279b6ada358c74a90c3b660bf55
md5sum = c
450b8c307d20738a98bcb4f6ffeee16
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
...
@@ -36,11 +36,11 @@ md5sum = 2cfe5679374559ab94478b987d646d83
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum =
eabbdb8ced563180f0bba8ca06e4bac4
md5sum =
9732653a0e2c7fe91d80da80762430d2
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum =
2c2d2dc4fd6b7a9100642e34812a5140
md5sum =
51b8762d4691f525d0228fa1f286e772
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
...
...
@@ -48,7 +48,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum =
4b66551e04edff724b08d6bb90f7342c
md5sum =
faed74244d0c539dea53a0377ad0e103
[sib23.asn]
filename = config/sib23.asn
...
...
@@ -64,16 +64,16 @@ md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
filename = config/mme.jinja2.cfg
md5sum =
a96c33a0a2a301f204cac8642267ad97
md5sum =
0c1e086de705f074654a794a2248cad0
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
md5sum = 36281b03597252cf75169417d02fc28c
[sdr-busy-promise]
_update_hash_filename_ = promise/check_sdr_busy.py
md5sum =
f7436ff76fea58e37a401d4712275422
_update_hash_filename_ = promise/check_sdr_busy.
jinja2.
py
md5sum =
93dacb1da15310eb70d0815711a06cdf
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.py
md5sum =
505efcbe04e717088924f2267b10c2b9
_update_hash_filename_ = promise/check_interface_up.
jinja2.
py
md5sum =
63d3bbac7b6f480ee0c510e80aa1ccf7
software/ors-amarisoft/config/enb.jinja2.cfg
View file @
94a92c84
...
...
@@ -56,9 +56,7 @@
{%- endif %}
plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
{%- if slapparameter_dict['plmn_list'][k].get('attach_without_pdn', '') %}
attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k]['attach_without_pdn']).lower() }},
{%- endif %}
attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k].get('attach_without_pdn', false)).lower() }},
}
{%- endfor -%}
{% else %}
...
...
software/ors-amarisoft/config/mme.jinja2.cfg
View file @
94a92c84
...
...
@@ -51,15 +51,15 @@
pdn_list: [
{
pdn_type: "ipv4",
tun_ifname: "{{ slap_configuration
['tun-name']
}}",
tun_ifname: "{{ slap_configuration
.get('tun-name', '')
}}",
access_point_name: ["default", "internet", "ims", "sos"],
first_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(slap_configuration['tun-ipv4-network']).first) + 2 }}",
last_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(slap_configuration['tun-ipv4-network']).last) - 1 }}",
{% if slap_configuration.get('tun-name', '') %}
first_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(slap_configuration.get('tun-ipv4-network', '')).first) + 2 }}",
last_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(slap_configuration.get('tun-ipv4-network', '')).last) - 1 }}",
{% endif %}
ip_addr_shift: 2,
dns_addr: "8.8.8.8",
// TODO: enable this instead of Google's DNS above
// dns_addr: "{{ slap_configuration['tun-ipv4-addr'] }}",
p_cscf_addr: ["{{ slap_configuration['tun-ipv4-addr'] }}"],
p_cscf_addr: ["{{ slap_configuration.get('tun-ipv4-addr', '') }}"],
erabs: [
{
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
94a92c84
...
...
@@ -73,8 +73,10 @@ recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${directory:log}/enb-output.log 2>> ${directory:log}/enb-output.log
{% endif %}
### eNodeB (enb)
[lte-enb-service]
...
...
@@ -125,9 +127,17 @@ monitor-title = {{ slapparameter_dict['name'] | string }}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file =
{{ sdr_busy_promise }
}
file =
${sdr-busy-promise-template:output
}
output = ${directory:plugins}/check-sdr-busy.py
software/ors-amarisoft/instance-gnb.jinja2.cfg
View file @
94a92c84
...
...
@@ -74,8 +74,10 @@ recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ enb }}/lteenb ${directory:etc}/gnb.cfg >> ${directory:log}/gnb-output.log 2>> ${directory:log}/gnb-output.log
{% endif %}
### eNodeB (enb)
[lte-enb-service]
...
...
@@ -125,9 +127,17 @@ monitor-title = {{ slapparameter_dict['name'] | string }}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file =
{{ sdr_busy_promise }
}
file =
${sdr-busy-promise-template:output
}
output = ${directory:plugins}/check-sdr-busy.py
software/ors-amarisoft/instance-mme.jinja2.cfg
View file @
94a92c84
...
...
@@ -84,8 +84,10 @@ recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
rm -f ${directory:var}/lte_ue.db;
{{ mme }}/ltemme ${directory:etc}/mme.cfg >> ${directory:log}/mme-output.log 2>> ${directory:log}/mme-output.log
{% endif %}
### MME
[lte-mme-service]
...
...
@@ -152,10 +154,17 @@ recipe = slapos.cookbook:publish.serialised
epc-ipv6 = ${slap-configuration:ipv6-random}
epc-ipv4 = {{ epc_ipv4 }}
# Add custom promise to check if /dev/sdr0 is busy
[tun-up-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ interface_up_promise }}
output = ${directory:etc}/check-tun-up.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if tun is up
[tun-up-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file =
{{ interface_up_promise }
}
file =
${tun-up-promise-template:output
}
output = ${directory:plugins}/check-tun-up.py
config-ifname = ${slap-configuration:tun-name}
software/ors-amarisoft/promise/check_interface_up.py
→
software/ors-amarisoft/promise/check_interface_up.
jinja2.
py
View file @
94a92c84
...
...
@@ -27,7 +27,12 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
ifname
=
self
.
getConfig
(
'ifname'
)
ifname
=
"{{ slapparameter_dict.get('tun-name', '') }}"
testing
=
{{
slapparameter_dict
.
get
(
'testing'
,
False
)
}}
if
testing
:
self
.
logger
.
info
(
"skipping promise"
)
return
f
=
open
(
'/sys/class/net/%s/operstate'
%
ifname
,
'r'
)
if
f
.
read
()
==
'up
\
n
'
:
...
...
software/ors-amarisoft/promise/check_sdr_busy.py
→
software/ors-amarisoft/promise/check_sdr_busy.
jinja2.
py
View file @
94a92c84
...
...
@@ -27,7 +27,13 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
testing
=
{{
slapparameter_dict
.
get
(
'testing'
,
False
)
}}
sdr_dev
=
'/dev/sdr0'
if
testing
:
self
.
logger
.
info
(
"skipping promise"
)
return
try
:
open
(
sdr_dev
,
'w'
).
close
()
self
.
logger
.
error
(
"eNB is not using %s"
,
sdr_dev
)
...
...
software/ors-amarisoft/render-templates
View file @
94a92c84
...
...
@@ -108,11 +108,16 @@ with open('instance-gnb-input-schema.jinja2.json', 'r') as f:
instance_gnb_json_template
=
Template
(
f
.
read
())
with
open
(
'software.jinja2.cfg'
,
'r'
)
as
f
:
software_template
=
Template
(
f
.
read
())
with
open
(
'test/test.jinja2.py'
,
'r'
)
as
f
:
test_template
=
Template
(
f
.
read
())
for
rf_mode_context
in
rf_mode_context_list
:
with
open
(
'software-{}.cfg.json'
.
format
(
rf_mode_context
[
'rf_mode'
]),
'w+'
)
as
f
:
f
.
write
(
software_json_template
.
render
(
**
rf_mode_context
,
**
global_context
)
+
'
\
n
'
)
with
open
(
'test/test{}.py'
.
format
(
rf_mode_context
[
'rf_mode'
].
upper
()),
'w+'
)
as
f
:
f
.
write
(
test_template
.
render
(
**
rf_mode_context
,
**
global_context
)
+
'
\
n
'
)
with
open
(
'software-{}.cfg'
.
format
(
rf_mode_context
[
'rf_mode'
]),
'w+'
)
as
f
:
f
.
write
(
software_template
.
render
(
**
rf_mode_context
,
**
global_context
)
+
'
\
n
'
)
...
...
software/ors-amarisoft/test/README.md
0 → 100644
View file @
94a92c84
Tests for ors-amarisoft software release
software/ors-amarisoft/test/setup.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
setuptools
import
setup
,
find_packages
version
=
'0.0.1.dev0'
name
=
'slapos.test.ors_amarisoft'
with
open
(
"README.md"
)
as
f
:
long_description
=
f
.
read
()
setup
(
name
=
name
,
version
=
version
,
description
=
"Test for SlapOS' ors-amarisoft"
,
long_description
=
long_description
,
long_description_content_type
=
'text/markdown'
,
maintainer
=
"Nexedi"
,
maintainer_email
=
"info@nexedi.com"
,
url
=
"https://lab.nexedi.com/nexedi/slapos"
,
packages
=
find_packages
(),
install_requires
=
[
'slapos.core'
,
'slapos.libnetworkcache'
,
'slapos.cookbook'
,
],
zip_safe
=
True
,
test_suite
=
'test'
,
)
software/ors-amarisoft/test/test.jinja2.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
yaml
import
json
import
glob
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
ORSTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software-{{ rf_mode }}.cfg'
)))
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'nssai'
:
{
'1'
:
{
'sd'
:
'1'
,
'sst'
:
'10'
},
'2'
:
{
'sd'
:
'2'
,
'sst'
:
'20'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'nssai'
][
p
[
'sd'
]][
n
])
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_nr_arfcn'
:
325320
,
'nr_band'
:
99
,
'nr_bandwidth'
:
50
,
'gnb_id'
:
"0x17"
,
'ssb_pos_bitmap'
:
"10"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'plmn'
:
'00101'
,
'ranac'
:
1
,
'reserved'
:
True
,
'tac'
:
1
},
'00102'
:
{
'plmn'
:
'00102'
,
'ranac'
:
2
,
'reserved'
:
False
,
'tac'
:
2
},
},
'amf_list'
:
{
'10.0.0.1'
:
{
'amf_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'amf_addr'
:
'2001:db8::1'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
self
.
param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
self
.
param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'dl_nr_arfcn'
],
self
.
param_dict
[
'dl_nr_arfcn'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'band'
],
self
.
param_dict
[
'nr_band'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'ssb_pos_bitmap'
],
self
.
param_dict
[
'ssb_pos_bitmap'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'n_id_cell'
],
self
.
param_dict
[
'pci'
])
self
.
assertEqual
(
conf
[
'gnb_id'
],
int
(
self
.
param_dict
[
'gnb_id'
],
16
))
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
]:
for
n
in
"plmn ranac reserved tac"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'amf_list'
]:
self
.
assertEqual
(
p
[
'amf_addr'
],
self
.
param_dict
[
'amf_list'
][
p
[
'amf_addr'
]][
'amf_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
self
.
param_dict
[
'nr_bandwidth'
]),
l
)
enb_param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_earfcn'
:
325320
,
'n_rb_dl'
:
50
,
'enb_id'
:
"0x17"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'attach_without_pdn'
:
True
,
'plmn'
:
'00101'
,
'reserved'
:
True
},
'00102'
:
{
'attach_without_pdn'
:
False
,
'plmn'
:
'00102'
,
'reserved'
:
False
},
},
'mme_list'
:
{
'10.0.0.1'
:
{
'mme_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'mme_addr'
:
'2001:db8::1'
},
},
}
epc_param_dict
=
{
'testing'
:
True
,
'epc_plmn'
:
'00102'
,
}
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
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_mme_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
epc_param_dict
[
'epc_plmn'
])
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
epc_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
dict
(
enb_param_dict
,
**
epc_param_dict
)),
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
sim_card_param_dict
=
{
"sim_algo"
:
"milenage"
,
"imsi"
:
"001010000000331"
,
"opc"
:
"000102030405060708090A0B0C0D0E0F"
,
"amf"
:
"0x9001"
,
"sqn"
:
"000000000000"
,
"k"
:
"00112233445566778899AABBCCDDEEFF"
,
"impu"
:
"impu331"
,
"impi"
:
"impi331@amarisoft.com"
,
}
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
],
sim_card_param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
sim_card_param_dict
[
'k'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
sim_card_param_dict
[
'amf'
],
16
))
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
"SIM-CARD-EPC"
,
partition_parameter_kw
=
{
'_'
:
json
.
dumps
(
sim_card_param_dict
)},
shared
=
True
,
software_type
=
software_type
,
)
class
TestEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
software/ors-amarisoft/test/testTDD1900.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
yaml
import
json
import
glob
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
ORSTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software-tdd1900.cfg'
)))
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'nssai'
:
{
'1'
:
{
'sd'
:
'1'
,
'sst'
:
'10'
},
'2'
:
{
'sd'
:
'2'
,
'sst'
:
'20'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'nssai'
][
p
[
'sd'
]][
n
])
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_nr_arfcn'
:
325320
,
'nr_band'
:
99
,
'nr_bandwidth'
:
50
,
'gnb_id'
:
"0x17"
,
'ssb_pos_bitmap'
:
"10"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'plmn'
:
'00101'
,
'ranac'
:
1
,
'reserved'
:
True
,
'tac'
:
1
},
'00102'
:
{
'plmn'
:
'00102'
,
'ranac'
:
2
,
'reserved'
:
False
,
'tac'
:
2
},
},
'amf_list'
:
{
'10.0.0.1'
:
{
'amf_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'amf_addr'
:
'2001:db8::1'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
self
.
param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
self
.
param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'dl_nr_arfcn'
],
self
.
param_dict
[
'dl_nr_arfcn'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'band'
],
self
.
param_dict
[
'nr_band'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'ssb_pos_bitmap'
],
self
.
param_dict
[
'ssb_pos_bitmap'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'n_id_cell'
],
self
.
param_dict
[
'pci'
])
self
.
assertEqual
(
conf
[
'gnb_id'
],
int
(
self
.
param_dict
[
'gnb_id'
],
16
))
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
]:
for
n
in
"plmn ranac reserved tac"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'amf_list'
]:
self
.
assertEqual
(
p
[
'amf_addr'
],
self
.
param_dict
[
'amf_list'
][
p
[
'amf_addr'
]][
'amf_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
self
.
param_dict
[
'nr_bandwidth'
]),
l
)
enb_param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_earfcn'
:
325320
,
'n_rb_dl'
:
50
,
'enb_id'
:
"0x17"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'attach_without_pdn'
:
True
,
'plmn'
:
'00101'
,
'reserved'
:
True
},
'00102'
:
{
'attach_without_pdn'
:
False
,
'plmn'
:
'00102'
,
'reserved'
:
False
},
},
'mme_list'
:
{
'10.0.0.1'
:
{
'mme_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'mme_addr'
:
'2001:db8::1'
},
},
}
epc_param_dict
=
{
'testing'
:
True
,
'epc_plmn'
:
'00102'
,
}
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
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_mme_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
epc_param_dict
[
'epc_plmn'
])
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
epc_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
dict
(
enb_param_dict
,
**
epc_param_dict
)),
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
sim_card_param_dict
=
{
"sim_algo"
:
"milenage"
,
"imsi"
:
"001010000000331"
,
"opc"
:
"000102030405060708090A0B0C0D0E0F"
,
"amf"
:
"0x9001"
,
"sqn"
:
"000000000000"
,
"k"
:
"00112233445566778899AABBCCDDEEFF"
,
"impu"
:
"impu331"
,
"impi"
:
"impi331@amarisoft.com"
,
}
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
],
sim_card_param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
sim_card_param_dict
[
'k'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
sim_card_param_dict
[
'amf'
],
16
))
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
"SIM-CARD-EPC"
,
partition_parameter_kw
=
{
'_'
:
json
.
dumps
(
sim_card_param_dict
)},
shared
=
True
,
software_type
=
software_type
,
)
class
TestEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
software/ors-amarisoft/test/testTDD2600.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
yaml
import
json
import
glob
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
ORSTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software-tdd2600.cfg'
)))
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'nssai'
:
{
'1'
:
{
'sd'
:
'1'
,
'sst'
:
'10'
},
'2'
:
{
'sd'
:
'2'
,
'sst'
:
'20'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'nssai'
][
p
[
'sd'
]][
n
])
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_nr_arfcn'
:
325320
,
'nr_band'
:
99
,
'nr_bandwidth'
:
50
,
'gnb_id'
:
"0x17"
,
'ssb_pos_bitmap'
:
"10"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'plmn'
:
'00101'
,
'ranac'
:
1
,
'reserved'
:
True
,
'tac'
:
1
},
'00102'
:
{
'plmn'
:
'00102'
,
'ranac'
:
2
,
'reserved'
:
False
,
'tac'
:
2
},
},
'amf_list'
:
{
'10.0.0.1'
:
{
'amf_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'amf_addr'
:
'2001:db8::1'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
self
.
param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
self
.
param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'dl_nr_arfcn'
],
self
.
param_dict
[
'dl_nr_arfcn'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'band'
],
self
.
param_dict
[
'nr_band'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'ssb_pos_bitmap'
],
self
.
param_dict
[
'ssb_pos_bitmap'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'n_id_cell'
],
self
.
param_dict
[
'pci'
])
self
.
assertEqual
(
conf
[
'gnb_id'
],
int
(
self
.
param_dict
[
'gnb_id'
],
16
))
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
]:
for
n
in
"plmn ranac reserved tac"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'amf_list'
]:
self
.
assertEqual
(
p
[
'amf_addr'
],
self
.
param_dict
[
'amf_list'
][
p
[
'amf_addr'
]][
'amf_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
self
.
param_dict
[
'nr_bandwidth'
]),
l
)
enb_param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_earfcn'
:
325320
,
'n_rb_dl'
:
50
,
'enb_id'
:
"0x17"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'attach_without_pdn'
:
True
,
'plmn'
:
'00101'
,
'reserved'
:
True
},
'00102'
:
{
'attach_without_pdn'
:
False
,
'plmn'
:
'00102'
,
'reserved'
:
False
},
},
'mme_list'
:
{
'10.0.0.1'
:
{
'mme_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'mme_addr'
:
'2001:db8::1'
},
},
}
epc_param_dict
=
{
'testing'
:
True
,
'epc_plmn'
:
'00102'
,
}
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
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_mme_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
epc_param_dict
[
'epc_plmn'
])
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
epc_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
dict
(
enb_param_dict
,
**
epc_param_dict
)),
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
sim_card_param_dict
=
{
"sim_algo"
:
"milenage"
,
"imsi"
:
"001010000000331"
,
"opc"
:
"000102030405060708090A0B0C0D0E0F"
,
"amf"
:
"0x9001"
,
"sqn"
:
"000000000000"
,
"k"
:
"00112233445566778899AABBCCDDEEFF"
,
"impu"
:
"impu331"
,
"impi"
:
"impi331@amarisoft.com"
,
}
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
],
sim_card_param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
sim_card_param_dict
[
'k'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
sim_card_param_dict
[
'amf'
],
16
))
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
"SIM-CARD-EPC"
,
partition_parameter_kw
=
{
'_'
:
json
.
dumps
(
sim_card_param_dict
)},
shared
=
True
,
software_type
=
software_type
,
)
class
TestEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
software/ors-amarisoft/test/testTDD3500.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
yaml
import
json
import
glob
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
ORSTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software-tdd3500.cfg'
)))
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'nssai'
:
{
'1'
:
{
'sd'
:
'1'
,
'sst'
:
'10'
},
'2'
:
{
'sd'
:
'2'
,
'sst'
:
'20'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'nssai'
][
p
[
'sd'
]][
n
])
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_nr_arfcn'
:
325320
,
'nr_band'
:
99
,
'nr_bandwidth'
:
50
,
'gnb_id'
:
"0x17"
,
'ssb_pos_bitmap'
:
"10"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'plmn'
:
'00101'
,
'ranac'
:
1
,
'reserved'
:
True
,
'tac'
:
1
},
'00102'
:
{
'plmn'
:
'00102'
,
'ranac'
:
2
,
'reserved'
:
False
,
'tac'
:
2
},
},
'amf_list'
:
{
'10.0.0.1'
:
{
'amf_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'amf_addr'
:
'2001:db8::1'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
self
.
param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
self
.
param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'dl_nr_arfcn'
],
self
.
param_dict
[
'dl_nr_arfcn'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'band'
],
self
.
param_dict
[
'nr_band'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'ssb_pos_bitmap'
],
self
.
param_dict
[
'ssb_pos_bitmap'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'n_id_cell'
],
self
.
param_dict
[
'pci'
])
self
.
assertEqual
(
conf
[
'gnb_id'
],
int
(
self
.
param_dict
[
'gnb_id'
],
16
))
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
]:
for
n
in
"plmn ranac reserved tac"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'amf_list'
]:
self
.
assertEqual
(
p
[
'amf_addr'
],
self
.
param_dict
[
'amf_list'
][
p
[
'amf_addr'
]][
'amf_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
self
.
param_dict
[
'nr_bandwidth'
]),
l
)
enb_param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_earfcn'
:
325320
,
'n_rb_dl'
:
50
,
'enb_id'
:
"0x17"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'attach_without_pdn'
:
True
,
'plmn'
:
'00101'
,
'reserved'
:
True
},
'00102'
:
{
'attach_without_pdn'
:
False
,
'plmn'
:
'00102'
,
'reserved'
:
False
},
},
'mme_list'
:
{
'10.0.0.1'
:
{
'mme_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'mme_addr'
:
'2001:db8::1'
},
},
}
epc_param_dict
=
{
'testing'
:
True
,
'epc_plmn'
:
'00102'
,
}
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
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_mme_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
epc_param_dict
[
'epc_plmn'
])
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
epc_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
dict
(
enb_param_dict
,
**
epc_param_dict
)),
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
sim_card_param_dict
=
{
"sim_algo"
:
"milenage"
,
"imsi"
:
"001010000000331"
,
"opc"
:
"000102030405060708090A0B0C0D0E0F"
,
"amf"
:
"0x9001"
,
"sqn"
:
"000000000000"
,
"k"
:
"00112233445566778899AABBCCDDEEFF"
,
"impu"
:
"impu331"
,
"impi"
:
"impi331@amarisoft.com"
,
}
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
],
sim_card_param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
sim_card_param_dict
[
'k'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
sim_card_param_dict
[
'amf'
],
16
))
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
"SIM-CARD-EPC"
,
partition_parameter_kw
=
{
'_'
:
json
.
dumps
(
sim_card_param_dict
)},
shared
=
True
,
software_type
=
software_type
,
)
class
TestEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
software/ors-amarisoft/test/testTDD3700.py
0 → 100644
View file @
94a92c84
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
yaml
import
json
import
glob
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
ORSTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software-tdd3700.cfg'
)))
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'nssai'
:
{
'1'
:
{
'sd'
:
'1'
,
'sst'
:
'10'
},
'2'
:
{
'sd'
:
'2'
,
'sst'
:
'20'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
][
0
][
'nssai'
]:
for
n
in
"sd sst"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'nssai'
][
p
[
'sd'
]][
n
])
class
TestGNBParameters
(
ORSTestCase
):
param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_nr_arfcn'
:
325320
,
'nr_band'
:
99
,
'nr_bandwidth'
:
50
,
'gnb_id'
:
"0x17"
,
'ssb_pos_bitmap'
:
"10"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'plmn'
:
'00101'
,
'ranac'
:
1
,
'reserved'
:
True
,
'tac'
:
1
},
'00102'
:
{
'plmn'
:
'00102'
,
'ranac'
:
2
,
'reserved'
:
False
,
'tac'
:
2
},
},
'amf_list'
:
{
'10.0.0.1'
:
{
'amf_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'amf_addr'
:
'2001:db8::1'
},
},
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"gnb"
def
test_gnb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'gnb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
self
.
param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
self
.
param_dict
[
'rx_gain'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'dl_nr_arfcn'
],
self
.
param_dict
[
'dl_nr_arfcn'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'band'
],
self
.
param_dict
[
'nr_band'
])
self
.
assertEqual
(
conf
[
'nr_cell_list'
][
0
][
'ssb_pos_bitmap'
],
self
.
param_dict
[
'ssb_pos_bitmap'
])
self
.
assertEqual
(
conf
[
'nr_cell_default'
][
'n_id_cell'
],
self
.
param_dict
[
'pci'
])
self
.
assertEqual
(
conf
[
'gnb_id'
],
int
(
self
.
param_dict
[
'gnb_id'
],
16
))
for
p
in
conf
[
'nr_cell_default'
][
'plmn_list'
]:
for
n
in
"plmn ranac reserved tac"
.
split
():
self
.
assertEqual
(
p
[
n
],
self
.
param_dict
[
'plmn_list'
][
p
[
'plmn'
]][
n
])
for
p
in
conf
[
'amf_list'
]:
self
.
assertEqual
(
p
[
'amf_addr'
],
self
.
param_dict
[
'amf_list'
][
p
[
'amf_addr'
]][
'amf_addr'
])
with
open
(
conf_file
,
'r'
)
as
f
:
for
l
in
f
:
if
l
.
startswith
(
'#define NR_BANDWIDTH'
):
self
.
assertIn
(
str
(
self
.
param_dict
[
'nr_bandwidth'
]),
l
)
enb_param_dict
=
{
'testing'
:
True
,
'tx_gain'
:
17
,
'rx_gain'
:
17
,
'dl_earfcn'
:
325320
,
'n_rb_dl'
:
50
,
'enb_id'
:
"0x17"
,
'pci'
:
250
,
'plmn_list'
:
{
'00101'
:
{
'attach_without_pdn'
:
True
,
'plmn'
:
'00101'
,
'reserved'
:
True
},
'00102'
:
{
'attach_without_pdn'
:
False
,
'plmn'
:
'00102'
,
'reserved'
:
False
},
},
'mme_list'
:
{
'10.0.0.1'
:
{
'mme_addr'
:
'10.0.0.1'
},
'2001:db8::1'
:
{
'mme_addr'
:
'2001:db8::1'
},
},
}
epc_param_dict
=
{
'testing'
:
True
,
'epc_plmn'
:
'00102'
,
}
def
test_enb_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'enb.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'tx_gain'
],
enb_param_dict
[
'tx_gain'
])
self
.
assertEqual
(
conf
[
'rx_gain'
],
enb_param_dict
[
'rx_gain'
])
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_mme_conf
(
self
):
conf_file
=
glob
.
glob
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
'*'
,
'etc'
,
'mme.cfg'
))[
0
]
with
open
(
conf_file
,
'r'
)
as
f
:
conf
=
yaml
.
load
(
f
)
self
.
assertEqual
(
conf
[
'plmn'
],
epc_param_dict
[
'epc_plmn'
])
class
TestENBParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
enb_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
class
TestEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
epc_param_dict
)}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"epc"
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
class
TestENBEPCParameters
(
ORSTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
dict
(
enb_param_dict
,
**
epc_param_dict
)),
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"enb-epc"
def
test_enb_conf
(
self
):
test_enb_conf
(
self
)
def
test_mme_conf
(
self
):
test_mme_conf
(
self
)
sim_card_param_dict
=
{
"sim_algo"
:
"milenage"
,
"imsi"
:
"001010000000331"
,
"opc"
:
"000102030405060708090A0B0C0D0E0F"
,
"amf"
:
"0x9001"
,
"sqn"
:
"000000000000"
,
"k"
:
"00112233445566778899AABBCCDDEEFF"
,
"impu"
:
"impu331"
,
"impi"
:
"impi331@amarisoft.com"
,
}
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
],
sim_card_param_dict
[
n
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'K'
],
sim_card_param_dict
[
'k'
])
self
.
assertEqual
(
conf
[
'ue_db'
][
0
][
'amf'
],
int
(
sim_card_param_dict
[
'amf'
],
16
))
def
requestSlaveInstance
(
cls
,
software_type
):
software_url
=
cls
.
getSoftwareURL
()
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
"SIM-CARD-EPC"
,
partition_parameter_kw
=
{
'_'
:
json
.
dumps
(
sim_card_param_dict
)},
shared
=
True
,
software_type
=
software_type
,
)
class
TestEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestENBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'enb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
class
TestGNBEPCSimCard
(
ORSTestCase
):
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
ORSTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
requestSlaveInstance
(
cls
,
'gnb-epc'
)
@
classmethod
def
getInstanceParameterDict
(
cls
):
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
)
software/slapos-sr-testing/software.cfg
View file @
94a92c84
...
...
@@ -120,6 +120,11 @@ setup = ${slapos-repository:location}/software/slaprunner/test/
egg = slapos.test.metabase
setup = ${slapos-repository:location}/software/metabase/test/
[slapos.test.ors-amarisoft-setup]
<= setup-develop-egg
egg = slapos.test.ors-amarisoft
setup = ${slapos-repository:location}/software/ors-amarisoft/test/
[slapos.test.fluentd-setup]
<= setup-develop-egg
egg = slapos.test.fluentd
...
...
@@ -281,6 +286,7 @@ extra-eggs =
${slapos.test.kvm-setup:egg}
${slapos.test.matomo-setup:egg}
${slapos.test.metabase-setup:egg}
${slapos.test.ors-amarisoft-setup:egg}
${slapos.test.monitor-setup:egg}
${slapos.test.nextcloud-setup:egg}
${slapos.test.nginx-push-stream-setup:egg}
...
...
@@ -351,6 +357,7 @@ tests =
erp5 ${slapos.test.erp5-setup:setup}
fluentd ${slapos.test.fluentd-setup:setup}
metabase ${slapos.test.metabase-setup:setup}
ors-amarisoft ${slapos.test.ors-amarisoft-setup:setup}
###
${:extra}
...
...
stack/erp5/buildout.cfg
View file @
94a92c84
...
...
@@ -149,7 +149,6 @@ link-binary =
[template-run-zelenium]
< = download-base
[template]
recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe
...
...
@@ -229,6 +228,11 @@ context =
key unixodbc_location unixodbc:location
key wget_location wget:location
key extra_path_list eggs:extra-paths
key python_executable_for_kernel erp5-python-interpreter-jupyter:interpreter_path
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_filename erp5-kernel:filename
key kernel_json_location kernel-json:location
key kernel_json_filename kernel-json:filename
[template-erp5]
<= download-base
...
...
@@ -392,6 +396,18 @@ initialization =
eggs += ${eggs:eggs}
extra-paths += ${eggs:extra-paths}
[erp5-python-interpreter-jupyter]
<= erp5-python-interpreter
interpreter = pythonwitheggs_jupyter
interpreter_path = ${buildout:directory}/bin/${:interpreter}
eggs +=
jupyter_client
jupyter_core
ipython_genutils
ipykernel
ipywidgets
requests
[zope-product-with-eggtestinfo]
recipe = zc.recipe.egg:custom
setup-eggs =
...
...
stack/erp5/buildout.hash.cfg
View file @
94a92c84
...
...
@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04
[template]
filename = instance.cfg.in
md5sum =
9a7f7888ba4183c9d900e862074f3ba
f
md5sum =
5747c487edd721d8a53061392307b55
f
[template-erp5]
filename = instance-erp5.cfg.in
...
...
@@ -86,7 +86,7 @@ md5sum = 0ac4b74436f554cd677f19275d18d880
[template-zope]
filename = instance-zope.cfg.in
md5sum =
c3e3f8cd985407931b705d15bdedc8d9
md5sum =
57a19c90d281b8cbf3e36207db48f0bd
[template-balancer]
filename = instance-balancer.cfg.in
...
...
stack/erp5/instance-zope.cfg.in
View file @
94a92c84
...
...
@@ -53,6 +53,22 @@ partition. No more (undefined result), no less (IndexError).
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
[erp5-kernel]
recipe = slapos.cookbook:symbolic.link
link-binary = {{ parameter_dict['erp5-kernel-location'] }}/{{ parameter_dict['erp5-kernel-filename'] }}
target-directory = ${directory:erp5-kernel-dir}
[kernel-json-dir]
<= jinja2-template-base
template = {{ parameter_dict['kernel-json-location'] }}/{{ parameter_dict['kernel-json-filename'] }}
rendered = ${directory:erp5-kernel-dir}/kernel.json
context =
raw erp5_url {{ ipv4 }}
raw python_executable {{ parameter_dict['python-executable-for-kernel'] }}
raw kernel_dir ${erp5-kernel:target-directory}/{{ parameter_dict['erp5-kernel-filename'] }}
raw display_name ERP5
raw language_name python
[run-common]
<= userhosts-wrapper-base
environment-extra =
...
...
@@ -66,6 +82,9 @@ environment +=
INSTANCE_HOME=${:instance-home}
CAUCASE={{ slapparameter_dict['caucase-url'] }}
FONTCONFIG_FILE=${fontconfig-conf:output}
JUPYTER_PATH=${directory:jupyter-dir}
JUPYTER_CONFIG_DIR=${directory:jupyter-config-dir}
JUPYTER_RUNTIME_DIR=${directory:jupyter-runtime-dir}
{% if slapparameter_dict.get('wendelin-core-zblk-fmt') %}
WENDELIN_CORE_ZBLK_FMT={{ slapparameter_dict['wendelin-core-zblk-fmt'] }}
{% endif %}
...
...
@@ -103,6 +122,11 @@ var = ${buildout:directory}/var
plugin = ${:etc}/plugin
unit-test-path = ${:srv}/test-instance/unit_test
fontconfig-cache = ${buildout:directory}/.fontconfig
jupyter-dir = ${buildout:directory}/jupyter
jupyter-config-dir = ${:jupyter-dir}/etc
jupyter-runtime-dir = ${:jupyter-dir}/runtime
jupyter-kernel-dir = ${:jupyter-dir}/kernels
erp5-kernel-dir = ${:jupyter-kernel-dir}/ERP5
[fontconfig-conf]
recipe = slapos.recipe.template:jinja2
...
...
@@ -575,3 +599,5 @@ extends =
parts +=
{{ '\n '.join(part_list) }}
publish
erp5-kernel
kernel-json-dir
stack/erp5/instance.cfg.in
View file @
94a92c84
...
...
@@ -114,6 +114,11 @@ extra-path-list = {{ dumps(extra_path_list) }}
matplotlibrc = {{ matplotlibrc_location }}
erp5-location = {{ erp5_location }}
egg-interpreter = {{egg_interpreter}}
erp5-kernel-location = {{ erp5_kernel_location }}
erp5-kernel-filename = {{ erp5_kernel_filename }}
kernel-json-location = {{ kernel_json_location }}
kernel-json-filename = {{ kernel_json_filename }}
python-executable-for-kernel = {{ python_executable_for_kernel }}
[dynamic-template-zope]
<= jinja2-template-base
...
...
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