Commit 59aa6791 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend/test: Provide more information in case of plugin failure

parent c9f91fbe
......@@ -364,6 +364,7 @@ class TestDataMixin(object):
self.software_path, 'bin', 'monitor.runpromise')
partition_path_list = glob.glob(os.path.join(self.instance_path, '*'))
promise_status_list = []
msg = []
for partition_path in sorted(partition_path_list):
plugin_path_list = sorted(glob.glob(
os.path.join(partition_path, 'etc', 'plugin', '*.py')
......@@ -382,12 +383,17 @@ class TestDataMixin(object):
# sanity check
if 'Checking promise %s' % plugin not in plugin_result:
plugin_status = 1
msg.append(plugin_result)
promise_status_list.append(
'%s: %s' % (
plugin_path[len(self.instance_path) + 1:],
plugin_status == 0 and 'OK' or 'ERROR'))
self.assertTestData('\n'.join(promise_status_list))
if msg:
msg = ''.join(msg)
else:
msg = None
self.assertTestData('\n'.join(promise_status_list), msg=msg)
def test_promise_run_promise(self):
partition_path_list = glob.glob(os.path.join(self.instance_path, '*'))
......
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