]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Added integration tests to ensure locking is working correctly
authorAndrew Schoen <aschoen@redhat.com>
Wed, 4 Feb 2015 20:19:08 +0000 (14:19 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 5 Feb 2015 20:19:23 +0000 (14:19 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/task/tests/test_locking.py [new file with mode: 0644]

diff --git a/teuthology/task/tests/test_locking.py b/teuthology/task/tests/test_locking.py
new file mode 100644 (file)
index 0000000..aa395e7
--- /dev/null
@@ -0,0 +1,27 @@
+import pytest
+import re
+
+
+class TestLocking(object):
+
+    def test_correct_os_type(self, ctx, config):
+        os_type = ctx.config.get("os_type")
+        if os_type is None:
+            pytest.skip('os_type was not defined')
+        for remote in ctx.cluster.remotes.iterkeys():
+            assert remote.os.name == os_type
+
+    def test_correct_os_version(self, ctx, config):
+        os_version = ctx.config.get("os_version")
+        if os_version is None:
+            pytest.skip('os_version was not defined')
+        for remote in ctx.cluster.remotes.iterkeys():
+            assert remote.os.version == os_version
+
+    def test_correct_machine_type(self, ctx, config):
+        machine_type = ctx.machine_type
+        for remote in ctx.cluster.remotes.iterkeys():
+            # gotta be a better way to get machine_type
+            # if not, should we move this to Remote?
+            remote_type = re.sub("[0-9]", "", remote.shortname)
+            assert remote_type in machine_type