From 2227414bd57f4b7f5f275d915fa8f6a2aa21f8f7 Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Thu, 14 Jul 2016 16:20:44 -0400 Subject: Separation of test and source Moving the test files into their own top-level directory to keep things clean Change-Id: Ic50b881045bc59b003807923424345b335dd5c95 Signed-off-by: Mark Beierl --- tests/workload_tests/__init__.py | 8 ++++ tests/workload_tests/workload_subclass_test.py | 54 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 tests/workload_tests/__init__.py create mode 100644 tests/workload_tests/workload_subclass_test.py (limited to 'tests/workload_tests') 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) -- cgit 1.2.3-korg