Commit 412a2ac8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a482fd1e
...@@ -28,7 +28,7 @@ md5sum = 8c044b28682940fbca62657c16613157 ...@@ -28,7 +28,7 @@ md5sum = 8c044b28682940fbca62657c16613157
[ru_libinstance.jinja2.cfg] [ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg _update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = 031805301916a7d17a6a8fb31914cbea md5sum = 202c7efcb4d2387c0e542aed4aa1f2cf
[ru_sdr_libinstance.jinja2.cfg] [ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg _update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
...@@ -80,7 +80,7 @@ md5sum = 2b8b57c5771b2a2203c0e7767e629e55 ...@@ -80,7 +80,7 @@ md5sum = 2b8b57c5771b2a2203c0e7767e629e55
[ru_xbuildout.py] [ru_xbuildout.py]
_update_hash_filename_ = ru/xbuildout.py _update_hash_filename_ = ru/xbuildout.py
md5sum = b97ec63d577f78d635d8995e236776fc md5sum = b9aa7356ebccfb1e9d2324106ad88485
[ru_capdo.c] [ru_capdo.c]
_update_hash_filename_ = ru/capdo.c _update_hash_filename_ = ru/capdo.c
...@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 143f9b0e9866d37e6527e89f74b4ef1c md5sum = fe0ecccc3be23a8fc5cf85d2278b6e8c
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
# instance-enb implements eNB/gNB service. # instance-enb implements eNB/gNB service.
{%- set Q = xbuildout.quote %}
[buildout] [buildout]
parts = parts =
...@@ -200,14 +201,18 @@ url = ${enb-config-dl:target} ...@@ -200,14 +201,18 @@ url = ${enb-config-dl:target}
url = {{ enb_template }} url = {{ enb_template }}
{% endif %} {% endif %}
output = ${directory:etc}/enb.cfg output = ${directory:etc}/enb.cfg
extra-context =
json iru_dict {{ rulib.iru_dict | tojson }}
json icell_dict {{ rulib.icell_dict | tojson }}
json ipeer_dict {{ ipeer_dict | tojson }}
json ipeercell_dict {{ ipeercell_dict | tojson }}
import json_module json
import-list = import-list =
rawfile slaplte.jinja2 {{ slaplte_template }} rawfile slaplte.jinja2 {{ slaplte_template }}
extra-context =
import json_module json
jsonkey iru_dict :jiru_dict
jsonkey icell_dict :jicell_dict
jsonkey ipeer_dict :jipeer_dict
jsonkey ipeercell_dict :jipeercell_dict
jiru_dict = {{ Q(rulib.iru_dict | tojson) }}
jicell_dict = {{ Q(rulib.icell_dict | tojson) }}
jipeer_dict = {{ Q(ipeer_dict | tojson) }}
jipeercell_dict = {{ Q(ipeercell_dict | tojson) }}
[publish-connection-information] [publish-connection-information]
...@@ -221,8 +226,8 @@ enb-ipv4 = {{ lan_ipv4 }} ...@@ -221,8 +226,8 @@ enb-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ lte_version }} amarisoft-version = {{ lte_version }}
license-expiration = {{ lte_expiration }} license-expiration = {{ lte_expiration }}
monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
ru-list = {{ rulib.iru_dict.keys() | sort | join(', ') }} ru-list = {{ Q(rulib.iru_dict.keys() | sort | tojson) }}
cell-list = {{ rulib.icell_dict.keys() | sort | join(', ') }} cell-list = {{ Q(rulib.icell_dict.keys() | sort | tojson) }}
# TODO peer-list peer-cell-list # TODO peer-list peer-cell-list
peer-list = XXX peer-list = XXX
peer-cell-list = XXX peer-cell-list = XXX
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
{%- set testing = slapparameter_dict.get("testing", False) %} {%- set testing = slapparameter_dict.get("testing", False) %}
{#- B(name) returns buildout-encoded form of name #} {#- B(name) returns buildout-encoded form of name #}
{#- XXX Q #}
{%- set B = xbuildout.encode %} {%- set B = xbuildout.encode %}
{#- part emits new buildout section and registers it into buildout.parts #} {#- part emits new buildout section and registers it into buildout.parts #}
...@@ -153,7 +154,8 @@ context = ...@@ -153,7 +154,8 @@ context =
import netaddr netaddr import netaddr netaddr
section directory directory section directory directory
section vtap_jdict vtap_jdict section vtap_jdict vtap_jdict
json iru_dict {{ iru_dict | tojson }} jsonkey iru_dict :jiru_dict
jiru_dict = {{ Q(iru_dict | tojson) }}
{{ part('dnsmasq-service') }} {{ part('dnsmasq-service') }}
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -185,7 +187,7 @@ hash-files = ...@@ -185,7 +187,7 @@ hash-files =
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
# {{ ru_ref }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }}) # {{ Q(ru_ref) }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
{%- if ru.ru_link_type == 'sdr' %} {%- if ru.ru_link_type == 'sdr' %}
{%- for (i, n) in enumerate(ru.sdr_dev_list) %} {%- for (i, n) in enumerate(ru.sdr_dev_list) %}
{{ promise('%s-sdr-busy%s' % (ru_ref, '-%d' % (i+1) if i > 0 else '')) }} {{ promise('%s-sdr-busy%s' % (ru_ref, '-%d' % (i+1) if i > 0 else '')) }}
...@@ -229,13 +231,13 @@ config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }} ...@@ -229,13 +231,13 @@ config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }}
{#- publish information about RU #} {#- publish information about RU #}
{{ part('publish-%s' % ru_ref) }} {{ part('publish-%s' % ru_ref) }}
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ iru.slave_reference }} -slave-reference = {{ Q(iru.slave_reference) }}
enb = {{ root }} {{ slap_configuration['slap-software-type'] }} = {{ Q(root) }}
{%- set iru_icell_ref_list = [] %} {%- set iru_icell_ref_list = [] %}
{%- for icell in iru_icell_list %} {%- for icell in iru_icell_list %}
{%- do iru_icell_ref_list.append(J(jref_of_shared(icell))) %} {%- do iru_icell_ref_list.append(J(jref_of_shared(icell))) %}
{%- endfor %} {%- endfor %}
cell-list = {{ iru_icell_ref_list | join(', ') }} cell-list = {{ Q(iru_icell_ref_list | tojson) }}
{%- if ru.ru_link_type == 'cpri' %} {%- if ru.ru_link_type == 'cpri' %}
ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway} ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{%- endif %} {%- endif %}
...@@ -255,30 +257,38 @@ ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway} ...@@ -255,30 +257,38 @@ ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{{ part('drb-config-%s' % cell_ref) }} {{ part('drb-config-%s' % cell_ref) }}
<= config-base <= config-base
url = {{ {'lte': drb_lte_template, 'nr': drb_nr_template} [cell.cell_type] }} url = {{ {'lte': drb_lte_template, 'nr': drb_nr_template} [cell.cell_type] }}
output = ${directory:etc}/{{cell_ref}}-drb.cfg output = ${directory:etc}/{{B(cell_ref)}}-drb.cfg
extra-context = extra-context =
json cell_ref {{ cell_ref | tojson }} jsonkey cell_ref :jcell_ref
json cell {{ cell | tojson }} jsonkey cell :jcell
json ru_ref {{ ru_ref | tojson }} jsonkey ru_ref :jru_ref
json ru {{ ru | tojson }} jsonkey ru :jru
jcell_ref = {{ Q(cell_ref | tojson) }}
jcell = {{ Q(cell | tojson) }}
jru_ref = {{ Q(ru_ref | tojson) }}
jru = {{ Q(ru | tojson) }}
{{ part('sib23-config-%s' % cell_ref) }} {{ part('sib23-config-%s' % cell_ref) }}
<= config-base <= config-base
url = {{ sib23_template }} url = {{ sib23_template }}
output = ${directory:etc}/{{cell_ref}}-sib23.asn output = ${directory:etc}/{{B(cell_ref)}}-sib23.asn
extra-context = extra-context =
json cell_ref {{ cell_ref | tojson }} jsonkey cell_ref :jcell_ref
json cell {{ cell | tojson }} jsonkey cell :jcell
json ru_ref {{ ru_ref | tojson }} jsonkey ru_ref :jru_ref
json ru {{ ru | tojson }} jsonkey ru :jru
jcell_ref = {{ Q(cell_ref | tojson) }}
jcell = {{ Q(cell | tojson) }}
jru_ref = {{ Q(ru_ref | tojson) }}
jru = {{ Q(ru | tojson) }}
{%- endif %} {%- endif %}
{#- publish information about the cell #} {#- publish information about the cell #}
{{ part('publish-%s' % cell_ref) }} {{ part('publish-%s' % cell_ref) }}
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ icell.slave_reference }} -slave-reference = {{ Q(icell.slave_reference) }}
enb = {{ root }} {{ slap_configuration['slap-software-type'] }} = {{ Q(root) }}
ru = {{ ru_ref }} ru = {{ Q(ru_ref) }}
# XXX enb -> ue in case of uesim # XXX enb -> ue in case of uesim
# XXX +error # XXX +error
...@@ -321,7 +331,8 @@ context = ...@@ -321,7 +331,8 @@ context =
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }} raw testing {{ testing }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
json iru_dict {{ iru_dict | tojson }} jsonkey iru_dict :jiru_dict
jiru_dict = {{ Q(iru_dict | tojson) }}
mode = 0775 mode = 0775
url = {{ ru_amarisoft_stats_template }} url = {{ ru_amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py output = ${directory:bin}/amarisoft-stats.py
......
...@@ -87,7 +87,7 @@ def encode(s: str) -> str: ...@@ -87,7 +87,7 @@ def encode(s: str) -> str:
# decode provides reverse operation for encode. # decode provides reverse operation for encode.
def decode(s: str) -> str | ValueError: def decode(s: str): # -> str | ValueError
try: try:
return _decode(s) return _decode(s)
except Exception as e: except Exception as e:
...@@ -131,10 +131,13 @@ def _decode(s): ...@@ -131,10 +131,13 @@ def _decode(s):
# quote converts string s into quoted form with all buildout control characters escaped... XXX # quote converts string s into quoted form with all buildout control characters escaped... XXX
# XXX -> pyquote? # XXX -> pyquote?
def quote(s: str) -> str: def quote(s: str) -> str:
r = repr(s) assert isinstance(s, str), type(s)
for c in '$[]{}\n': r = str.__repr__(s) # both str and markupsafe.Markup go as regular str
for c in '$[]\n':
r = r.replace(c, r'\x%02x' % ord(c)) r = r.replace(c, r'\x%02x' % ord(c))
return r if r[1:-1] == s:
return s # original string
return '!py!' + r
# ---------------------------------------- # ----------------------------------------
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
export SLAPOS_TEST_DEBUG=1 export SLAPOS_TEST_DEBUG=1
export SLAPOS_TEST_VERBOSE=1 export SLAPOS_TEST_VERBOSE=1
export SLAPOS_TEST_SKIP_SOFTWARE_CHECK=1 export SLAPOS_TEST_SKIP_SOFTWARE_CHECK=1
export SLAPOS_TEST_SKIP_SOFTWARE_REBUILD=1 export SLAPOS_TEST_SKIP_SOFTWARE_REBUILD=0
rm -rf snapshot rm -rf snapshot
mkdir snapshot mkdir snapshot
......
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