Commit 1804e3c3 authored by Sebastien Robin's avatar Sebastien Robin Committed by Julien Muchembled

make runComputerPartition reporting errors to the master

parent b85c7f25
......@@ -76,9 +76,15 @@ class SlapOSControler(object):
partition_reference='testing partition',
partition_parameter_kw=config['instance_dict'])
slapgrid = subprocess.Popen([config['slapgrid_partition_binary'],
config['slapos_config'], '-c', '-v'], close_fds=True, preexec_fn=os.setsid)
config['slapos_config'], '-c', '-v'],
stdout=stdout, stderr=stderr,
close_fds=True, preexec_fn=os.setsid)
process_group_pid_set.add(slapgrid.pid)
slapgrid.wait()
process_group_pid_set.remove(slapgrid.pid)
if slapgrid.returncode != 0:
raise ValueError('Slapgrid instance failed')
status_dict = {'status_code':slapgrid.returncode,
'stdout':stdout.read(),
'stderr':stderr.read()}
stdout.close()
stderr.close()
return status_dict
\ No newline at end of file
......@@ -178,25 +178,25 @@ branch = %(branch)s
revision=repository_revision.split('-')[1])
updater.checkout()
# Now prepare the installation of SlapOS
# Now prepare the installation of SlapOS and create instance
slapos_controler = SlapOSControler(config,
process_group_pid_set=process_group_pid_set)
stdout, stderr = getInputOutputFileList(config, "runSoftwareRelease")
status_dict = slapos_controler.runSoftwareRelease(config,
for method_name in ("runSoftwareRelease", "runComputerPartition"):
stdout, stderr = getInputOutputFileList(config, method_name)
slapos_method = getattr(slapos_controler, method_name)
status_dict = slapos_method(config,
environment=config['environment'],
process_group_pid_set=process_group_pid_set,
stdout=stdout, stderr=stderr
)
if status_dict['status_code'] != 0:
break
if status_dict['status_code'] != 0:
safeRpcCall(master.reportTaskFailure,
test_result_path, status_dict, config['test_node_title'])
retry_software = True
continue
# create instances, it should take some seconds only
slapos_controler.runComputerPartition(config,
process_group_pid_set=process_group_pid_set)
partition_path = os.path.join(config['instance_root'],
config['partition_reference'])
run_test_suite_path = os.path.join(partition_path, 'bin',
......
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