summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/db_tests/configuration_db_test.py9
-rw-r--r--tests/storperf_master_test.py18
2 files changed, 15 insertions, 12 deletions
diff --git a/tests/db_tests/configuration_db_test.py b/tests/db_tests/configuration_db_test.py
index e8b7188..dda616b 100644
--- a/tests/db_tests/configuration_db_test.py
+++ b/tests/db_tests/configuration_db_test.py
@@ -10,17 +10,14 @@
from storperf.db.configuration_db import ConfigurationDB
import os
import unittest
+import sqlite3
class ConfigurationDBTest(unittest.TestCase):
def setUp(self):
- ConfigurationDB.db_name = __name__ + ".db"
- try:
- os.remove(ConfigurationDB.db_name)
- except OSError:
- pass
-
+ ConfigurationDB.db_name = "file::memory:?cache=shared"
+ db = sqlite3.connect(ConfigurationDB.db_name)
self.config_db = ConfigurationDB()
def test_create_key(self):
diff --git a/tests/storperf_master_test.py b/tests/storperf_master_test.py
index 2dc810d..c67e3c4 100644
--- a/tests/storperf_master_test.py
+++ b/tests/storperf_master_test.py
@@ -9,18 +9,15 @@
from storperf.db.configuration_db import ConfigurationDB
from storperf.storperf_master import StorPerfMaster
-import os
import unittest
+import sqlite3
class StorPerfMasterTest(unittest.TestCase):
def setUp(self):
- ConfigurationDB.db_name = __name__ + ".db"
- try:
- os.remove(ConfigurationDB.db_name)
- except OSError:
- pass
+ ConfigurationDB.db_name = "file::memory:?cache=shared"
+ db = sqlite3.connect(ConfigurationDB.db_name)
self.storperf = StorPerfMaster()
def test_agent_count(self):
@@ -67,3 +64,12 @@ class StorPerfMasterTest(unittest.TestCase):
self.assertEqual(
expected, actual, "Did not expect: " + str(actual))
+
+ def test_agent_flavor(self):
+ expected = "m1.small"
+
+ self.storperf.agent_flavor = expected
+ actual = self.storperf.agent_flavor
+
+ self.assertEqual(
+ expected, actual, "Did not expect: " + str(actual))