Consolidate configuration some more
diff --git a/kong/tests/__init__.py b/kong/tests/__init__.py
index 2e6fc71..c475488 100644
--- a/kong/tests/__init__.py
+++ b/kong/tests/__init__.py
@@ -117,6 +117,10 @@
self.nova['ver'] = self.config['nova']['apiver']
self.nova['user'] = self.config['nova']['user']
self.nova['key'] = self.config['nova']['key']
+ self.nova['flavor_ref'] = self.config['nova']['flavor_ref']
+ self.nova['flavor_ref_alt'] = self.config['nova']['flavor_ref_alt']
+ self.nova['ssh_timeout'] = self.config['nova']['ssh_timeout']
+ self.nova['build_timeout'] = self.config['nova']['build_timeout']
if 'keystone' in self.config:
self.keystone['host'] = self.config['keystone']['host']
diff --git a/kong/tests/test_flavors.py b/kong/tests/test_flavors.py
index 07cb623..055447e 100644
--- a/kong/tests/test_flavors.py
+++ b/kong/tests/test_flavors.py
@@ -1,5 +1,6 @@
import json
import os
+import re
from kong import openstack
from kong import tests
@@ -44,8 +45,6 @@
actual_links = flavor['links']
flavor_id = str(flavor['id'])
- host = self.os.config.nova.host
- port = self.os.config.nova.port
mgmt_url = self.os.nova.management_url
bmk_url = re.sub(r'v1.1\/', r'', mgmt_url)
diff --git a/kong/tests/test_server_actions.py b/kong/tests/test_server_actions.py
index b8f81db..38af75b 100644
--- a/kong/tests/test_server_actions.py
+++ b/kong/tests/test_server_actions.py
@@ -18,12 +18,12 @@
super(ServerActionsTest, self).setUp()
self.os = openstack.Manager(self.nova)
- self.image_ref = self.os.config.env.image_ref
- self.image_ref_alt = self.os.config.env.image_ref_alt
- self.flavor_ref = self.os.config.env.flavor_ref
- self.flavor_ref_alt = self.os.config.env.flavor_ref_alt
- self.ssh_timeout = self.os.config.nova.ssh_timeout
- self.build_timeout = self.os.config.nova.build_timeout
+ self.image_ref = self.glance['image_id']
+# self.image_ref_alt = self.os.config.env.image_ref_alt
+ self.flavor_ref = self.nova['flavor_ref']
+ self.flavor_ref_alt = self.nova['flavor_ref_alt']
+ self.ssh_timeout = self.nova['ssh_timeout']
+ self.build_timeout = self.nova['build_timeout']
self.server_password = 'testpwd'
self.server_name = 'stacktester1'
@@ -156,6 +156,7 @@
self._assert_ssh_password('test123')
test_change_server_password.tags = ['nova']
+ @tests.skip("rebuild test needs alternate image, but we only have one")
def test_rebuild(self):
"""Rebuild a server"""
diff --git a/kong/tests/test_servers.py b/kong/tests/test_servers.py
index 9a55ae3..8824f92 100644
--- a/kong/tests/test_servers.py
+++ b/kong/tests/test_servers.py
@@ -13,10 +13,10 @@
def setUp(self):
super(ServersTest, self).setUp()
self.os = openstack.Manager(self.nova)
- self.image_ref = self.os.config.env.image_ref
- self.flavor_ref = self.os.config.env.flavor_ref
- self.ssh_timeout = self.os.config.nova.ssh_timeout
- self.build_timeout = self.os.config.nova.build_timeout
+ self.image_ref = self.glance['image_id']
+ self.flavor_ref = self.nova['flavor_ref']
+ self.ssh_timeout = self.nova['ssh_timeout']
+ self.build_timeout = self.nova['build_timeout']
def _assert_server_entity(self, server):
actual_keys = set(server.keys())
@@ -43,16 +43,16 @@
self.assertTrue(expected_keys <= actual_keys)
server_id = str(server['id'])
- host = self.os.config.nova.host
- port = self.os.config.nova.port
+ host = self.nova['host']
+ port = self.nova['port']
api_url = '%s:%s' % (host, port)
- base_url = os.path.join(api_url, self.os.config.nova.base_url)
+ base_url = os.path.join(api_url, self.nova['apiver'])
self_link = 'http://' + os.path.join(base_url,
- self.os.config.nova.project_id,
+# self.os.config.nova.project_id,
'servers', server_id)
bookmark_link = 'http://' + os.path.join(api_url,
- self.os.config.nova.project_id,
+# self.os.config.nova.project_id,
'servers', server_id)
expected_links = [