Commit 4b1bc639 authored by Jérome Perrin's avatar Jérome Perrin

software/theia/test: adjust test for slapos.core 1.6.15

Now that slapos-node-software service does not use --all we have to use another
approach for this test which re-installs an already installed software.

Use the slapos-node-software-all services which was made for similar use cases.
parent 243d5802
...@@ -281,6 +281,8 @@ class TestTheiaEnv(TheiaTestCase): ...@@ -281,6 +281,8 @@ class TestTheiaEnv(TheiaTestCase):
} }
def test_theia_env(self): def test_theia_env(self):
"""Make sure environment variables are the same wether we use shell or supervisor services.
"""
# The path of the env.json file expected to be generated by building the dummy software release # The path of the env.json file expected to be generated by building the dummy software release
env_json_path = os.path.join(self.computer_partition_root_path, 'srv', 'runner', 'software', 'env.json') env_json_path = os.path.join(self.computer_partition_root_path, 'srv', 'runner', 'software', 'env.json')
...@@ -315,18 +317,21 @@ class TestTheiaEnv(TheiaTestCase): ...@@ -315,18 +317,21 @@ class TestTheiaEnv(TheiaTestCase):
# Remove the env.json file to later be sure that a new one has been generated # Remove the env.json file to later be sure that a new one has been generated
os.remove(env_json_path) os.remove(env_json_path)
# Launch slapos-node-software from the embedded supervisord # Launch slapos node software service from the embedded supervisord.
# Note that we have two services, slapos-not-software and slapos-not-software-all
# The later uses --all which is what we want to use here, because the software
# is already installed and we want to install it again, this time from supervisor
embedded_run_path = os.path.join(self.computer_partition_root_path, 'srv', 'runner', 'var', 'run') embedded_run_path = os.path.join(self.computer_partition_root_path, 'srv', 'runner', 'var', 'run')
embedded_supervisord_socket_path = _getSupervisordSocketPath(embedded_run_path, self.logger) embedded_supervisord_socket_path = _getSupervisordSocketPath(embedded_run_path, self.logger)
with getSupervisorRPC(embedded_supervisord_socket_path) as embedded_supervisor: with getSupervisorRPC(embedded_supervisord_socket_path) as embedded_supervisor:
previous_stop_time = embedded_supervisor.getProcessInfo('slapos-node-software')['stop'] previous_stop_time = embedded_supervisor.getProcessInfo('slapos-node-software-all')['stop']
embedded_supervisor.startProcess('slapos-node-software') embedded_supervisor.startProcess('slapos-node-software-all')
for _retries in range(20): for _retries in range(20):
time.sleep(1) time.sleep(1)
if embedded_supervisor.getProcessInfo('slapos-node-software')['stop'] != previous_stop_time: if embedded_supervisor.getProcessInfo('slapos-node-software-all')['stop'] != previous_stop_time:
break break
else: else:
self.fail("the supervisord service 'slapos-node-software' takes too long to finish") self.fail("the supervisord service 'slapos-node-software-all' takes too long to finish")
# Get the supervisord environment # Get the supervisord environment
with open(env_json_path) as f: with open(env_json_path) as f:
......
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