Commit 2089a585 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

kvm: display url-additional in connection parameters for resilient kvm

parent 66b53066
......@@ -27,7 +27,7 @@ md5sum = 2e743132ba4e001f784791311df9ba6a
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
md5sum = e50e45c3097ed5a7115817fbc967f173
md5sum = 7de5756f59ef7d823cd8ed33e6d15230
[template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in
......
......@@ -13,6 +13,7 @@
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return} -%}
{% endif -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.app.officejs.com') -%}
{% set additional_frontend = (slapparameter_dict.get('frontend-additional-instance-guid', '').strip() != '') %}
[buildout]
eggs-directory = {{ eggs_directory }}
......@@ -66,6 +67,9 @@ return =
url ssh-public-key resilient-ssh-url notification-id ip {{ monitor_return | join(' ') }}
# KVM related parameters
# XXX: return ALL parameters (like nat rules), through jinja
{% if additional_frontend %}
url-additional
{% endif %}
backend-url url ip
{{ ' ' }}ipv6-network-info
......@@ -81,6 +85,9 @@ monitor-user = ${monitor-publish-parameters:monitor-user}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${publish-early:monitor-password}
{% endif -%}
{% if additional_frontend %}
url-additional = ${request-kvm:connection-url-additional}
{% endif %}
[kvm-frontend-url-bin]
recipe = collective.recipe.template
......
......@@ -309,6 +309,40 @@ class TestInstanceResilient(InstanceTestCase):
'takeover-kvm-1-url',
'url']))
@unittest.skipIf(not sanityCheck(), 'missing kvm_intel module')
class TestAccessResilientAdditional(InstanceTestCase):
__partition_reference__ = 'ara'
expected_partition_with_monitor_base_url_count = 1
@classmethod
def getInstanceSoftwareType(cls):
return 'kvm-resilient'
@classmethod
def getInstanceParameterDict(cls):
return {
'frontend-additional-instance-guid': 'SOMETHING'
}
def test(self):
connection_parameter_dict = self.computer_partition\
.getConnectionParameterDict()
result = requests.get(connection_parameter_dict['url'], verify=False)
self.assertEqual(
httplib.OK,
result.status_code
)
self.assertIn('<title>noVNC</title>', result.text)
result = requests.get(
connection_parameter_dict['url-additional'], verify=False)
self.assertEqual(
httplib.OK,
result.status_code
)
self.assertIn('<title>noVNC</title>', result.text)
class TestInstanceNbdServer(InstanceTestCase):
__partition_reference__ = 'ins'
instance_max_retry = 5
......
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