aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/storage/test_fio.py
diff options
context:
space:
mode:
authorhoujingwen <houjingwen@huawei.com>2015-10-19 15:37:06 +0800
committerHou Jingwen <houjingwen@huawei.com>2015-10-22 00:55:25 +0000
commite4e8688e0633ef22b2ff0ea8ba739313d5299ecc (patch)
tree0fee27d4e504b36e9eb24530cf85a0d33fd0b463 /tests/unit/benchmark/scenarios/storage/test_fio.py
parent9816c5aa786f7ec831c549b8ed4b5e8ef485da64 (diff)
Update sla check for scenarios
This patch modify the question that SLA check result is not complete. JIRA: YARDSTICK-172 Change-Id: I10438390baee92caf00dbfcdbdb833823ff8ce31 Signed-off-by: houjingwen <houjingwen@huawei.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios/storage/test_fio.py')
-rw-r--r--tests/unit/benchmark/scenarios/storage/test_fio.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/unit/benchmark/scenarios/storage/test_fio.py b/tests/unit/benchmark/scenarios/storage/test_fio.py
index 6d38e9c53..b47aed968 100644
--- a/tests/unit/benchmark/scenarios/storage/test_fio.py
+++ b/tests/unit/benchmark/scenarios/storage/test_fio.py
@@ -60,12 +60,14 @@ class FioTestCase(unittest.TestCase):
'ramp_time': 10
}
args = {'options': options}
+ result = {}
+
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['rw'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- result = p.run(args)
+ p.run(args, result)
expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
'"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
@@ -83,12 +85,14 @@ class FioTestCase(unittest.TestCase):
'ramp_time': 10
}
args = {'options': options}
+ result = {}
+
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['read'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- result = p.run(args)
+ p.run(args, result)
expected_result = '{"read_bw": 36113, "read_iops": 9028,' \
'"read_lat": 108.7}'
@@ -105,12 +109,14 @@ class FioTestCase(unittest.TestCase):
'ramp_time': 10
}
args = {'options': options}
+ result = {}
+
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['write'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- result = p.run(args)
+ p.run(args, result)
expected_result = '{"write_bw": 35107, "write_iops": 8776,'\
'"write_lat": 111.74}'
@@ -130,13 +136,14 @@ class FioTestCase(unittest.TestCase):
'options': options,
'sla': {'write_lat': 300.1}
}
+ result = {}
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['rw'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- result = p.run(args)
+ p.run(args, result)
expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
'"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
@@ -158,12 +165,13 @@ class FioTestCase(unittest.TestCase):
'options': options,
'sla': {'write_lat': 200.1}
}
+ result = {}
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['rw'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- self.assertRaises(AssertionError, p.run, args)
+ self.assertRaises(AssertionError, p.run, args, result)
def test_fio_successful_bw_iops_sla(self, mock_ssh):
@@ -178,13 +186,14 @@ class FioTestCase(unittest.TestCase):
'options': options,
'sla': {'read_iops': 20000}
}
+ result = {}
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['rw'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- result = p.run(args)
+ p.run(args, result)
expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
'"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
@@ -205,12 +214,13 @@ class FioTestCase(unittest.TestCase):
'options': options,
'sla': {'read_iops': 30000}
}
+ result = {}
p.client = mock_ssh.SSH()
sample_output = self._read_sample_output(self.sample_output['rw'])
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- self.assertRaises(AssertionError, p.run, args)
+ self.assertRaises(AssertionError, p.run, args, result)
def test_fio_unsuccessful_script_error(self, mock_ssh):
@@ -222,10 +232,12 @@ class FioTestCase(unittest.TestCase):
'ramp_time': 10
}
args = {'options': options}
+ result = {}
+
p.client = mock_ssh.SSH()
mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')
- self.assertRaises(RuntimeError, p.run, args)
+ self.assertRaises(RuntimeError, p.run, args, result)
def _read_sample_output(self, file_name):
curr_path = os.path.dirname(os.path.abspath(__file__))