diff options
Diffstat (limited to 'tests/workload_tests')
-rw-r--r-- | tests/workload_tests/__init__.py | 8 | ||||
-rw-r--r-- | tests/workload_tests/workload_subclass_test.py | 54 |
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/workload_tests/__init__.py b/tests/workload_tests/__init__.py new file mode 100644 index 0000000..73334c7 --- /dev/null +++ b/tests/workload_tests/__init__.py @@ -0,0 +1,8 @@ +############################################################################## +# 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 +############################################################################## diff --git a/tests/workload_tests/workload_subclass_test.py b/tests/workload_tests/workload_subclass_test.py new file mode 100644 index 0000000..e9e47f3 --- /dev/null +++ b/tests/workload_tests/workload_subclass_test.py @@ -0,0 +1,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) |