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

software/[theia, slaprunner]: Enable hateoas support

See merge request !977
parents 8eab718f ab285b26
Pipeline #15317 failed with stage
in 0 seconds
...@@ -50,7 +50,7 @@ md5sum = 7a2f5e25a818cb29964666ada7852a5c ...@@ -50,7 +50,7 @@ md5sum = 7a2f5e25a818cb29964666ada7852a5c
[template-slapos-cfg] [template-slapos-cfg]
filename = template/slapos.cfg.in filename = template/slapos.cfg.in
md5sum = 3b228b26a170f3c07c50a0f2ae056daf md5sum = 03322b8a0f42ea579d35981211359190
[template-slapformat-definition.cfg] [template-slapformat-definition.cfg]
filename = template/slapformat-definition.cfg.in filename = template/slapformat-definition.cfg.in
......
...@@ -13,6 +13,7 @@ shared_part_list = ...@@ -13,6 +13,7 @@ shared_part_list =
{%- endfor %} {%- endfor %}
{{ slaprunner['shared_root'] }} {{ slaprunner['shared_root'] }}
master_url = http://{{ slaprunner['ipv4'] }}:{{ slaprunner['proxy_port'] }} master_url = http://{{ slaprunner['ipv4'] }}:{{ slaprunner['proxy_port'] }}
master_rest_url = http://{{ slaprunner['ipv4'] }}:{{ slaprunner['proxy_port'] }}/hateoas
computer_id = slaprunner computer_id = slaprunner
maximal_delay = 0 maximal_delay = 0
root_check = {{ slaprunner['root_check'] }} root_check = {{ slaprunner['root_check'] }}
......
...@@ -53,10 +53,6 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -53,10 +53,6 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.join(os.path.dirname(__file__), '..', os.path.join(os.path.dirname(__file__), '..',
'software%s.cfg' % ("-py3" if six.PY3 else "")))) 'software%s.cfg' % ("-py3" if six.PY3 else ""))))
class SlaprunnerTestCase(SlapOSInstanceTestCase):
# Slaprunner uses unix sockets, so it needs short paths.
__partition_reference__ = 's'
class SlaprunnerTestCase(SlapOSInstanceTestCase): class SlaprunnerTestCase(SlapOSInstanceTestCase):
# Slaprunner uses unix sockets, so it needs short paths. # Slaprunner uses unix sockets, so it needs short paths.
__partition_reference__ = 's' __partition_reference__ = 's'
...@@ -423,14 +419,14 @@ class TestSlapOS(SlaprunnerTestCase): ...@@ -423,14 +419,14 @@ class TestSlapOS(SlaprunnerTestCase):
def test_slapos_command(self): def test_slapos_command(self):
# in ~/bin/slapos there is a wrapper setting configuration to use slapos from # in ~/bin/slapos there is a wrapper setting configuration to use slapos from
# the web runner. # the web runner.
proxy_show_output = subprocess.check_output( slapos = os.path.join(self.computer_partition_root_path, 'bin', 'slapos')
( # ensure the node is formatted
os.path.join(self.computer_partition_root_path, 'bin', 'slapos'), subprocess.check_call((slapos, 'node', 'format', '--now'), env={})
'proxy', proxy_show_output = subprocess.check_output((slapos, 'proxy', 'show'), env={})
'show',
),
env={})
self.assertIn(b'slaprunner', proxy_show_output) self.assertIn(b'slaprunner', proxy_show_output)
# check hateoas cli support
computer_list_output = subprocess.check_output((slapos, 'computer', 'list'), env={})
self.assertIn(b'slaprunner', computer_list_output)
def test_shared_part_list(self): def test_shared_part_list(self):
# this slapos used shared_part_list # this slapos used shared_part_list
......
...@@ -97,6 +97,7 @@ initialization = ...@@ -97,6 +97,7 @@ initialization =
software_root="%s/software" % args.base_directory, software_root="%s/software" % args.base_directory,
instance_root="%s/instance" % args.base_directory, instance_root="%s/instance" % args.base_directory,
partition_forward_configuration=partition_forward_configuration, partition_forward_configuration=partition_forward_configuration,
slapos_bin="${buildout:bin-directory}/slapos",
) )
standalone.start() standalone.start()
partition_count = 20 partition_count = 20
......
...@@ -187,6 +187,13 @@ class TestTheia(TheiaTestCase): ...@@ -187,6 +187,13 @@ class TestTheia(TheiaTestCase):
) )
self.assertTrue(os.path.exists(script_path)) self.assertTrue(os.path.exists(script_path))
def test_slapos_cli(self):
slapos = self._getSlapos()
proxy_show_output = subprocess.check_output((slapos, 'proxy', 'show'))
self.assertIn('slaprunner', proxy_show_output)
computer_list_output = subprocess.check_output((slapos, 'computer', 'list'))
self.assertIn('slaprunner', computer_list_output)
class TestTheiaEmbeddedSlapOSShutdown(TheiaTestCase): class TestTheiaEmbeddedSlapOSShutdown(TheiaTestCase):
def test_stopping_instance_stops_embedded_slapos(self): def test_stopping_instance_stops_embedded_slapos(self):
......
...@@ -208,7 +208,7 @@ setuptools-dso = 1.7 ...@@ -208,7 +208,7 @@ setuptools-dso = 1.7
rubygemsrecipe = 0.3.0 rubygemsrecipe = 0.3.0
six = 1.12.0 six = 1.12.0
slapos.cookbook = 1.0.184 slapos.cookbook = 1.0.184
slapos.core = 1.6.9 slapos.core = 1.6.12
slapos.extension.strip = 0.4 slapos.extension.strip = 0.4
slapos.extension.shared = 1.0 slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.20 slapos.libnetworkcache = 0.20
......
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