Commit 497812ca authored by Joanne Hugé's avatar Joanne Hugé

wip

parent 5b06add2
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = b22b155ff5de04225ea0c32e8108d812
md5sum = 3fb4dc8fbe1867f84f0c1795b2e94fd0
[template-ors]
filename = instance-ors.cfg
......@@ -36,7 +36,7 @@ md5sum = ab666fdfadbfc7d8a16ace38d295c883
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = ff4c05c4cf72bbce2109306d60d2aae9
md5sum = 2dda7713832be83d94522c7abb4901f9
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......@@ -78,6 +78,10 @@ md5sum = 2b08bb666c5f3ab287cdddbfdb4c9249
_update_hash_filename_ = ru/tapsplit
md5sum = 700aab566289619fb83ac6f3b085d983
[tunsplit]
_update_hash_filename_ = tunsplit
md5sum = ce0b89c2fffffad2b97edc695b45c66c
[ru_xbuildout.py]
_update_hash_filename_ = ru/xbuildout.py
md5sum = a51171f926edd315a52841c2e7eb9fb7
......@@ -96,7 +100,7 @@ md5sum = 601d6237059fa665d3f3ffb6a78ad9ca
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum = d9406c9538994459452a9c7e302cba1a
md5sum = 358e1b27fb2a45979a6166f10521ff2a
[template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg
......
......@@ -110,6 +110,49 @@ sim_list = ${sim-ip-configuration:sim-with-ip-list}
sim_list = {{ dumps(sim_slave_instance_list) }}
{%- endif %}
{#- split slapos tun interface #}
{%- set vtun_list = [] %}
[vtun]
recipe = plone.recipe.command
command = {{ netcapdo }} {{ pythonwitheggs }} {{ tunsplit }} {{ slaplte.tun }} 2
update-command = ${:command}
stop-on-error = true
{%- if testing %}
command = :
{%- endif %}
{%- for i in range(1,3) %}
{%- set tun = '%s-%d' % (slaplte.tun, i) %}
{%- do vtun_list.append(tun) %}
[vtun.{{ tun }}]
recipe = slapos.recipe.build
depends = ${vtun:recipe}
init =
import types
def readfile(path):
with open(path) as f:
return f.read()
import netaddr
# ~ import tunsplit
tunsplit = types.ModuleType('tunsplit')
exec(readfile('{{ tunsplit }}'), tunsplit.__dict__)
# simulate what tunsplit would assign to the tun
# ( tun subinterface will be created for real later at install time - when it
# is too late to update section options )
if {{ testing }}:
slapnet = netaddr.IPNetwork('{{ str(test_slapnet) }}')
else:
slapnet = tunsplit.ifnet6('{{ slaplte.tun }}')
tunnet = tunsplit.netsplit(slapnet, {{ 1+ntun }}) [{{ i }}]
options['network'] = str(tunnet)
options['gateway'] = str(tunnet[1])
options['addr'] = str(tunnet[-1])
{%- endfor %}
[monitor-httpd-conf-parameter]
httpd-include-file = {{ buildout_directory }}/etc/httpd-include-file.conf
port = ${monitor-instance-parameter:monitor-httpd-port}
......
......@@ -193,6 +193,8 @@ extra-context =
raw ims_template ${ims.jinja2.cfg:target}
raw ue_db_template ${ue_db.jinja2.cfg:target}
raw mt_call_template ${mt_call_qos.jinja2.sdp:target}
raw tunsplit ${tunsplit:target}
raw netcapdo ${netcapdo:exe}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
raw iperf3_location ${iperf3:location}
......
......@@ -147,49 +147,6 @@ init =
options['{{tap}}'] = json.dumps(tap)
{%- endfor %}
{#- split slapos tun interface #}
{%- set vtun_list = [] %}
[vtun]
recipe = plone.recipe.command
command = {{ netcapdo }} {{ pythonwitheggs }} {{ ru_tunsplit }} {{ slaplte.tun }} 2
update-command = ${:command}
stop-on-error = true
{%- if testing %}
# StandaloneSlapOS does not provide slaptun
command = :
{%- endif %}
{%- for i in range(1,3) %}
{%- set tun = '%s-%d' % (slaplte.tun, i) %}
{%- do vtun_list.append(tun) %}
[vtun.{{ tun }}]
recipe = slapos.recipe.build
depends = ${vtun:recipe}
init =
import types
def readfile(path):
with open(path) as f:
return f.read()
import netaddr
# ~ import tunsplit
tunsplit = types.ModuleType('tunsplit')
exec(readfile('{{ ru_tunsplit }}'), tunsplit.__dict__)
# simulate what tunsplit would assign to the tun
# ( tun subinterface will be created for real later at install time - when it
# is too late to update section options )
if {{ testing }}:
slapnet = netaddr.IPNetwork('{{ str(test_slapnet) }}')
else:
slapnet = tunsplit.ifnet6('{{ slaplte.tun }}')
tunnet = tunsplit.netsplit(slapnet, {{ 1+ntun }}) [{{ i }}]
options['network'] = str(tunnet)
options['gateway'] = str(tunnet[1])
options['addr'] = str(tunnet[-1])
{%- endfor %}
{#- provide CPRI-based RUs IP address via DHCP #}
{%- if ntap > 0 %}
......
......@@ -67,6 +67,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-core-network]
<= download-base
[tunsplit]
<= download-base
[template-ue]
<= download-base
......
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