]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add unit tests for OpenStack config defaults
authorZack Cerza <zack@redhat.com>
Thu, 27 Aug 2015 22:03:35 +0000 (16:03 -0600)
committerLoic Dachary <ldachary@redhat.com>
Wed, 2 Sep 2015 22:02:39 +0000 (00:02 +0200)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/openstack/test/test_config.py [new file with mode: 0644]

diff --git a/teuthology/openstack/test/test_config.py b/teuthology/openstack/test/test_config.py
new file mode 100644 (file)
index 0000000..5fddeed
--- /dev/null
@@ -0,0 +1,35 @@
+from teuthology.config import config
+
+
+class TestOpenStack(object):
+
+    def setup(self):
+        self.openstack_config = config['openstack']
+
+    def test_config_clone(self):
+        assert 'clone' in self.openstack_config
+
+    def test_config_user_data(self):
+        os_type = 'rhel'
+        os_version = '7.0'
+        template_path = self.openstack_config['user-data'].format(
+            os_type=os_type,
+            os_version=os_version)
+        assert os_type in template_path
+        assert os_version in template_path
+
+    def test_config_ip(self):
+        assert 'ip' in self.openstack_config
+
+    def test_config_machine(self):
+        assert 'machine' in self.openstack_config
+        machine_config = self.openstack_config['machine']
+        assert 'disk' in machine_config
+        assert 'ram' in machine_config
+        assert 'cpus' in machine_config
+
+    def test_config_volumes(self):
+        assert 'volumes' in self.openstack_config
+        volumes_config = self.openstack_config['volumes']
+        assert 'count' in volumes_config
+        assert 'size' in volumes_config