Commit e97d82f2 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

switch software release recipe (from softwaretype to switch-softwaretype)

See merge request nexedi/slapos!1015
parents 36a9cd94 6159a6ab
...@@ -46,8 +46,8 @@ md5sum = ae4a0043414336a521b524d9c95f1c68 ...@@ -46,8 +46,8 @@ md5sum = ae4a0043414336a521b524d9c95f1c68
[template-pullrdiffbackup] [template-pullrdiffbackup]
filename = instance-pullrdiffbackup.cfg.in filename = instance-pullrdiffbackup.cfg.in
md5sum = c03595acae67565d4333fff07d629b61 md5sum = f2e6f30a0e8228cbfb93eaaae10fe884
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 42021b325159dff29e4bd4e33b8ff2f3 md5sum = 3df515def97f1e8a9f181514ae6ef03f
...@@ -206,7 +206,7 @@ output = $${directory:etc}/nginx.cfg ...@@ -206,7 +206,7 @@ output = $${directory:etc}/nginx.cfg
mode = 0600 mode = 0600
access_log = $${directory:log}/nginx-access.log access_log = $${directory:log}/nginx-access.log
error_log = $${directory:log}/nginx-error.log error_log = $${directory:log}/nginx-error.log
ip = $${slap-network-information:global-ipv6} ip = {{ partition_ipv6 }}
port = 9443 port = 9443
ssl_key = $${directory:ssl}/nginx.key ssl_key = $${directory:ssl}/nginx.key
ssl_csr = $${directory:ssl}/nginx.csr ssl_csr = $${directory:ssl}/nginx.csr
......
...@@ -13,32 +13,21 @@ rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filenam ...@@ -13,32 +13,21 @@ rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filenam
filename = instance-pullrdiffbackup.cfg filename = instance-pullrdiffbackup.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
context = context =
key slave_instance_list instance-parameter:slave-instance-list key slave_instance_list slap-configuration:slave-instance-list
# partition_ipv6 is the random ipv6 allocated to the local partition
key partition_ipv6 slap-configuration:ipv6-random
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
default = $${:pullrdiffbackup} RootSoftwareInstance = $${:pullrdiffbackup}
# pullrdiffbackup = ${template-pullrdiffbackup:output} pullrdiffbackup = dynamic-template-pullrdiffbackup:rendered
pullrdiffbackup = $${dynamic-template-pullrdiffbackup:rendered}
[slap-connection] [slap-configuration]
# part to migrate to new - separated words
computer-id = $${slap_connection:computer_id}
partition-id = $${slap_connection:partition_id}
server-url = $${slap_connection:server_url}
software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file}
# [slap-parameter]
# slave-instance-list = []
[instance-parameter]
# Fetches parameters defined in SlapOS Master for this instance. # Fetches parameters defined in SlapOS Master for this instance.
# Always the same. # Always the same.
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap_connection:computer_id} computer = $${slap-connection:computer-id}
partition = $${slap_connection:partition_id} partition = $${slap-connection:partition-id}
url = $${slap_connection:server_url} url = $${slap-connection:server-url}
key = $${slap_connection:key_file} key = $${slap-connection:key-file}
cert = $${slap_connection:cert_file} cert = $${slap-connection:cert-file}
...@@ -102,5 +102,3 @@ mode = 0644 ...@@ -102,5 +102,3 @@ mode = 0644
[versions] [versions]
gunicorn = 19.1.1 gunicorn = 19.1.1
plone.recipe.command = 1.1
PyRSS2Gen = 1.1
...@@ -22,8 +22,8 @@ md5sum = 87781e6bcb523bb8434888d5f984f36c ...@@ -22,8 +22,8 @@ md5sum = 87781e6bcb523bb8434888d5f984f36c
[template-validator] [template-validator]
filename = instance-validator.cfg.in filename = instance-validator.cfg.in
md5sum = e2ab378e4eb4b418a958fc90309ca443 md5sum = 9d12472bb2e337d3cc18f2cc6f235425
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 2b4d33e9ef1082dd4d6a53f55b391772 md5sum = 94fc13254c819cba33b03f30251bc469
...@@ -49,7 +49,7 @@ recipe = slapos.recipe.template ...@@ -49,7 +49,7 @@ recipe = slapos.recipe.template
url = ${template-tomcat-configuration:output} url = ${template-tomcat-configuration:output}
output = $${basedirectory:catalina_conf}/server.xml output = $${basedirectory:catalina_conf}/server.xml
mode = 0600 mode = 0600
ip = $${slap-network-information:global-ipv6} ip = {{ partition_ipv6 }}
port = 8899 port = 8899
scheme = https scheme = https
......
...@@ -6,29 +6,26 @@ eggs-directory = ${buildout:eggs-directory} ...@@ -6,29 +6,26 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
[switch-softwaretype] [dynamic-template-validator]
recipe = slapos.cookbook:softwaretype recipe = slapos.recipe.template:jinja2
default = $${:validator} template = ${template-validator:output}
validator = ${template-validator:output} rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
filename = instance-validator.cfg
[slap-connection] context =
# part to migrate to new - separated words # partition_ipv6 is the random ipv6 allocated to the local partition
computer-id = $${slap_connection:computer_id} key partition_ipv6 slap-configuration:ipv6-random
partition-id = $${slap_connection:partition_id}
server-url = $${slap_connection:server_url}
software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file}
# [slap-parameter] [switch-softwaretype]
# slave-instance-list = [] recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:validator}
validator = dynamic-template-validator:rendered
[instance-parameter] [slap-configuration]
# Fetches parameters defined in SlapOS Master for this instance. # Fetches parameters defined in SlapOS Master for this instance.
# Always the same. # Always the same.
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap_connection:computer_id} computer = $${slap-connection:computer-id}
partition = $${slap_connection:partition_id} partition = $${slap-connection:partition-id}
url = $${slap_connection:server_url} url = $${slap-connection:server-url}
key = $${slap_connection:key_file} key = $${slap-connection:key-file}
cert = $${slap_connection:cert_file} cert = $${slap-connection:cert-file}
...@@ -49,5 +49,4 @@ mode = 0644 ...@@ -49,5 +49,4 @@ mode = 0644
# 1.3.4nxd2 is invalid version string, thus pached version string is not '1.3.4nxd2+SlapOSPatched001' # 1.3.4nxd2 is invalid version string, thus pached version string is not '1.3.4nxd2+SlapOSPatched001'
# but '1.3.4nxd2-SlapOSPatched001'. # but '1.3.4nxd2-SlapOSPatched001'.
gunicorn = 19.1.1 gunicorn = 19.1.1
plone.recipe.command = 1.1
inotifyx = 0.2.2 inotifyx = 0.2.2
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = c4ac5de141ae6a64848309af03e51d88 md5sum = 0084214fae4ee1aad2c878aa393757af
[template-selenium] [template-selenium]
filename = instance-selenium.cfg.in filename = instance-selenium.cfg.in
md5sum = 973a43eb3cb4b663476987b7e64aae11 md5sum = 884196ea35de35fa9159517912441ce6
...@@ -61,7 +61,7 @@ command-line = ...@@ -61,7 +61,7 @@ command-line =
# newSessionWaitTimeout: let clients wait in the queue when no node are available # newSessionWaitTimeout: let clients wait in the queue when no node are available
# maxSession: to accept enough clients # maxSession: to accept enough clients
hostname = $${instance-parameter:ipv4-random} hostname = $${slap-configuration:ipv4-random}
port = 4444 port = 4444
base-url = http://$${:hostname}:$${:port} base-url = http://$${:hostname}:$${:port}
url = $${:base-url}/wd/hub url = $${:base-url}/wd/hub
...@@ -94,7 +94,7 @@ environment = ...@@ -94,7 +94,7 @@ environment =
XORG_LOCK_DIR=$${directory:tmp} XORG_LOCK_DIR=$${directory:tmp}
DISPLAY=$${xvfb-instance:display} DISPLAY=$${xvfb-instance:display}
FONTCONFIG_FILE=$${fontconfig-conf:rendered} FONTCONFIG_FILE=$${fontconfig-conf:rendered}
hostname = $${instance-parameter:ipv4-random} hostname = $${slap-configuration:ipv4-random}
[selenium-server-node-instance-firefox-52] [selenium-server-node-instance-firefox-52]
...@@ -164,7 +164,7 @@ template = inline: ...@@ -164,7 +164,7 @@ template = inline:
$${:path-hub} $${:path-hub}
} }
} }
ip = $${instance-parameter:ipv6-random} ip = $${slap-configuration:ipv6-random}
hostname = [$${:ip}] hostname = [$${:ip}]
port = 9443 port = 9443
path-admin = /grid/console path-admin = /grid/console
...@@ -192,7 +192,7 @@ recipe = slapos.cookbook:userinfo ...@@ -192,7 +192,7 @@ recipe = slapos.cookbook:userinfo
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 22222 minimum = 22222
maximum = 22231 maximum = 22231
ip = $${slap-network-information:global-ipv6} ip = $${slap-configuration:ipv6-random}
hostname = $${:ip} hostname = $${:ip}
[ssh-keygen-base] [ssh-keygen-base]
...@@ -263,7 +263,7 @@ recipe = plone.recipe.command ...@@ -263,7 +263,7 @@ recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
location = $${buildout:directory}/.ssh location = $${buildout:directory}/.ssh
authorized-keys-file = $${:location}/authorized_keys authorized-keys-file = $${:location}/authorized_keys
command = mkdir -p $${:location} && echo '$${instance-parameter:configuration.ssh-authorized-key}' > $${:authorized-keys-file} command = mkdir -p $${:location} && echo '$${slap-configuration:configuration.ssh-authorized-key}' > $${:authorized-keys-file}
[promises] [promises]
...@@ -371,7 +371,7 @@ ssh-fingerprint = $${ssh-key-fingerprint:fingerprint} ...@@ -371,7 +371,7 @@ ssh-fingerprint = $${ssh-key-fingerprint:fingerprint}
run-node-command = PORT=7999 bash -c 'trap '"'"'kill -TERM $SSHPID; wait $SSHPID '"'"' TERM INT; ssh -L 4444:$${selenium-server-hub-instance:hostname}:$${selenium-server-hub-instance:port} -R $PORT:127.0.0.1:$PORT -p $${sshd-service:port} $${sshd-service:username}@$${sshd-service:ip} & SSHPID=$!; java -jar selenium-server-standalone-3.14.0.jar -role node -host 127.0.0.1 -port $PORT ; wait "$SSHPID"' run-node-command = PORT=7999 bash -c 'trap '"'"'kill -TERM $SSHPID; wait $SSHPID '"'"' TERM INT; ssh -L 4444:$${selenium-server-hub-instance:hostname}:$${selenium-server-hub-instance:port} -R $PORT:127.0.0.1:$PORT -p $${sshd-service:port} $${sshd-service:username}@$${sshd-service:ip} & SSHPID=$!; java -jar selenium-server-standalone-3.14.0.jar -role node -host 127.0.0.1 -port $PORT ; wait "$SSHPID"'
[instance-parameter] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id} computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id} partition = $${slap-connection:partition-id}
......
...@@ -6,15 +6,21 @@ eggs-directory = ${buildout:eggs-directory} ...@@ -6,15 +6,21 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
[dynamic-template-selenium]
recipe = slapos.recipe.template:jinja2
template = ${template-selenium:output}
rendered = $${buildout:parts-directory}/$${:_buildout_section_name_}/$${:filename}
filename = instance-selenium.cfg
context =
key partition_ipv6 slap-configuration:ipv6-random
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
default = ${template-selenium:output} RootSoftwareInstance = $${:default}
default = dynamic-template-selenium:rendered
[slap-connection] [slap-configuration]
# part to migrate to new - separated words recipe = slapos.cookbook:slapconfiguration
computer-id = $${slap_connection:computer_id} computer = $${slap-connection:computer-id}
partition-id = $${slap_connection:partition_id} partition = $${slap-connection:partition-id}
server-url = $${slap_connection:server_url} url = $${slap-connection:server-url}
software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file}
...@@ -76,6 +76,3 @@ post-install = ...@@ -76,6 +76,3 @@ post-install =
[firefox-78] [firefox-78]
post-install = post-install =
${symlink-extra-fonts-to-firefox-fonts-dir:install} ${symlink-extra-fonts-to-firefox-fonts-dir:install}
[versions]
plone.recipe.command = 1.1
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
[instance-cfg] [instance-cfg]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 776c7de2054f78ba79382c22d85018be md5sum = b43d5e8d1fc2d0eeb54f91cefe6a5bae
[template-turnserver] [template-turnserver]
filename = instance-turnserver.cfg.jinja2.in filename = instance-turnserver.cfg.jinja2.in
md5sum = 480f69e2f21a24f52bb2eb80bfb3f8ea md5sum = 7af3318d7249e9afe22436d9fe200159
[template-insecure-turnserver] [template-insecure-turnserver]
filename = instance-insecure-turnserver.cfg.jinja2.in filename = instance-insecure-turnserver.cfg.jinja2.in
md5sum = 99c38cd20846eb3153d0392e6b81062c md5sum = 3db65c3a16eb76ab438ac3817d1a5fea
{% set part_list = [] -%} {% set part_list = [] -%}
{% set server_name = slapparameter_dict.get('server-name', 'turn.example.com') -%} {%- set parameter = dict(default_parameter_dict, **slapparameter_dict) %}
{%- set server_name = parameter['server-name'] %}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -17,9 +18,11 @@ plugins = ${:etc}/plugin ...@@ -17,9 +18,11 @@ plugins = ${:etc}/plugin
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
bytes = 8 bytes = 8
{% set turn_port = slapparameter_dict.get('port', 3478) -%} {% set turn_port = parameter['port'] -%}
{% set turn_tls_port = slapparameter_dict.get('tls-port', 5349) -%} {% set turn_tls_port = parameter['tls-port'] -%}
{% set listining_ip = slapparameter_dict.get('listening-ip', (ipv4 | list)[0]) -%} # listening-ip parameter is mandatory
{% set listening_ip = slapparameter_dict['listening-ip'] -%}
[turnserver-config] [turnserver-config]
recipe = collective.recipe.template recipe = collective.recipe.template
user = nxdturn user = nxdturn
...@@ -27,11 +30,11 @@ input = inline: ...@@ -27,11 +30,11 @@ input = inline:
listening-port={{ turn_port }} listening-port={{ turn_port }}
lt-cred-mech lt-cred-mech
realm={{ server_name }} realm={{ server_name }}
{% if slapparameter_dict.get('external-ip', '') %} {% if parameter['external-ip'] %}
external-ip={{ slapparameter_dict['external-ip'] }} external-ip={{ parameter['external-ip'] }}
{% endif %} {% endif %}
fingerprint fingerprint
listening-ip={{ listining_ip }} listening-ip={{ listening_ip }}
server-name={{ server_name }} server-name={{ server_name }}
no-stdout-log no-stdout-log
simple-log simple-log
...@@ -56,7 +59,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg ...@@ -56,7 +59,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
<= monitor-promise-base <= monitor-promise-base
module = check_socket_listening module = check_socket_listening
name = turnserver-port-listening.py name = turnserver-port-listening.py
config-host = {{ listining_ip }} config-host = {{ listening_ip }}
config-port = {{ turn_port }} config-port = {{ turn_port }}
[publish-connection-information] [publish-connection-information]
......
{% set part_list = [] -%} {%- set part_list = [] -%}
{% set server_name = slapparameter_dict.get('server-name', 'turn.example.com') -%} {%- set parameter = dict(default_parameter_dict, **slapparameter_dict) %}
{%- set server_name = parameter['server-name'] %}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -31,9 +32,9 @@ mode = {{ mode }} ...@@ -31,9 +32,9 @@ mode = {{ mode }}
{% do part_list.append(section_name) -%} {% do part_list.append(section_name) -%}
{%- endmacro %} {%- endmacro %}
{% if slapparameter_dict.get('ssl-key') and slapparameter_dict.get('ssl-crt') -%} {% if parameter['ssl-key'] and parameter['ssl-crt'] -%}
{{ simplefile('ssl-certificate', '${turnserver-ssl:certificate}', slapparameter_dict.get('ssl-crt')) }} {{ simplefile('ssl-certificate', '${turnserver-ssl:certificate}', parameter['ssl-crt']) }}
{{ simplefile('ssl-key', '${turnserver-ssl:key}', slapparameter_dict.get('ssl-key'), 600) }} {{ simplefile('ssl-key', '${turnserver-ssl:key}', parameter['ssl-key'], 600) }}
{% else -%} {% else -%}
{% do part_list.append('gen-certificate') -%} {% do part_list.append('gen-certificate') -%}
[gen-certificate] [gen-certificate]
...@@ -68,9 +69,11 @@ recipe = slapos.cookbook:zero-knowledge.read ...@@ -68,9 +69,11 @@ recipe = slapos.cookbook:zero-knowledge.read
file-path = ${gen-secret:secret-file} file-path = ${gen-secret:secret-file}
secret = secret =
{% set turn_port = slapparameter_dict.get('port', 3478) -%} {% set turn_port = parameter['port'] -%}
{% set turn_tls_port = slapparameter_dict.get('tls-port', 5349) -%} {% set turn_tls_port = parameter['tls-port'] -%}
{% set listining_ip = slapparameter_dict.get('listening-ip', (ipv4 | list)[0]) -%} # listening-ip parameter is mandatory
{% set listening_ip = slapparameter_dict['listening-ip'] -%}
[turnserver-config] [turnserver-config]
recipe = collective.recipe.template recipe = collective.recipe.template
input = inline: input = inline:
...@@ -80,9 +83,9 @@ input = inline: ...@@ -80,9 +83,9 @@ input = inline:
lt-cred-mech lt-cred-mech
use-auth-secret use-auth-secret
static-auth-secret=${read-secret:secret} static-auth-secret=${read-secret:secret}
listening-ip={{ listining_ip }} listening-ip={{ listening_ip }}
{% if slapparameter_dict.get('external-ip', '') %} {% if parameter['external-ip'] %}
external-ip={{ slapparameter_dict['external-ip'] }} external-ip={{ parameter['external-ip'] }}
{% endif %} {% endif %}
server-name={{ server_name }} server-name={{ server_name }}
realm={{ server_name }} realm={{ server_name }}
...@@ -122,14 +125,14 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg ...@@ -122,14 +125,14 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
<= monitor-promise-base <= monitor-promise-base
module = check_socket_listening module = check_socket_listening
name = turnserver-port-listening.py name = turnserver-port-listening.py
config-host = {{ listining_ip }} config-host = {{ listening_ip }}
config-port = {{ turn_port }} config-port = {{ turn_port }}
[promise-check-turnserver-tls-port] [promise-check-turnserver-tls-port]
<= monitor-promise-base <= monitor-promise-base
module = check_socket_listening module = check_socket_listening
name = turnserver-tls-port-listening.py name = turnserver-tls-port-listening.py
config-host = {{ listining_ip }} config-host = {{ listening_ip }}
config-port = {{ turn_tls_port }} config-port = {{ turn_tls_port }}
[publish-connection-information] [publish-connection-information]
......
...@@ -6,12 +6,11 @@ eggs-directory = ${buildout:eggs-directory} ...@@ -6,12 +6,11 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
default = $${dynamic-template-turnserver:rendered}
insecure = $${dynamic-template-insecure-turnserver:rendered}
RootSoftwareInstance = $${:default} RootSoftwareInstance = $${:default}
default = dynamic-template-turnserver:rendered
insecure = dynamic-template-insecure-turnserver:rendered
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration.serialised
...@@ -38,13 +37,23 @@ context = ...@@ -38,13 +37,23 @@ context =
raw template_monitor ${monitor2-template:rendered} raw template_monitor ${monitor2-template:rendered}
raw logrotate_cfg ${template-logrotate-base:rendered} raw logrotate_cfg ${template-logrotate-base:rendered}
$${:extra-context} $${:extra-context}
jsonkey default_parameter_dict :default-parameters
default-parameters =
{
"server-name" : "turn.example.com",
"ssl-key": "",
"ssl-crt": "",
"port": "3478",
"tls-port": "5349",
"external-ip": ""
# listening-ip parameter is mandatory
#"listening-ip": null,
}
[dynamic-template-turnserver-parameters] [dynamic-template-turnserver-parameters]
openssl = ${openssl:location} openssl = ${openssl:location}
turnserver-location = ${coturn:location} turnserver-location = ${coturn:location}
[dynamic-template-turnserver] [dynamic-template-turnserver]
<= jinja2-template-base <= jinja2-template-base
template = ${template-turnserver:location}/${template-turnserver:filename} template = ${template-turnserver:location}/${template-turnserver:filename}
......
...@@ -60,6 +60,12 @@ class TurnServerTestCase(InstanceTestCase): ...@@ -60,6 +60,12 @@ class TurnServerTestCase(InstanceTestCase):
class TestServices(TurnServerTestCase): class TestServices(TurnServerTestCase):
@classmethod
def getInstanceParameterDict(cls):
return {
'listening-ip': cls._ipv4_address
}
def test_process_list(self): def test_process_list(self):
hash_list = [ hash_list = [
'software_release/buildout.cfg', 'software_release/buildout.cfg',
...@@ -138,7 +144,7 @@ class TestParameters(TurnServerTestCase): ...@@ -138,7 +144,7 @@ class TestParameters(TurnServerTestCase):
'port': 3488, 'port': 3488,
'tls-port': 5369, 'tls-port': 5369,
'external-ip': '127.0.0.1', 'external-ip': '127.0.0.1',
'listening-ip': '127.0.0.1' 'listening-ip': cls._ipv4_address
} }
def test_turnserver_with_parameters(self): def test_turnserver_with_parameters(self):
...@@ -180,7 +186,7 @@ userdb=%(instance_path)s/srv/turndb ...@@ -180,7 +186,7 @@ userdb=%(instance_path)s/srv/turndb
pidfile=%(instance_path)s/var/run/turnserver.pid pidfile=%(instance_path)s/var/run/turnserver.pid
verbose""" % {'instance_path': self.partition_path, verbose""" % {'instance_path': self.partition_path,
'secret': secret, 'secret': secret,
'ipv4': '127.0.0.1', 'ipv4': self._ipv4_address,
'name': 'turn.site.com', 'name': 'turn.site.com',
'external_ip': '127.0.0.1', 'external_ip': '127.0.0.1',
'port': 3488, 'port': 3488,
...@@ -193,6 +199,12 @@ verbose""" % {'instance_path': self.partition_path, ...@@ -193,6 +199,12 @@ verbose""" % {'instance_path': self.partition_path,
class TestInsecureServices(TurnServerTestCase): class TestInsecureServices(TurnServerTestCase):
@classmethod
def getInstanceParameterDict(cls):
return {
'listening-ip': cls._ipv4_address
}
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'insecure' return 'insecure'
......
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