Various fixes for example.py and resource testing
This commit is contained in:
parent
7323a842da
commit
118acbcfa3
@ -5,7 +5,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from solar.core import actions
|
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 resource
|
||||||
from solar.core import signals
|
from solar.core import signals
|
||||||
from solar.core import testing
|
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_config, glance_api_container, {'config_dir': 'host_binds'})
|
||||||
|
|
||||||
signals.connect(glance_db_user, glance_api_container, {'user_password': 'db_password'})
|
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', 'user_password': 'keystone_password'})
|
||||||
signals.connect(glance_keystone_user, glance_api_container, {'admin_token': 'keystone_admin_token'})
|
signals.connect(haproxy_keystone_config, glance_api_container, {'listen_port': 'keystone_port'})
|
||||||
signals.connect(haproxy_config, glance_api_container, {'ip': 'keystone_host'})
|
signals.connect(haproxy_config, glance_api_container, {'ip': 'keystone_host'})
|
||||||
|
|
||||||
signals.connect(node2, glance_registry_container)
|
signals.connect(node2, glance_registry_container)
|
||||||
|
@ -36,5 +36,8 @@ input:
|
|||||||
keystone_host:
|
keystone_host:
|
||||||
schema: str!
|
schema: str!
|
||||||
value:
|
value:
|
||||||
|
keystone_port:
|
||||||
|
schema: int!
|
||||||
|
value:
|
||||||
|
|
||||||
tags: [resource/container]
|
tags: [resource/container]
|
||||||
|
@ -5,13 +5,13 @@ import requests
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
print 'Testing glance_service'
|
print 'Testing glance_service'
|
||||||
token_data = requests.post(
|
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({
|
json.dumps({
|
||||||
'auth': {
|
'auth': {
|
||||||
'tenantName': resource.args['tenant_name'].value,
|
'tenantName': 'services',
|
||||||
'passwordCredentials': {
|
'passwordCredentials': {
|
||||||
'username': resource.args['user_name'].value,
|
'username': 'glance_admin',
|
||||||
'password': resource.args['user_password'].value,
|
'password': resource.args['keystone_password'].value,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@ -22,7 +22,7 @@ def test(resource):
|
|||||||
print 'GLANCE TOKEN: {}'.format(token)
|
print 'GLANCE TOKEN: {}'.format(token)
|
||||||
|
|
||||||
images = requests.get(
|
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}
|
headers={'X-Auth-Token': token}
|
||||||
)
|
)
|
||||||
assert images.json() == {'images': []}
|
assert images.json() == {'images': []}
|
||||||
|
@ -8,15 +8,16 @@ from solar.core import signals
|
|||||||
|
|
||||||
def test_all():
|
def test_all():
|
||||||
conn_graph = signals.detailed_connection_graph()
|
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)
|
print 'Trying {}'.format(name)
|
||||||
r = resource.load(name)
|
r = resource.load(name)
|
||||||
|
|
||||||
script_path = os.path.join(r.metadata['base_path'], 'test.py')
|
script_path = os.path.join(r.metadata['base_path'], 'test.py')
|
||||||
if not os.path.exists(script_path):
|
if not os.path.exists(script_path):
|
||||||
print 'WARNING: resource {} has no tests'.format(name)
|
print 'WARNING: resource {} has no tests'.format(name)
|
||||||
|
continue
|
||||||
|
|
||||||
print 'File {} found'.format(script_path)
|
print 'File {} found'.format(script_path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user