Commit 9cc4c9ab authored by Joanne Hugé's avatar Joanne Hugé

simpleran: add lteenb, ltemme, lteims and lteue mock

parent b4faf71d
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = fc545fa11ca2da5cff420c72e72ae8e9 md5sum = 6d1fed5e983ecf0f3f1f88ee32dddf75
[template-ors] [template-ors]
filename = instance-ors.cfg filename = instance-ors.cfg
...@@ -28,15 +28,15 @@ md5sum = 8d6eb90fc1191c3a1b24200df2ebf4fa ...@@ -28,15 +28,15 @@ md5sum = 8d6eb90fc1191c3a1b24200df2ebf4fa
[ru_amarisoft-stats.jinja2.py] [ru_amarisoft-stats.jinja2.py]
_update_hash_filename_ = ru/amarisoft-stats.jinja2.py _update_hash_filename_ = ru/amarisoft-stats.jinja2.py
md5sum = 9075f5d5d6d453d02b4f284b7edabe41 md5sum = b492c3a520d48b9c45ea583eec435109
[ru_amarisoft-rf-info.jinja2.py] [ru_amarisoft-rf-info.jinja2.py]
_update_hash_filename_ = ru/amarisoft-rf-info.jinja2.py _update_hash_filename_ = ru/amarisoft-rf-info.jinja2.py
md5sum = a1ccf6143b7441cbe76db4d91f762037 md5sum = 35c90564058505b00a0f8e1549dbd2e3
[ru_libinstance.jinja2.cfg] [ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg _update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = babef867c5744649a7e3e6c99f390663 md5sum = eb3f43791b494c3d586e2717cdd6f660
[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
...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 825c912044fdb5c48f36d092db4170f3 md5sum = 5ff63ef0f043a198436a6b05e350a220
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
...@@ -72,11 +72,11 @@ md5sum = f4389a92fb111447e7976e452db78607 ...@@ -72,11 +72,11 @@ md5sum = f4389a92fb111447e7976e452db78607
[template-core-network] [template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg _update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum = 87a40b4ebd3baf19771e74bb78d85bcb md5sum = 7c809fb0a885fcaf7206d8b22aab9fba
[template-ue] [template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg _update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = 1686588ab92d7c9a4bd24402edd0c888 md5sum = cc06ec740fb26e86830f1fdb773c1d17
[template-obsolete] [template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg _update_hash_filename_ = instance-obsolete.jinja2.cfg
......
{%- set amarisoft_version = slapparameter_dict.setdefault("amarisoft_version", amarisoft['version']) %}
{%- set amarisoft_dir = slapparameter_dict.setdefault("amarisoft_dir", amarisoft['dir']) %}
{%- set amarisoft_path = amarisoft_dir + "/v" + amarisoft_version %}
{%- set dns_slave_instance_list = [] %} {%- set dns_slave_instance_list = [] %}
{%- set sim_slave_instance_list = [] %} {%- set sim_slave_instance_list = [] %}
{%- set fixed_ip = slapparameter_dict.get("fixed_ips", False) %} {%- set fixed_ip = slapparameter_dict.get("fixed_ips", False) %}
...@@ -148,12 +144,10 @@ output = ${directory:bin}/${:_buildout_section_name_} ...@@ -148,12 +144,10 @@ output = ${directory:bin}/${:_buildout_section_name_}
ims-log = ${directory:log}/ims-output.log ims-log = ${directory:log}/ims-output.log
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting IMS software..." && echo) >> ${:ims-log}; (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting IMS software..." && echo) >> ${:ims-log};
tail -c 1M ${:ims-log} > ${:ims-log}.tmp; tail -c 1M ${:ims-log} > ${:ims-log}.tmp;
mv ${:ims-log}.tmp ${:ims-log}; mv ${:ims-log}.tmp ${:ims-log};
{{ amarisoft_path }}/{{ amarisoft['ims_dir'] }}/lteims ${directory:etc}/ims.cfg >> ${:ims-log} 2>> ${:ims-log}; {{ amarisoft['ims_dir'] }}/lteims ${directory:etc}/ims.cfg >> ${:ims-log} 2>> ${:ims-log};
{% endif %}
### IMS ### IMS
[ims-service] [ims-service]
...@@ -169,7 +163,7 @@ hash-files = ...@@ -169,7 +163,7 @@ hash-files =
${ims-sh-wrapper:output} ${ims-sh-wrapper:output}
environment = environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
AMARISOFT_PATH={{ amarisoft_dir }}/{{ amarisoft['license_dir'] }} AMARISOFT_PATH={{ amarisoft['license_dir'] }}
[mme-sh-wrapper] [mme-sh-wrapper]
recipe = slapos.recipe.template recipe = slapos.recipe.template
...@@ -177,14 +171,12 @@ output = ${directory:bin}/${:_buildout_section_name_} ...@@ -177,14 +171,12 @@ output = ${directory:bin}/${:_buildout_section_name_}
mme-log = ${directory:log}/mme-output.log mme-log = ${directory:log}/mme-output.log
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %} sudo -n {{ amarisoft['dir'] }}/init-mme;
sudo -n {{ amarisoft_dir }}/init-mme;
rm -f ${directory:var}/lte_ue.db; rm -f ${directory:var}/lte_ue.db;
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting MME software..." && echo) >> ${:mme-log}; (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting MME software..." && echo) >> ${:mme-log};
tail -c 1M ${:mme-log} > ${:mme-log}.tmp; tail -c 1M ${:mme-log} > ${:mme-log}.tmp;
mv ${:mme-log}.tmp ${:mme-log}; mv ${:mme-log}.tmp ${:mme-log};
{{ amarisoft_path }}/{{ amarisoft['mme_dir'] }}/ltemme ${directory:etc}/mme.cfg >> ${:mme-log} 2>> ${:mme-log}; {{ amarisoft['mme_dir'] }}/ltemme ${directory:etc}/mme.cfg >> ${:mme-log} 2>> ${:mme-log};
{% endif %}
### MME ### MME
[mme-service] [mme-service]
...@@ -201,7 +193,7 @@ hash-files = ...@@ -201,7 +193,7 @@ hash-files =
${mme-sh-wrapper:output} ${mme-sh-wrapper:output}
environment = environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
AMARISOFT_PATH={{ amarisoft_dir }}/{{ amarisoft['license_dir'] }} AMARISOFT_PATH={{ amarisoft['license_dir'] }}
### EMPTY mme-ifup script ### EMPTY mme-ifup script
[mme-ifup-empty] [mme-ifup-empty]
...@@ -317,7 +309,7 @@ password = {{ slapparameter_dict['monitor-password'] | string }} ...@@ -317,7 +309,7 @@ password = {{ slapparameter_dict['monitor-password'] | string }}
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
core-network-ipv6 = {{ my_ipv6 }} core-network-ipv6 = {{ my_ipv6 }}
core-network-ipv4 = {{ lan_ipv4 }} core-network-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ amarisoft_version}} amarisoft-version = {{ amarisoft['version']}}
amarisoft-host-id = {{ amarisoft['lteenb_host_id'] }} amarisoft-host-id = {{ amarisoft['lteenb_host_id'] }}
amarisoft-available-versions = {{ amarisoft['version_installed'] }} amarisoft-available-versions = {{ amarisoft['version_installed'] }}
license-expiration = {{ amarisoft['ltemme_expiration'] }} license-expiration = {{ amarisoft['ltemme_expiration'] }}
......
# instance-enb implements eNB/gNB service. # instance-enb implements eNB/gNB service.
{%- set amarisoft_version = slapparameter_dict.setdefault("amarisoft_version", amarisoft['version']) %}
{%- set amarisoft_dir = slapparameter_dict.setdefault("amarisoft_dir", amarisoft['dir']) %}
{%- set amarisoft_path = amarisoft_dir + "/v" + amarisoft_version %}
{#- defaults for global eNB/gNB parameters. {#- defaults for global eNB/gNB parameters.
TODO automatically load enb defaults from JSON schema #} TODO automatically load enb defaults from JSON schema #}
{%- set enb_defaults = { {%- set enb_defaults = {
...@@ -106,16 +101,15 @@ enb-radio-log = ${directory:log}/enb.log ...@@ -106,16 +101,15 @@ enb-radio-log = ${directory:log}/enb.log
enb-start-date = ${directory:run}/enb-start.date enb-start-date = ${directory:run}/enb-start.date
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
# Amarisoft init scripts # Amarisoft init scripts
sudo -n {{ amarisoft_dir }}/rm-tmp-lte sudo -n {{ amarisoft['dir'] }}/rm-tmp-lte
sudo -n {{ amarisoft_dir }}/init-sdr {{ amarisoft_path }} sudo -n {{ amarisoft['dir'] }}/init-sdr {{ amarisoft['dir'] }}/v{{ amarisoft['version'] }};
sudo -n {{ amarisoft_dir }}/init-enb sudo -n {{ amarisoft['dir'] }}/init-enb
# Add useful information to enb-info log # Add useful information to enb-info log
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software...") >> ${:enb-info-log} (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software...") >> ${:enb-info-log}
(echo -n "PCB: " ; for o in t b v s ; do sudo -n {{ amarisoft['sdr_dir'] }}/get-sdr-info -$o 2> /dev/null ; echo -n " " ; done ; echo) >> ${:enb-info-log} (echo -n "PCB: " ; for o in t b v s ; do sudo -n {{ sdr['dir'] }}/get-sdr-info -$o 2> /dev/null ; echo -n " " ; done ; echo) >> ${:enb-info-log}
echo "System info: $(uname -a)" >> ${:enb-info-log} echo "System info: $(uname -a)" >> ${:enb-info-log}
({{ amarisoft_path }}/{{ amarisoft['sdr_dir'] }}/sdr_util version && echo) >> ${:enb-info-log} ({{ amarisoft['sdr_dir'] }}/sdr_util version && echo) >> ${:enb-info-log}
# Remove obsolete logs # Remove obsolete logs
rm -f ${directory:log}/enb-2024* rm -f ${directory:log}/enb-2024*
rm -f ${directory:log}/gnb* rm -f ${directory:log}/gnb*
...@@ -132,8 +126,7 @@ inline = ...@@ -132,8 +126,7 @@ inline =
tail -c 100M ${:enb-info-archive-log} > ${:enb-info-archive-log}.tmp tail -c 100M ${:enb-info-archive-log} > ${:enb-info-archive-log}.tmp
mv ${:enb-info-archive-log}.tmp ${:enb-info-archive-log} mv ${:enb-info-archive-log}.tmp ${:enb-info-archive-log}
# Launch lteenb # Launch lteenb
{{ amarisoft_path }}/{{ amarisoft['enb_dir'] }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-info-log} 2>> ${:enb-info-log} {{ amarisoft['enb_dir'] }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-info-log} 2>> ${:enb-info-log}
{% endif %}
[enb-service] [enb-service]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -147,7 +140,7 @@ hash-files = ...@@ -147,7 +140,7 @@ hash-files =
${enb-sh-wrapper:output} ${enb-sh-wrapper:output}
environment = environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH={{ amarisoft_dir }}/{{ amarisoft['license_dir'] }} AMARISOFT_PATH={{ amarisoft['license_dir'] }}
[xamari-xlog-script] [xamari-xlog-script]
recipe = slapos.recipe.template recipe = slapos.recipe.template
...@@ -352,7 +345,6 @@ name = ${:_buildout_section_name_} ...@@ -352,7 +345,6 @@ name = ${:_buildout_section_name_}
[check-baseband-latency.py] [check-baseband-latency.py]
<= macro.promise <= macro.promise
promise = check_baseband_latency promise = check_baseband_latency
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-amarisoft-stats-log = ${ru_amarisoft-stats-template:log-output} config-amarisoft-stats-log = ${ru_amarisoft-stats-template:log-output}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
config-min-rxtx-delay = {{ slapparameter_dict.get("min_rxtx_delay", 0) }} config-min-rxtx-delay = {{ slapparameter_dict.get("min_rxtx_delay", 0) }}
......
# instance-ue implements UEsim service. # instance-ue implements UEsim service.
{%- set amarisoft_version = slapparameter_dict.setdefault("amarisoft_version", amarisoft['version']) %}
{%- set amarisoft_dir = slapparameter_dict.setdefault("amarisoft_dir", amarisoft['dir']) %}
{%- set amarisoft_path = amarisoft_dir + "/v" + amarisoft_version %}
{#- defaults for global UE parameters. {#- defaults for global UE parameters.
TODO automatically load ue defaults from JSON schema #} TODO automatically load ue defaults from JSON schema #}
{%- set ue_defaults = { {%- set ue_defaults = {
...@@ -80,10 +75,9 @@ ue-radio-log = ${directory:log}/ue.log ...@@ -80,10 +75,9 @@ ue-radio-log = ${directory:log}/ue.log
ue-start-date = ${directory:run}/enb-start.date ue-start-date = ${directory:run}/enb-start.date
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %} sudo {{ amarisoft['dir'] }}/rm-tmp-lte | true;
sudo {{ amarisoft_dir }}/rm-tmp-lte | true; sudo -n {{ amarisoft['dir'] }}/init-sdr {{ amarisoft['dir'] }}/v{{ amarisoft['version'] }};
sudo -n {{ amarisoft_dir }}/init-sdr {{ amarisoft_path }}; sudo -n {{ amarisoft['dir'] }}/init-ue;
sudo -n {{ amarisoft_dir }}/init-ue;
stat ${:ue-start-date} && mv ${:ue-radio-log} ${directory:log}/ue-$(cat ${:ue-start-date}).log stat ${:ue-start-date} && mv ${:ue-radio-log} ${directory:log}/ue-$(cat ${:ue-start-date}).log
rm -f $(ls -1t ${directory:log}/ue-2* | tail -n+50) rm -f $(ls -1t ${directory:log}/ue-2* | tail -n+50)
date +"%Y-%m-%d-%T" > ${:ue-start-date} date +"%Y-%m-%d-%T" > ${:ue-start-date}
...@@ -91,10 +85,9 @@ inline = ...@@ -91,10 +85,9 @@ inline =
tail -c 1M ${:ue-log} > ${:ue-log}.tmp; tail -c 1M ${:ue-log} > ${:ue-log}.tmp;
mv ${:ue-log}.tmp ${:ue-log}; mv ${:ue-log}.tmp ${:ue-log};
{%- if ors %} {%- if ors %}
echo "power_on" | sudo -n {{ amarisoft_path }}/{{ amarisoft['ue_dir'] }}/lteue ${directory:etc}/ue.cfg >> ${:ue-log} 2>> ${:ue-log}; echo "power_on" | sudo -n {{ amarisoft['ue_dir'] }}/lteue ${directory:etc}/ue.cfg >> ${:ue-log} 2>> ${:ue-log};
{%- else %} {%- else %}
{{ amarisoft_path }}/{{ amarisoft['ue_dir'] }}/lteue ${directory:etc}/ue.cfg >> ${:ue-log} 2>> ${:ue-log}; {{ amarisoft['ue_dir'] }}/lteue ${directory:etc}/ue.cfg >> ${:ue-log} 2>> ${:ue-log};
{%- endif %}
{%- endif %} {%- endif %}
### User Equipment (UE) ### User Equipment (UE)
...@@ -110,7 +103,7 @@ hash-files = ...@@ -110,7 +103,7 @@ hash-files =
${lte-ue-sh-wrapper:output} ${lte-ue-sh-wrapper:output}
environment = environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH={{ amarisoft_dir }}/{{ amarisoft['license_dir'] }} AMARISOFT_PATH={{ amarisoft['license_dir'] }}
[config-base] [config-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
......
...@@ -82,6 +82,7 @@ init = ...@@ -82,6 +82,7 @@ init =
[sdr] [sdr]
recipe = slapos.recipe.build recipe = slapos.recipe.build
configuration = $${slap-configuration:configuration}
init = init =
# Set SDR directory # Set SDR directory
options['dir'] = options['configuration'].get('sdr_dir', '/opt/sdr') options['dir'] = options['configuration'].get('sdr_dir', '/opt/sdr')
...@@ -92,26 +93,40 @@ fixed_version = 2024-11-21.1732633257 ...@@ -92,26 +93,40 @@ fixed_version = 2024-11-21.1732633257
configuration = $${slap-configuration:configuration} configuration = $${slap-configuration:configuration}
init = init =
import os, re import os, re
mock = options['configuration'].get('lte_mock', False)
# Set Amarisoft directory # Set Amarisoft directory
options['dir'] = options['configuration'].get('amarisoft_dir', '/opt/amarisoft') options['dir'] = options['configuration'].get('amarisoft_dir', '/opt/amarisoft')
# Get Available Amarisoft versions # Get Available Amarisoft versions
options['version_installed'] = ', '.join(filter(lambda x: re.match(r"v[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{10}", x), os.listdir(options['dir']))) if mock:
version_installed = [options['fixed_version']]
else:
version_installed = list(filter(lambda x: re.match(r"v[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{10}", x), os.listdir(options['dir'])))
options['version_installed'] = ', '.join(version_installed)
# Set Amarisoft version to use # Set Amarisoft version to use
slapconf_version = options['configuration'].get('amarisoft_version', False) slapconf_version = options['configuration'].get('amarisoft_version', False)
if slapconf_version and \ if slapconf_version and \
slapconf_version in options['version_installed']: slapconf_version in version_installed:
options['version'] = slapconf_version options['version'] = slapconf_version
else: else:
options['version'] = options['fixed_version'] options['version'] = options['fixed_version']
# Set Binaries and license directories # Set Binaries and license directories
binary_dir = options['dir'] + "/v" + options['version'] binary_dir = options['dir'] + "/v" + options['version']
options['license_dir'] = options['dir'] + '/.amarisoft' options['license_dir'] = options['dir'] + '/.amarisoft'
options['sdr_dir'] = options['binary_dir'] + '/trx_sdr' options['sdr_dir'] = binary_dir + '/trx_sdr'
options['enb_dir'] = options['binary_dir'] + '/enb' options['enb_dir'] = binary_dir + '/enb'
options['mme_dir'] = options['binary_dir'] + '/mme' options['mme_dir'] = binary_dir + '/mme'
options['ims_dir'] = options['binary_dir'] + '/mme' options['ims_dir'] = binary_dir + '/mme'
options['ue_dir'] = options['binary_dir'] + '/ue' options['ue_dir'] = binary_dir + '/ue'
if options['configuration'].get('lte_mock', False):
options['enb_dir'] = '${buildout:directory}/bin'
options['mme_dir'] = '${buildout:directory}/bin'
options['ims_dir'] = '${buildout:directory}/bin'
options['ue_dir'] = '${buildout:directory}/bin'
# Get License expiration and host IDs # Get License expiration and host IDs
if mock:
options.update({'lteenb_expiration': '9999-99-99', 'ltemme_expiration': '9999-99-99'})
options.update({'lteenb_host_id': '00-00-00-00-00-00-00-00', 'ltemme_host_id': '00-00-00-00-00-00-00-00'})
else:
options.update({'lteenb_expiration': 'Unknown', 'ltemme_expiration': 'Unknown'}) options.update({'lteenb_expiration': 'Unknown', 'ltemme_expiration': 'Unknown'})
options.update({'lteenb_host_id': 'Unknown', 'ltemme_host_id': 'Unknown'}) options.update({'lteenb_host_id': 'Unknown', 'ltemme_host_id': 'Unknown'})
try: try:
...@@ -171,6 +186,7 @@ extra-context = ...@@ -171,6 +186,7 @@ extra-context =
section comp_id comp-id section comp_id comp-id
section slap_configuration slap-configuration section slap_configuration slap-configuration
section amarisoft amarisoft section amarisoft amarisoft
section sdr sdr
raw enb_template ${enb.jinja2.cfg:target} raw enb_template ${enb.jinja2.cfg:target}
raw slaplte_template ${slaplte.jinja2:target} raw slaplte_template ${slaplte.jinja2:target}
raw drb_lte_template ${drb_lte.jinja2.cfg:target} raw drb_lte_template ${drb_lte.jinja2.cfg:target}
...@@ -195,6 +211,7 @@ extensions = jinja2.ext.do ...@@ -195,6 +211,7 @@ extensions = jinja2.ext.do
extra-context = extra-context =
raw monitor_template ${monitor2-template:output} raw monitor_template ${monitor2-template:output}
section amarisoft amarisoft section amarisoft amarisoft
section sdr sdr
raw mme_template ${mme.jinja2.cfg:target} raw mme_template ${mme.jinja2.cfg:target}
raw dnsmasq_template ${dnsmasq-core-network.jinja2.cfg:target} raw dnsmasq_template ${dnsmasq-core-network.jinja2.cfg:target}
raw ims_template ${ims.jinja2.cfg:target} raw ims_template ${ims.jinja2.cfg:target}
...@@ -216,6 +233,7 @@ extensions = jinja2.ext.do ...@@ -216,6 +233,7 @@ extensions = jinja2.ext.do
extra-context = extra-context =
section slap_configuration slap-configuration section slap_configuration slap-configuration
section amarisoft amarisoft section amarisoft amarisoft
section sdr sdr
raw monitor_template ${monitor2-template:output} raw monitor_template ${monitor2-template:output}
raw ue_template ${ue.jinja2.cfg:target} raw ue_template ${ue.jinja2.cfg:target}
raw slaplte_template ${slaplte.jinja2:target} raw slaplte_template ${slaplte.jinja2:target}
......
...@@ -18,9 +18,6 @@ class enbWebSocket: ...@@ -18,9 +18,6 @@ class enbWebSocket:
handler.setFormatter(formatter) handler.setFormatter(formatter)
self.logger.addHandler(handler) self.logger.addHandler(handler)
if {{ testing }}:
return
self.ws_url = "{{ ws_url }}" self.ws_url = "{{ ws_url }}"
self.ws_password = "{{ ws_password }}" self.ws_password = "{{ ws_password }}"
self.ws = create_connection(self.ws_url) self.ws = create_connection(self.ws_url)
...@@ -37,8 +34,6 @@ class enbWebSocket: ...@@ -37,8 +34,6 @@ class enbWebSocket:
self.ws.recv() self.ws.recv()
def close(self): def close(self):
if {{ testing }}:
return
self.ws.close() self.ws.close()
def send(self, msg): def send(self, msg):
...@@ -50,12 +45,6 @@ class enbWebSocket: ...@@ -50,12 +45,6 @@ class enbWebSocket:
return r return r
def stats(self): def stats(self):
if {{ testing }}:
r = {
'message': 'rf',
'rf_info': "CPRI: x16 HW SW\n"
}
else:
self.send({ self.send({
"message": "rf", "message": "rf",
"rf_info": True "rf_info": True
......
...@@ -20,9 +20,6 @@ class enbWebSocket: ...@@ -20,9 +20,6 @@ class enbWebSocket:
handler.setFormatter(formatter) handler.setFormatter(formatter)
self.logger.addHandler(handler) self.logger.addHandler(handler)
if {{ testing }}:
return
self.ws_url = "{{ ws_url }}" self.ws_url = "{{ ws_url }}"
self.ws_password = "{{ ws_password }}" self.ws_password = "{{ ws_password }}"
self.ws = create_connection(self.ws_url) self.ws = create_connection(self.ws_url)
...@@ -39,8 +36,6 @@ class enbWebSocket: ...@@ -39,8 +36,6 @@ class enbWebSocket:
self.ws.recv() self.ws.recv()
def close(self): def close(self):
if {{ testing }}:
return
self.ws.close() self.ws.close()
def send(self, msg): def send(self, msg):
...@@ -52,15 +47,6 @@ class enbWebSocket: ...@@ -52,15 +47,6 @@ class enbWebSocket:
return r return r
def stats(self): def stats(self):
if {{ testing }}:
from random import randint
nrx = {{ iru_dict.values() | sum(attribute='_.n_antenna_ul') }}
rxv = [{'sat': 0, 'max': randint(-500,-100) / 10.0} for _ in range(nrx)]
r = {
'message': 'stats',
'samples': {'rx': rxv}
}
else:
self.send({ self.send({
"message": "stats", "message": "stats",
"samples": True, "samples": True,
......
...@@ -327,7 +327,6 @@ context = ...@@ -327,7 +327,6 @@ context =
key slapparameter_dict myslap:parameter_dict key slapparameter_dict myslap:parameter_dict
key log_file :log-output key log_file :log-output
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 ws_password ${websocket-password:passwd} raw ws_password ${websocket-password:passwd}
raw ws_url ws://{{ slapparameter_dict.com_addr }}:{{ slapparameter_dict.com_ws_port }} raw ws_url ws://{{ slapparameter_dict.com_addr }}:{{ slapparameter_dict.com_ws_port }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
...@@ -354,7 +353,6 @@ context = ...@@ -354,7 +353,6 @@ context =
raw ws_password ${websocket-password:passwd} raw ws_password ${websocket-password:passwd}
raw ws_url ws://{{ slapparameter_dict.com_addr }}:{{ slapparameter_dict.com_ws_port }} raw ws_url ws://{{ slapparameter_dict.com_addr }}:{{ slapparameter_dict.com_ws_port }}
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 python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
key iru_dict :iru_dict key iru_dict :iru_dict
iru_dict = {{ dumps(iru_dict) }} iru_dict = {{ dumps(iru_dict) }}
...@@ -461,14 +459,12 @@ cert-file = ${directory:etc}/websocket.crt ...@@ -461,14 +459,12 @@ cert-file = ${directory:etc}/websocket.crt
executable = {{ nginx_executable }} executable = {{ nginx_executable }}
wrapper = ${directory:bin}/nginx-with-ca wrapper = ${directory:bin}/nginx-with-ca
{%- if not slapparameter_dict.get("testing", False) %}
{{ part('websocket-promise') }} {{ part('websocket-promise') }}
<= monitor-promise-base <= monitor-promise-base
promise = check_socket_listening promise = check_socket_listening
name = websocket_promise.py name = websocket_promise.py
config-host = ${request-slave-frontend:connection-domain} config-host = ${request-slave-frontend:connection-domain}
config-port = 443 config-port = 443
{%- endif %}
{{ part('amarisoft-stats-service') }} {{ part('amarisoft-stats-service') }}
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
......
...@@ -49,6 +49,7 @@ parts += ...@@ -49,6 +49,7 @@ parts +=
dnsmasq dnsmasq
eggs eggs
xamari xamari
amarisoft-lte-mock-scripts
setcap-dnsmasq setcap-dnsmasq
# unimplemented parts - the http monitor and better log handling using logrotate # unimplemented parts - the http monitor and better log handling using logrotate
# apache-php # apache-php
...@@ -168,6 +169,31 @@ eggs = ...@@ -168,6 +169,31 @@ eggs =
netaddr netaddr
interpreter = pythonwitheggs interpreter = pythonwitheggs
[amarisoft-lte-mock-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/amarisoft-lte-mock.git
revision = 1.0
git-executable = ${git:location}/bin/git
[amarisoft-lte-mock]
recipe = zc.recipe.egg:develop
setup = ${amarisoft-lte-mock-repository:location}
egg = amarisoft-lte-mock
depends =
[amarisoft-lte-mock-scripts]
recipe = zc.recipe.egg
eggs =
${amarisoft-lte-mock:egg}
pcpp
PyYAML
websockets
scripts =
lteenb
ltemme
lteims
lteue
[xlte-repository] [xlte-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/kirr/xlte.git repository = https://lab.nexedi.com/kirr/xlte.git
...@@ -201,3 +227,6 @@ websocket-client = 1.4.2 ...@@ -201,3 +227,6 @@ websocket-client = 1.4.2
ncclient = 0.6.13 ncclient = 0.6.13
xmltodict = 0.13.0 xmltodict = 0.13.0
nrarfcn = 2.4.0:whl nrarfcn = 2.4.0:whl
pcpp = 1.30
PyYAML = 6.0.2
websockets = 14.1
...@@ -311,6 +311,7 @@ class ENBTestCase4(RFTestCase4): ...@@ -311,6 +311,7 @@ class ENBTestCase4(RFTestCase4):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return {'_': json.dumps({ return {'_': json.dumps({
'testing': True, 'testing': True,
'lte_mock': True,
'enb_id': '0x17', 'enb_id': '0x17',
'gnb_id': '0x23', 'gnb_id': '0x23',
'gnb_id_bits': 30, 'gnb_id_bits': 30,
...@@ -587,6 +588,7 @@ class UEsimTestCase4(RFTestCase4): ...@@ -587,6 +588,7 @@ class UEsimTestCase4(RFTestCase4):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return {'_': json.dumps({ return {'_': json.dumps({
'testing': True, 'testing': True,
'lte_mock': True,
})} })}
@classmethod @classmethod
......
...@@ -41,6 +41,7 @@ setUpModule, ORSTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -41,6 +41,7 @@ setUpModule, ORSTestCase = makeModuleSetUpAndTestCaseClass(
param_dict = { param_dict = {
'testing': True, 'testing': True,
'lte_mock': True,
'tx_gain': 17, 'tx_gain': 17,
'rx_gain': 17, 'rx_gain': 17,
'pci': 250, 'pci': 250,
...@@ -346,7 +347,11 @@ class TestGNBMonitorGadgetUrl(ORSTestCase): ...@@ -346,7 +347,11 @@ class TestGNBMonitorGadgetUrl(ORSTestCase):
class TestCoreNetworkMonitorGadgetUrl(ORSTestCase): class TestCoreNetworkMonitorGadgetUrl(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return {'_': json.dumps({'testing': True, 'slave-list': []})} return {'_': json.dumps({
'testing': True,
'lte_mock': True,
'slave-list': []
})}
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
...@@ -391,7 +396,11 @@ class TestSimCard(ORSTestCase): ...@@ -391,7 +396,11 @@ class TestSimCard(ORSTestCase):
cls.requestSlaveInstanceWithId(i) cls.requestSlaveInstanceWithId(i)
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return {'_': json.dumps({'testing': True, 'fixed_ips': cls.fixed_ips})} return {'_': json.dumps({
'testing': True,
'lte_mock': True,
'fixed_ips': cls.fixed_ips
})}
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return "core-network" return "core-network"
......
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