aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2019-01-22 03:34:30 +0000
committerrexlee8776 <limingjiang@huawei.com>2019-01-22 03:34:30 +0000
commit39d89761aca4aaf724010a9f8cac73725b798b33 (patch)
treeeda0f16c59a40733346bd5dd420daf26d6c02693 /yardstick/tests/unit/benchmark
parentfa6509b1bde3d7c2fecad3ffab5a050a27346dae (diff)
[dovetail] split the sla check results into process recovery and service
recovery for HA tcs make sla check for process recovery optional: only check when sla is set. JIRA: YARDSTICK-1512 Change-Id: I717d39614a1af2ee9e62dec3b8a32d7d611f557e Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'yardstick/tests/unit/benchmark')
-rw-r--r--yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py17
-rw-r--r--yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_process.py16
2 files changed, 33 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py b/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
index e9c680257..dc3a4b99a 100644
--- a/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
+++ b/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
@@ -63,3 +63,20 @@ class MultiMonitorServiceTestCase(unittest.TestCase):
ins.start_monitor()
ins.wait_monitor()
ins.verify_SLA()
+
+ def test__monitor_multi_no_sla(self, mock_open, mock_ssh):
+ monitor_cfg = {
+ 'monitor_type': 'general-monitor',
+ 'monitor_number': 3,
+ 'key': 'service-status',
+ 'monitor_key': 'service-status',
+ 'host': 'node1',
+ 'monitor_time': 0.1,
+ 'parameter': {'serviceName': 'haproxy'}
+ }
+ ins = monitor_multi.MultiMonitor(
+ monitor_cfg, self.context, {"nova-api": 10})
+ mock_ssh.SSH.from_node().execute.return_value = (0, "running", '')
+ ins.start_monitor()
+ ins.wait_monitor()
+ self.assertTrue(ins.verify_SLA())
diff --git a/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_process.py b/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_process.py
index a6d2ca398..8c73bf221 100644
--- a/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_process.py
+++ b/yardstick/tests/unit/benchmark/scenarios/availability/test_monitor_process.py
@@ -55,3 +55,19 @@ class MonitorProcessTestCase(unittest.TestCase):
ins.monitor_func()
ins._result = {"outage_time": 10}
ins.verify_SLA()
+
+ def test__monitor_process_no_sla(self, mock_ssh):
+
+ monitor_cfg = {
+ 'monitor_type': 'process',
+ 'process_name': 'nova-api',
+ 'host': "node1",
+ 'monitor_time': 1,
+ }
+ ins = monitor_process.MonitorProcess(monitor_cfg, self.context, {"nova-api": 10})
+
+ mock_ssh.SSH.from_node().execute.return_value = (0, "0", '')
+ ins.setup()
+ ins.monitor_func()
+ ins._result = {"outage_time": 10}
+ self.assertTrue(ins.verify_SLA())