Commit 0f69d001 authored by Joanne Hugé's avatar Joanne Hugé

Fix IMS

parent 8970aa93
......@@ -16,11 +16,11 @@
[template]
filename = instance.cfg
md5sum = 6ea4fa210a91c15278c847a809de5991
md5sum = 394a3b4d5955c0fdd5dbc2e33cdd0677
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum = 1358f8e0a4cecefe4cdf389b69067f34
md5sum = e5f31171ad98cf31f9ce76bf83f4be23
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
......@@ -36,11 +36,11 @@ md5sum = 0b74993990a0dfa3c6429dc4ac716826
[template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg
md5sum = 35556ebd82be804584482a7fe5eff0be
md5sum = 0a5c7d32a18458fc9f9f28939639e7a4
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
md5sum = d33163012d6c98efc59161974c649557
md5sum = 343ed6321d49a4c0cf37ef869bcea292
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
......@@ -69,3 +69,7 @@ md5sum = 9e867282d7dd80c4255e87a82a47a19d
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.py
md5sum = 505efcbe04e717088924f2267b10c2b9
[generate-ue-db.py]
_update_hash_filename_ = generate-ue-db.py
md5sum = b1cfbe26a44bd9172632ac0ae3f7cfb8
{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%- if slave_instance.get('imsi', '') != '' %}
{%- do filtered_slave_instance_list.append(slave_instance) %}
{%- endif %}
{%- endfor -%}
ue_db: [
{%- for i, slave_instance in enumerate(filtered_slave_instance_list) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
sim_algo: "{{ slave_instance.get('sim_algo', 'milenage') }}",
imsi: "{{ slave_instance.get('imsi', '') }}",
opc: "{{ slave_instance.get('opc', '') }}",
amf: {{ slave_instance.get('amf', '0x9001') }},
sqn: "{{ slave_instance.get('sqn', '000000000000') }}",
K: "{{ slave_instance.get('k', '') }}",
impu: "{{ slave_instance.get('impu', '') }}",
impi: "{{ slave_instance.get('impi', '') }}",
}
{%- endfor -%}
]
{{ slave_instance_list }}
{% for slave_instance in slave_instance_list %}
{{ slave_instance }}
{% endfor %}
......@@ -58,6 +58,7 @@ config-mme_config_link = {{ dumps(slapparameter_dict["mme_config_link"]) }}
{% if slapparameter_dict.get("mme_config_version", None) %}
config-mme_config_version = {{ dumps(slapparameter_dict["mme_config_version"]) }}
{% endif %}
config-slavelist = {{ dumps(slavelist) }}
[lte-enb-request]
<= request-common-base
......
[buildout]
parts =
directory
ltelogs
lte-mme-config
......@@ -33,7 +34,7 @@ configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.enb_addr = 127.0.1.1
ue_db_path = {{ ue_db_path }}
ue_db_path = ${ue-db-config:path}
[directory]
recipe = slapos.cookbook:mkdirectory
......@@ -76,7 +77,6 @@ mode = 0775
pidfile = ${directory:run}/ims.pid
hash-files =
${lte-ims-config:rendered}
{{ ue_db_path }}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[lte-mme-sh-wrapper]
......@@ -100,7 +100,7 @@ mode = 0775
pidfile = ${directory:run}/mme.pid
hash-files =
${lte-mme-config:rendered}
{{ ue_db_path }}
${ue-db-config:path}
${lte-mme-sh-wrapper:rendered}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
......@@ -158,3 +158,34 @@ eggs = slapos.core
file = {{ interface_up_promise }}
output = ${directory:plugins}/check-tun-up.py
config-ifname = ${slap-configuration:tun-name}
[ue-db-config]
recipe = slapos.recipe.build
path = ${directory:home}/ue_db.cfg
slavelist = {{ slapparameter_dict['slavelist'] }}
init =
import json
slave_instance_list = json.loads(options['slavelist'].replace("'", '"'))
filtered_slave_instance_list = []
for slave_instance in slave_instance_list:
if slave_instance.get('imsi', '') != '':
filtered_slave_instance_list.append(slave_instance)
out = '\n['
for i, slave_instance in enumerate(filtered_slave_instance_list):
if i == 0:
out += '\n{'
else:
out += ", {"
out += '\n sim_algo: "' + slave_instance.get('sim_algo', 'milenage') + '","'
out += '\n imsi: "' + slave_instance.get('imsi', '') + '","'
out += '\n opc: "' + slave_instance.get('opc', '') + '","'
out += '\n amf: ' + slave_instance.get('amf', '0x9001') + ',"'
out += '\n sqn: "' + slave_instance.get('sqn', '000000000000') + '","'
out += '\n k: "' + slave_instance.get('k', '') + '","'
out += '\n impu: "' + slave_instance.get('impu', '') + '","'
out += '\n impi: "' + slave_instance.get('impi', '') + '","'
out += '\n}'
out += '\n]\n'
f = open(options['path'], 'w+')
f.write(out)
f.close()
......@@ -58,6 +58,7 @@ extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
key local_ipv4 local-ipv4-address:local-ipv4
key slavelist slap-configuration:slave-instance-list
[dynamic-template-lte-gnb-epc]
< = jinja2-template-base
......@@ -126,13 +127,4 @@ extra-context =
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
key ue_db_path ue-db-config:rendered
[ue-db-config]
recipe = slapos.recipe.template:jinja2
template = ${ue_db.jinja2.cfg:target}
filename = ue_db.cfg
extensions = jinja2.ext.do
rendered = $${buildout:directory}/$${:filename}
context =
key slave_instance_list slap-configuration:slave-instance-list
raw ue_db_template ${ue_db.jinja2.cfg:target}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment