summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/benchmark')
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_command.py8
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_multi.py2
-rw-r--r--tests/unit/benchmark/scenarios/storage/test_storperf.py4
3 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_command.py b/tests/unit/benchmark/scenarios/availability/test_monitor_command.py
index 2ed4be731..6a9b3b157 100644
--- a/tests/unit/benchmark/scenarios/availability/test_monitor_command.py
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_command.py
@@ -30,12 +30,14 @@ class ExecuteShellTestCase(unittest.TestCase):
exitcode, output = monitor_command._execute_shell_command(cmd)
self.assertEqual(exitcode, 0)
- def test__fun_execute_shell_command_fail_cmd_exception(self,
+ @mock.patch('yardstick.benchmark.scenarios.availability.monitor.monitor_command.LOG')
+ def test__fun_execute_shell_command_fail_cmd_exception(self, mock_log,
mock_subprocess):
cmd = "env"
mock_subprocess.check_output.side_effect = RuntimeError
exitcode, output = monitor_command._execute_shell_command(cmd)
self.assertEqual(exitcode, -1)
+ mock_log.error.assert_called_once()
@mock.patch(
@@ -67,13 +69,15 @@ class MonitorOpenstackCmdTestCase(unittest.TestCase):
instance._result = {"outage_time": 0}
instance.verify_SLA()
- def test__monitor_command_monitor_func_failure(self, mock_subprocess):
+ @mock.patch('yardstick.benchmark.scenarios.availability.monitor.monitor_command.LOG')
+ def test__monitor_command_monitor_func_failure(self, mock_log, mock_subprocess):
mock_subprocess.check_output.return_value = (1, 'unittest')
instance = monitor_command.MonitorOpenstackCmd(self.config, None, {"nova-api": 10})
instance.setup()
mock_subprocess.check_output.side_effect = RuntimeError
ret = instance.monitor_func()
self.assertEqual(ret, False)
+ mock_log.error.assert_called_once()
instance._result = {"outage_time": 10}
instance.verify_SLA()
diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py b/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
index f8d12bd29..b59ec6cf1 100644
--- a/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
@@ -36,7 +36,7 @@ class MultiMonitorServiceTestCase(unittest.TestCase):
'key': 'service-status',
'monitor_key': 'service-status',
'host': 'node1',
- 'monitor_time': 3,
+ 'monitor_time': 0.1,
'parameter': {'serviceName': 'haproxy'},
'sla': {'max_outage_time': 1}
}
diff --git a/tests/unit/benchmark/scenarios/storage/test_storperf.py b/tests/unit/benchmark/scenarios/storage/test_storperf.py
index 00054d531..7b16bb37d 100644
--- a/tests/unit/benchmark/scenarios/storage/test_storperf.py
+++ b/tests/unit/benchmark/scenarios/storage/test_storperf.py
@@ -130,7 +130,7 @@ class StorPerfTestCase(unittest.TestCase):
"queue_depths": 4,
"workload": "rs",
"StorPerf_ip": "192.168.23.2",
- "query_interval": 10,
+ "query_interval": 0,
"timeout": 60
}
@@ -160,7 +160,7 @@ class StorPerfTestCase(unittest.TestCase):
"queue_depths": 4,
"workload": "rs",
"StorPerf_ip": "192.168.23.2",
- "query_interval": 10,
+ "query_interval": 0,
"timeout": 60
}