Commit a9811f43 authored by Boxiang Sun's avatar Boxiang Sun

Show the failed service in the testsuit.log instead of instance.log

parent 930cfecb
...@@ -885,10 +885,6 @@ class Partition(object): ...@@ -885,10 +885,6 @@ class Partition(object):
Check all on-watch service status, Check all on-watch service status,
if any of them is not RUNNING, raise Exception and stop if any of them is not RUNNING, raise Exception and stop
""" """
print("=============Service Debug==========")
print("====================================")
print("====================================")
print("====================================")
service_list = [] service_list = []
if os.path.exists(self.service_path): if os.path.exists(self.service_path):
if os.path.isdir(self.service_path): if os.path.isdir(self.service_path):
...@@ -905,8 +901,7 @@ class Partition(object): ...@@ -905,8 +901,7 @@ class Partition(object):
if 'on-watch' in process['name'] and process['statename'] != "RUNNING": if 'on-watch' in process['name'] and process['statename'] != "RUNNING":
self.logger.info('On watch service %r is not running' % process['name']) self.logger.info('On watch service %r is not running' % process['name'])
bad_service_list.append(process['name']) bad_service_list.append(process['name'])
if len(bad_service_list) > 0: return bad_service_list
raise ChildProcessError("Some on-watch process is not running!")
def cleanupFolder(self, folder_path): def cleanupFolder(self, folder_path):
"""Delete all files and folders in a specified directory """Delete all files and folders in a specified directory
......
...@@ -1292,7 +1292,11 @@ stderr_logfile_backups=1 ...@@ -1292,7 +1292,11 @@ stderr_logfile_backups=1
if not self.force_stop: if not self.force_stop:
self._checkPromiseList(local_partition) self._checkPromiseList(local_partition)
computer_partition.started() computer_partition.started()
local_partition.checkOnWatchServiceStatus() bad_service_list = local_partition.checkOnWatchServiceStatus()
if len(bad_service_list) > 0:
raise ChildProcessError("The folling on-watch process is not running!")
for service in bad_service_list:
self.logger.info('On watch service %r is not running' % service)
self._endInstallationTransaction(computer_partition) self._endInstallationTransaction(computer_partition)
elif computer_partition_state == COMPUTER_PARTITION_STOPPED_STATE: elif computer_partition_state == COMPUTER_PARTITION_STOPPED_STATE:
try: try:
...@@ -1490,11 +1494,6 @@ stderr_logfile_backups=1 ...@@ -1490,11 +1494,6 @@ stderr_logfile_backups=1
except slapos.slap.ResourceNotReady: except slapos.slap.ResourceNotReady:
return '(not ready)' return '(not ready)'
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('I want generate an output here!!!')
self.logger.info('Finished computer partitions.') self.logger.info('Finished computer partitions.')
self.logger.info('=' * 80) self.logger.info('=' * 80)
if process_error_partition_list: if process_error_partition_list:
......
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