Commit 30d97cf5 authored by Joanne Hugé's avatar Joanne Hugé

simpleran: user can configure multiple iperf3 server

parent f651ebe0
......@@ -72,7 +72,7 @@ md5sum = f4389a92fb111447e7976e452db78607
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum = d568767018b1389a8e0acbf0bc808ef5
md5sum = 7b653b5bfd62e91d0c423ee9387ca045
[template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg
......
......@@ -16,10 +16,10 @@
"type": "boolean"
},
"iperf3": {
"default": false,
"title": "iperf3 UDP server",
"description": "Activate iperf3 UDP server",
"type": "boolean"
"default": 0,
"title": "iperf3 UDP server count",
"description": "Activate one or multiple iperf3 UDP server",
"type": "number"
},
"local_domain": {
"default": "",
......
......@@ -76,10 +76,10 @@ parts =
monitor-base
check-interface-up.py
publish-connection-information
{% if slapparameter_dict.get("iperf3", None) %}
iperf-service
iperf-listen-promise
{% endif %}
{%- for i in range(slapparameter_dict.get("iperf3", 0)) %}
iperf-service-{{ i }}
iperf-{{ i }}-listen-promise
{%- endfor %}
{% if slapparameter_dict.get("local_domain", '') %}
dnsmasq-service
{% endif %}
......@@ -202,24 +202,23 @@ wrapper-path = ${directory:bin}/mme-ifup-empty
command-line = echo Using interface
mode = 775
{% if slapparameter_dict.get("iperf3", None) %}
### iperf3
[iperf-service]
{%- for i in range(slapparameter_dict.get("iperf3", 0)) %}
[iperf-service-{{ i }}]
recipe = slapos.cookbook:wrapper
port = 5001
port = {{ 5001 + i }}
ip = ${slap-configuration:tun-ipv4-addr}
command-line = {{ iperf3_location }}/bin/iperf3 --server --interval 1 --port ${:port} --bind ${:ip}
wrapper-path = ${directory:service}/iperf3
wrapper-path = ${directory:service}/iperf3-{{ i }}
mode = 0775
pidfile = ${directory:run}/iperf3.pid
pidfile = ${directory:run}/iperf3-{{ i }}.pid
[iperf-listen-promise]
[iperf-{{ i }}-listen-promise]
<= monitor-promise-base
promise = check_socket_listening
name = iperf3-port-listening.py
config-host = ${iperf-service:ip}
config-port = ${iperf-service:port}
{% endif %}
name = iperf-{{ i }}-port-listening.py
config-host = ${iperf-service-{{ i }}:ip}
config-port = ${iperf-service-{{ i }}:port}
{% endfor %}
[config-base]
recipe = slapos.recipe.template:jinja2
......@@ -310,6 +309,12 @@ recipe = slapos.cookbook:publish.serialised
core-network-ipv6 = {{ my_ipv6 }}
core-network-ipv4 = {{ lan_ipv4 }}
core-network-mac = {{ mac }}
{%- if slapparameter_dict.get("iperf3", 0) %}
iperf3-server-ipv4 = ${iperf-service-0:ip}
{%- endif %}
{%- for i in range(1, slapparameter_dict.get("iperf3", 0) + 1) %}
iperf3-server-{{ i - 1 }}-port = ${iperf-service-{{ i - 1 }}:port}
{%- endfor %}
amarisoft-version = {{ amarisoft['version']}}
amarisoft-host-id = {{ amarisoft['lteenb_host_id'] }}
amarisoft-available-versions = {{ amarisoft['version_installed'] }}
......
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