summaryrefslogtreecommitdiffstats
path: root/storperf/tests
diff options
context:
space:
mode:
authorMark Beierl <mark.beierl@emc.com>2016-05-04 22:53:07 -0400
committerMark Beierl <mark.beierl@emc.com>2016-05-05 14:58:39 -0400
commit05e863781ce6746fabec176d1fc5f7454f2cdd73 (patch)
tree0ff7f2aa9e55b33c3f95c0521bbd3991a9e4e2c0 /storperf/tests
parent1e0544d70dabed4f33e0624cb4a7cde4c8c6b691 (diff)
Add Stats report and Swagger UI
Add Swagger web ui at /swagger Add ability to fetch read/write latency status via ReST ui Can now delete where stack was removed from OpenStack but not from the storperf DB Change to use Floating IPs instead of private IP Fix delete bug where there was no dependency on resources in the resource group. JIRA: STORPERF-19 JIRA: STORPERF-20 Change-Id: I0a4b3386789c38d6745906ba896b8ff851dc122f Signed-off-by: Mark Beierl <mark.beierl@emc.com>
Diffstat (limited to 'storperf/tests')
-rw-r--r--storperf/tests/__init__.py8
-rw-r--r--storperf/tests/carbon_tests/emitter_test.py4
-rw-r--r--storperf/tests/carbon_tests/json_to_carbon_test.py31
-rw-r--r--storperf/tests/db_tests/__init__.py8
-rw-r--r--storperf/tests/db_tests/graphite_db_test.py47
-rw-r--r--storperf/tests/storperf_master_test.py4
-rw-r--r--storperf/tests/workload_tests/__init__.py8
-rw-r--r--storperf/tests/workload_tests/workload_subclass_test.py12
8 files changed, 96 insertions, 26 deletions
diff --git a/storperf/tests/__init__.py b/storperf/tests/__init__.py
new file mode 100644
index 0000000..73334c7
--- /dev/null
+++ b/storperf/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/storperf/tests/carbon_tests/emitter_test.py b/storperf/tests/carbon_tests/emitter_test.py
index f3ff57e..fe19ed2 100644
--- a/storperf/tests/carbon_tests/emitter_test.py
+++ b/storperf/tests/carbon_tests/emitter_test.py
@@ -44,9 +44,9 @@ class CarbonMetricTransmitterTest(unittest.TestCase):
def test_transmit_metrics(self):
- testconv = converter.JSONToCarbon()
+ testconv = converter.Converter()
json_object = json.loads("""{"timestamp" : "12345", "key":"value" }""")
- result = testconv.convert_to_dictionary(json_object, "host.run-name")
+ result = testconv.convert_json_to_flat(json_object, "host.run-name")
emitter = CarbonMetricTransmitter()
emitter.carbon_port = self.listen_port
diff --git a/storperf/tests/carbon_tests/json_to_carbon_test.py b/storperf/tests/carbon_tests/json_to_carbon_test.py
index d309b48..523ff77 100644
--- a/storperf/tests/carbon_tests/json_to_carbon_test.py
+++ b/storperf/tests/carbon_tests/json_to_carbon_test.py
@@ -7,7 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from storperf.carbon.converter import JSONToCarbon
+from storperf.carbon.converter import Converter
import json
import unittest
@@ -58,45 +58,45 @@ class JSONToCarbonTest(unittest.TestCase):
pass
def test_to_string(self):
- testconv = JSONToCarbon()
+ testconv = Converter()
json_object = json.loads(self.simple_fio_json)
- result = testconv.convert_to_dictionary(json_object, "host.run-name")
+ result = testconv.convert_json_to_flat(json_object, "host.run-name")
self.assertEqual("7116", result[
"host.run-name.jobs.1.read.io_bytes"],
result["host.run-name.jobs.1.read.io_bytes"])
def test_single_text_element_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.single_json_text_element))
self.assertEqual("value", result["key"], result["key"])
def test_single_numeric_element_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.single_json_numeric_element))
self.assertEqual("123", result["key"], result["key"])
def test_single_text_key_space_element_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.single_json_key_with_spaces))
self.assertEqual(
"value", result["key_with_spaces"], result["key_with_spaces"])
def test_single_text_value_space_element_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.single_json_value_with_spaces))
self.assertEqual("value_with_spaces", result["key"], result["key"])
def test_map_name_with_space_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.json_map_name_with_spaces))
self.assertEqual(
@@ -104,14 +104,13 @@ class JSONToCarbonTest(unittest.TestCase):
result["map_with_spaces.key"])
def test_list_name_with_space_no_prefix(self):
- testconv = JSONToCarbon()
- result = testconv.convert_to_dictionary(
+ testconv = Converter()
+ result = testconv.convert_json_to_flat(
json.loads(self.json_list_name_with_spaces))
self.assertEqual(
"value", result["list_with_spaces.1.key"],
result["list_with_spaces.1.key"])
-
if __name__ == '__main__':
unittest.main()
diff --git a/storperf/tests/db_tests/__init__.py b/storperf/tests/db_tests/__init__.py
new file mode 100644
index 0000000..73334c7
--- /dev/null
+++ b/storperf/tests/db_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/storperf/tests/db_tests/graphite_db_test.py b/storperf/tests/db_tests/graphite_db_test.py
new file mode 100644
index 0000000..ce970bb
--- /dev/null
+++ b/storperf/tests/db_tests/graphite_db_test.py
@@ -0,0 +1,47 @@
+from storperf.db.graphite_db import GraphiteDB
+import this
+import unittest
+
+
+class GraphiteDBTest(unittest.TestCase):
+
+ def setUp(self):
+ self.graphdb = GraphiteDB()
+ self.graphdb._job_db = self
+
+ def test_wilcard_pattern(self):
+ workload = "job_id"
+ expected = "job_id.*.*.*.*.*.*"
+ actual = self.graphdb.make_fullname_pattern(workload)
+ self.assertEqual(expected, actual, actual)
+
+ def test_no_wilcard_pattern(self):
+ workload = "job_id.workload.host.queue-depth.1.block-size.16"
+ actual = self.graphdb.make_fullname_pattern(workload)
+ self.assertEqual(workload, actual, actual)
+
+ def test_fetch_averages(self):
+ # self.graphdb.fetch_averages(u'32d31724-fac1-44f3-9033-ca8e00066a36')
+ pass
+
+ def fetch_workloads(self, workload):
+ workloads = [[u'32d31724-fac1-44f3-9033-ca8e00066a36.'
+ u'_warm_up.queue-depth.32.block-size.8192.10-9-15-151',
+ u'1462379653', u'1462379893'],
+ [u'32d31724-fac1-44f3-9033-ca8e00066a36.'
+ u'_warm_up.queue-depth.32.block-size.8192.10-9-15-150',
+ u'1462379653', u'1462379898'],
+ [u'32d31724-fac1-44f3-9033-ca8e00066a36'
+ u'.rw.queue-depth.128.block-size.8192.10-9-15-151',
+ u'1462379898', u'1462380028'],
+ [u'32d31724-fac1-44f3-9033-ca8e00066a36'
+ u'.rw.queue-depth.128.block-size.8192.10-9-15-150',
+ u'1462379898', u'1462380032'],
+ [u'32d31724-fac1-44f3-9033-ca8e00066a36'
+ u'.rw.queue-depth.16.block-size.8192.10-9-15-151',
+ u'1462380032', u'1462380312'],
+ [u'32d31724-fac1-44f3-9033-ca8e00066a36'
+ u'.rw.queue-depth.16.block-size.8192.10-9-15-150',
+ u'1462380032', u'1462380329'],
+ ]
+ return workloads
diff --git a/storperf/tests/storperf_master_test.py b/storperf/tests/storperf_master_test.py
index ff85fb0..33c1699 100644
--- a/storperf/tests/storperf_master_test.py
+++ b/storperf/tests/storperf_master_test.py
@@ -44,8 +44,8 @@ class StorPerfMasterTest(unittest.TestCase):
def test_agent_network(self):
expected = "ABCDEF"
- self.storperf.agent_network = expected
- actual = self.storperf.agent_network
+ self.storperf.public_network = expected
+ actual = self.storperf.public_network
self.assertEqual(
expected, actual, "Did not expect: " + str(actual))
diff --git a/storperf/tests/workload_tests/__init__.py b/storperf/tests/workload_tests/__init__.py
new file mode 100644
index 0000000..73334c7
--- /dev/null
+++ b/storperf/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/storperf/tests/workload_tests/workload_subclass_test.py b/storperf/tests/workload_tests/workload_subclass_test.py
index 97b6b46..e9e47f3 100644
--- a/storperf/tests/workload_tests/workload_subclass_test.py
+++ b/storperf/tests/workload_tests/workload_subclass_test.py
@@ -6,12 +6,12 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import unittest
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):
@@ -22,33 +22,33 @@ class WorkloadSubclassTest(unittest.TestCase):
def test_local_name(self):
workload = rr()
self.assertEqual(workload.fullname,
- "None.rr.None.queue-depth.1.block-size.64k",
+ "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.192-168-0-1.queue-depth.1.block-size.64k",
+ "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.None.queue-depth.1.block-size.4k",
+ "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.None.queue-depth.8.block-size.64k",
+ "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.None.queue-depth.1.block-size.64k",
+ "workloadid.ws.queue-depth.1.block-size.64k.None",
workload.fullname)