aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/Prox_BM_L2FWD_Multiflow-2Port-1507803812868.json
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2018-07-13 16:25:39 -0400
committerMark Beierl <mark.beierl@dell.com>2018-08-10 00:30:45 +0000
commitce1cdc595a7c386cfa02fa03fb182eead3b92661 (patch)
tree458f3be14d59b7a52e32d9b351d7314503d97bb9 /dashboard/Prox_BM_L2FWD_Multiflow-2Port-1507803812868.json
parentb14feea5830bf9800ed8b589a43f87fab4dba772 (diff)
Disk Initialization and Custom Workload
Removes the deprecated nowarm and nosdd parameters from the call to StorPerf. Adds a call to initialize the disk right after the stack creation is complete so that the results from the performance run are valid and not skewed by a disk that is not operating at a consistent level of performance. Adds the jobs API v2.0 when the custom parameter 'workloads' is used instead of workload. Improves documentation and adds more info about the workload and workloads parameters. Co-Authored-By: Ameed Ashour <Ameed.Ashour.Ext@nokia.com> Change-Id: I17e96028f6a82e2c800c8f73c7be866e1cab6ad8 JIRA: YARDSTICK-1322 Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'dashboard/Prox_BM_L2FWD_Multiflow-2Port-1507803812868.json')
0 files changed, 0 insertions, 0 deletions
60 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
#!/usr/bin/env python

##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# Unittest for yardstick.benchmark.scenarios.storage.fio.Fio

from __future__ import absolute_import

import os
import unittest

import mock
from oslo_serialization import jsonutils

from yardstick.benchmark.scenarios.storage import fio


@mock.patch('yardstick.benchmark.scenarios.storage.fio.ssh')
class FioTestCase(unittest.TestCase):

    def setUp(self):
        self.ctx = {
            'host': {
                'ip': '172.16.0.137',
                'user': 'cirros',
                'key_filename': 'mykey.key'
            }
        }
        self.sample_output = {
            'read': 'fio_read_sample_output.json',
            'write': 'fio_write_sample_output.json',
            'rw': 'fio_rw_sample_output.json'
        }

    def test_fio_successful_setup(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {'options': options}
        p = fio.Fio(args, self.ctx)
        p.setup()

        mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
        self.assertIsNotNone(p.client)
        self.assertEqual(p.setup_done, True)

    def test_fio_successful_no_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {'options': options}
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['rw'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')

        p.run(result)

        expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
            '"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
            '"write_lat": 233.55}'
        expected_result = jsonutils.loads(expected_result)
        self.assertEqual(result, expected_result)

    def test_fio_successful_read_no_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': "read",
            'ramp_time': 10
        }
        args = {'options': options}
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['read'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')

        p.run(result)

        expected_result = '{"read_bw": 36113, "read_iops": 9028,' \
            '"read_lat": 108.7}'
        expected_result = jsonutils.loads(expected_result)
        self.assertEqual(result, expected_result)

    def test_fio_successful_write_no_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'write',
            'ramp_time': 10
        }
        args = {'options': options}
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['write'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')

        p.run(result)

        expected_result = '{"write_bw": 35107, "write_iops": 8776,'\
            '"write_lat": 111.74}'
        expected_result = jsonutils.loads(expected_result)
        self.assertEqual(result, expected_result)

    def test_fio_successful_lat_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {
            'options': options,
            'sla': {'write_lat': 300.1}
        }
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['rw'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')

        p.run(result)

        expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
            '"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
            '"write_lat": 233.55}'
        expected_result = jsonutils.loads(expected_result)
        self.assertEqual(result, expected_result)

    def test_fio_unsuccessful_lat_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {
            'options': options,
            'sla': {'write_lat': 200.1}
        }
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['rw'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
        self.assertRaises(AssertionError, p.run, result)

    def test_fio_successful_bw_iops_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {
            'options': options,
            'sla': {'read_iops': 20000}
        }
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['rw'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')

        p.run(result)

        expected_result = '{"read_bw": 83888, "read_iops": 20972,' \
            '"read_lat": 236.8, "write_bw": 84182, "write_iops": 21045,'\
            '"write_lat": 233.55}'
        expected_result = jsonutils.loads(expected_result)
        self.assertEqual(result, expected_result)

    def test_fio_unsuccessful_bw_iops_sla(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {
            'options': options,
            'sla': {'read_iops': 30000}
        }
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        sample_output = self._read_sample_output(self.sample_output['rw'])
        mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
        self.assertRaises(AssertionError, p.run, result)

    def test_fio_unsuccessful_script_error(self, mock_ssh):

        options = {
            'filename': '/home/ubuntu/data.raw',
            'bs': '4k',
            'rw': 'rw',
            'ramp_time': 10
        }
        args = {'options': options}
        p = fio.Fio(args, self.ctx)
        result = {}

        p.client = mock_ssh.SSH.from_node()

        mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
        self.assertRaises(RuntimeError, p.run, result)

    def _read_sample_output(self, file_name):
        curr_path = os.path.dirname(os.path.abspath(__file__))
        output = os.path.join(curr_path, file_name)
        with open(output) as f:
            sample_output = f.read()
        return sample_output


def main():
    unittest.main()


if __name__ == '__main__':
    main()