diff --git a/example.py b/example.py index 16ba902b..90cc43b5 100644 --- a/example.py +++ b/example.py @@ -5,7 +5,7 @@ import sys import time from solar.core import actions -from solar.core import virtual_resource as vr +from solar.core.resource import virtual_resource as vr from solar.core import resource from solar.core import signals from solar.core import testing @@ -161,8 +161,8 @@ def deploy(): signals.connect(glance_config, glance_api_container, {'config_dir': 'host_binds'}) signals.connect(glance_db_user, glance_api_container, {'user_password': 'db_password'}) - signals.connect(glance_keystone_user, glance_api_container, {'user_password': 'keystone_password'}) - signals.connect(glance_keystone_user, glance_api_container, {'admin_token': 'keystone_admin_token'}) + signals.connect(glance_keystone_user, glance_api_container, {'admin_token': 'keystone_admin_token', 'user_password': 'keystone_password'}) + signals.connect(haproxy_keystone_config, glance_api_container, {'listen_port': 'keystone_port'}) signals.connect(haproxy_config, glance_api_container, {'ip': 'keystone_host'}) signals.connect(node2, glance_registry_container) diff --git a/resources/glance_api_service/meta.yaml b/resources/glance_api_service/meta.yaml index f1f06b6c..213dffc9 100644 --- a/resources/glance_api_service/meta.yaml +++ b/resources/glance_api_service/meta.yaml @@ -36,5 +36,8 @@ input: keystone_host: schema: str! value: + keystone_port: + schema: int! + value: tags: [resource/container] diff --git a/resources/glance_api_service/test.py b/resources/glance_api_service/test.py index d56e7f26..bdbb5069 100644 --- a/resources/glance_api_service/test.py +++ b/resources/glance_api_service/test.py @@ -5,14 +5,14 @@ import requests def test(resource): print 'Testing glance_service' token_data = requests.post( - 'http://%s:%s/v2.0/tokens' % (resource.args['ip'].value, resource.args['listen_port'].value), + 'http://%s:%s/v2.0/tokens' % (resource.args['ip'].value, resource.args['keystone_port'].value), json.dumps({ 'auth': { - 'tenantName': resource.args['tenant_name'].value, + 'tenantName': 'services', 'passwordCredentials': { - 'username': resource.args['user_name'].value, - 'password': resource.args['user_password'].value, - } + 'username': 'glance_admin', + 'password': resource.args['keystone_password'].value, + } } }), headers={'Content-Type': 'application/json'} @@ -22,7 +22,7 @@ def test(resource): print 'GLANCE TOKEN: {}'.format(token) images = requests.get( - 'http://%s:%s/v1/images' % (resource.args['ip'].value, resource.args['listen_port'].value), + 'http://%s:%s/v1/images' % (resource.args['ip'].value, 9393), headers={'X-Auth-Token': token} ) assert images.json() == {'images': []} diff --git a/solar/solar/core/testing.py b/solar/solar/core/testing.py index 7dd24952..c918f688 100644 --- a/solar/solar/core/testing.py +++ b/solar/solar/core/testing.py @@ -8,15 +8,16 @@ from solar.core import signals def test_all(): conn_graph = signals.detailed_connection_graph() - srt = nx.topological_sort(conn_graph) + #srt = nx.topological_sort(conn_graph) - for name in srt: + for name in conn_graph: print 'Trying {}'.format(name) r = resource.load(name) script_path = os.path.join(r.metadata['base_path'], 'test.py') if not os.path.exists(script_path): print 'WARNING: resource {} has no tests'.format(name) + continue print 'File {} found'.format(script_path)