Commit 9fc5e08f authored by Łukasz Nowak's avatar Łukasz Nowak

promise/plugin: check_command_execute configurability

Support result-count and failure-amount with the _ style.
Support anomaly and periodicity configuration.
Support result-count and failure-amount in the test.
parent f155972d
......@@ -11,8 +11,18 @@ class RunPromise(GenericPromise):
super(RunPromise, self).__init__(config)
# SR can set custom periodicity
self.setPeriodicity(float(self.getConfig('frequency', 2)))
self.result_count = int(self.getConfig('result_count', '1'))
self.failure_amount = int(self.getConfig('failure_amount', '1'))
self.result_count = int(
self.getConfig('result-count', self.getConfig('result_count', '1')))
self.failure_amount = int(
self.getConfig('failure-amount', self.getConfig('failure_amount', '1')))
if self.getConfig(
'perdiodic-only', 'false').lower() in ('true', 'yes', '1'):
self.setTestLess()
if self.getConfig(
'report-anomaly', 'true').lower() in ('false', 'no', '0'):
self.setAnomalyLess()
def sense(self):
"""
......@@ -41,5 +51,10 @@ class RunPromise(GenericPromise):
else:
self.logger.info("OK %r run with success" % (command,))
def test(self):
return self._test(
result_count=self.result_count, failure_amount=self.failure_amount)
def anomaly(self):
return self._anomaly(result_count=self.result_count, failure_amount=self.failure_amount)
return self._anomaly(
result_count=self.result_count, failure_amount=self.failure_amount)
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