Commit 141ccfad authored by Łukasz Nowak's avatar Łukasz Nowak

promise/plugin: check_url_available 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 9fc5e08f
......@@ -31,6 +31,17 @@ 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', self.getConfig('result_count', '3')))
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):
"""
......@@ -116,5 +127,10 @@ class RunPromise(GenericPromise):
log("%s request to %r %s (%s)", request_type, url, result, message)
def test(self):
return self._test(
result_count=self.result_count, failure_amount=self.failure_amount)
def anomaly(self):
return self._test(result_count=3, failure_amount=3)
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