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