blob: e9e47f35d79fdee83cda848e77a982086f844d02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
##############################################################################
# Copyright (c) 2015 EMC 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
##############################################################################
from storperf.workloads.rr import rr
from storperf.workloads.rs import rs
from storperf.workloads.rw import rw
from storperf.workloads.wr import wr
from storperf.workloads.ws import ws
import unittest
class WorkloadSubclassTest(unittest.TestCase):
def setUp(self):
pass
def test_local_name(self):
workload = rr()
self.assertEqual(workload.fullname,
"None.rr.queue-depth.1.block-size.64k.None",
workload.fullname)
def test_remote_name(self):
workload = rw()
workload.remote_host = "192.168.0.1"
self.assertEqual(workload.fullname,
"None.rw.queue-depth.1.block-size.64k.192-168-0-1",
workload.fullname)
def test_blocksize(self):
workload = rs()
workload.options["bs"] = "4k"
self.assertEqual(workload.fullname,
"None.rs.queue-depth.1.block-size.4k.None",
workload.fullname)
def test_queue_depth(self):
workload = wr()
workload.options["iodepth"] = "8"
self.assertEqual(workload.fullname,
"None.wr.queue-depth.8.block-size.64k.None",
workload.fullname)
def test_id(self):
workload = ws()
workload.id = "workloadid"
self.assertEqual(workload.fullname,
"workloadid.ws.queue-depth.1.block-size.64k.None",
workload.fullname)
|