Remove '.value' from inputs in resource tests
This commit is contained in:
parent
39462ef2e4
commit
03252c368f
@ -6,6 +6,6 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing apache_puppet')
|
log.debug('Testing apache_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, 80)
|
'http://%s:%s' % (resource.args['ip'], 80)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing cinder_api_puppet')
|
log.debug('Testing cinder_api_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['service_port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['service_port'])
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing cinder_puppet')
|
log.debug('Testing cinder_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
|
||||||
)
|
)
|
||||||
|
@ -6,7 +6,7 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing cinder_scheduler_puppet')
|
log.debug('Testing cinder_scheduler_puppet')
|
||||||
# requests.get(
|
# requests.get(
|
||||||
# 'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
# 'http://%s:%s' % (resource.args['ip'], resource.args['port'])
|
||||||
# TODO(bogdando) figure out how to test this
|
# TODO(bogdando) figure out how to test this
|
||||||
# http://docs.openstack.org/developer/nova/devref/scheduler.html
|
# http://docs.openstack.org/developer/nova/devref/scheduler.html
|
||||||
# )
|
# )
|
||||||
|
@ -6,7 +6,7 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing cinder_volume_puppet')
|
log.debug('Testing cinder_volume_puppet')
|
||||||
# requests.get(
|
# requests.get(
|
||||||
# 'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
# 'http://%s:%s' % (resource.args['ip'], resource.args['port'])
|
||||||
# TODO(bogdando) figure out how to test this
|
# TODO(bogdando) figure out how to test this
|
||||||
# http://docs.openstack.org/developer/nova/devref/volume.html
|
# http://docs.openstack.org/developer/nova/devref/volume.html
|
||||||
# )
|
# )
|
||||||
|
@ -10,15 +10,15 @@ def test(resource):
|
|||||||
args = resource.args
|
args = resource.args
|
||||||
|
|
||||||
token, _ = validation.validate_token(
|
token, _ = validation.validate_token(
|
||||||
keystone_host=args['keystone_host'].value,
|
keystone_host=args['keystone_host'],
|
||||||
keystone_port=args['keystone_port'].value,
|
keystone_port=args['keystone_port'],
|
||||||
user='glance_admin',
|
user='glance_admin',
|
||||||
tenant='services',
|
tenant='services',
|
||||||
password=args['keystone_password'].value,
|
password=args['keystone_password'],
|
||||||
)
|
)
|
||||||
|
|
||||||
images = requests.get(
|
images = requests.get(
|
||||||
'http://%s:%s/v1/images' % (resource.args['ip'].value, 9393),
|
'http://%s:%s/v1/images' % (resource.args['ip'], 9393),
|
||||||
headers={'X-Auth-Token': token}
|
headers={'X-Auth-Token': token}
|
||||||
)
|
)
|
||||||
assert images.json() == {'images': []}
|
assert images.json() == {'images': []}
|
||||||
|
@ -7,16 +7,16 @@ from solar.core import validation
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing glance_puppet')
|
log.debug('Testing glance_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['bind_port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['bind_port'])
|
||||||
)
|
)
|
||||||
#TODO(bogdando) test packages installed and filesystem store datadir created
|
#TODO(bogdando) test packages installed and filesystem store datadir created
|
||||||
|
|
||||||
args = resource.args
|
args = resource.args
|
||||||
|
|
||||||
token, _ = validation.validate_token(
|
token, _ = validation.validate_token(
|
||||||
keystone_host=args['keystone_host'].value,
|
keystone_host=args['keystone_host'],
|
||||||
keystone_port=args['keystone_port'].value,
|
keystone_port=args['keystone_port'],
|
||||||
user=args['keystone_user'].value,
|
user=args['keystone_user'],
|
||||||
tenant=args['keystone_tenant'].value,
|
tenant=args['keystone_tenant'],
|
||||||
password=args['keystone_password'].value,
|
password=args['keystone_password'],
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing glance_registry_puppet')
|
log.debug('Testing glance_registry_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['bind_port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['bind_port'])
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing haproxy_service')
|
log.debug('Testing haproxy_service')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['ports'].value[0]['value'][0]['value'])
|
'http://%s:%s' % (resource.args['ip'], resource.args['ports'][0][0])
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing keystone_puppet')
|
log.debug('Testing keystone_puppet')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ from solar.core.log import log
|
|||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing keystone_service')
|
log.debug('Testing keystone_service')
|
||||||
requests.get(
|
requests.get(
|
||||||
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
|
||||||
)
|
)
|
||||||
|
@ -9,26 +9,26 @@ def test(resource):
|
|||||||
log.debug('Testing keystone_service_endpoint %s', resource.name)
|
log.debug('Testing keystone_service_endpoint %s', resource.name)
|
||||||
|
|
||||||
resp = requests.get(
|
resp = requests.get(
|
||||||
'http://%s:%s/v3/services' % (resource.args['ip'].value, resource.args['keystone_admin_port'].value),
|
'http://%s:%s/v3/services' % (resource.args['ip'], resource.args['keystone_admin_port']),
|
||||||
headers={
|
headers={
|
||||||
'X-Auth-Token': resource.args['admin_token'].value,
|
'X-Auth-Token': resource.args['admin_token'],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
resp_json = resp.json()
|
resp_json = resp.json()
|
||||||
assert 'services' in resp_json
|
assert 'services' in resp_json
|
||||||
|
|
||||||
service = [s for s in resp_json['services'] if s['name'] == resource.args['endpoint_name'].value][0]
|
service = [s for s in resp_json['services'] if s['name'] == resource.args['endpoint_name']][0]
|
||||||
service_id = service['id']
|
service_id = service['id']
|
||||||
|
|
||||||
assert service['description'] == resource.args['description'].value
|
assert service['description'] == resource.args['description']
|
||||||
|
|
||||||
log.debug('%s service: %s', resource.name, json.dumps(service, indent=2))
|
log.debug('%s service: %s', resource.name, json.dumps(service, indent=2))
|
||||||
|
|
||||||
resp = requests.get(
|
resp = requests.get(
|
||||||
'http://%s:%s/v3/endpoints' % (resource.args['ip'].value, resource.args['keystone_admin_port'].value),
|
'http://%s:%s/v3/endpoints' % (resource.args['ip'], resource.args['keystone_admin_port']),
|
||||||
headers={
|
headers={
|
||||||
'X-Auth-Token': resource.args['admin_token'].value,
|
'X-Auth-Token': resource.args['admin_token'],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -41,9 +41,8 @@ def test(resource):
|
|||||||
if endpoint['service_id'] == service_id:
|
if endpoint['service_id'] == service_id:
|
||||||
endpoints[endpoint['interface']] = endpoint
|
endpoints[endpoint['interface']] = endpoint
|
||||||
|
|
||||||
assert jinja2.Template(resource.args['adminurl'].value).render(**resource.args_dict()) == endpoints['admin']['url']
|
assert jinja2.Template(resource.args['adminurl']).render(**resource.args_dict()) == endpoints['admin']['url']
|
||||||
assert jinja2.Template(resource.args['internalurl'].value).render(**resource.args_dict()) == endpoints['internal']['url']
|
assert jinja2.Template(resource.args['internalurl']).render(**resource.args_dict()) == endpoints['internal']['url']
|
||||||
assert jinja2.Template(resource.args['publicurl'].value).render(**resource.args_dict()) == endpoints['public']['url']
|
assert jinja2.Template(resource.args['publicurl']).render(**resource.args_dict()) == endpoints['public']['url']
|
||||||
|
|
||||||
log.debug('%s endpoints: %s', resource.name, json.dumps(endpoints, indent=2))
|
log.debug('%s endpoints: %s', resource.name, json.dumps(endpoints, indent=2))
|
||||||
|
|
||||||
|
@ -5,14 +5,14 @@ from solar.core import validation
|
|||||||
|
|
||||||
|
|
||||||
def test(resource):
|
def test(resource):
|
||||||
log.debug('Testing keystone_user %s', resource.args['user_name'].value)
|
log.debug('Testing keystone_user %s', resource.args['user_name'])
|
||||||
|
|
||||||
args = resource.args
|
args = resource.args
|
||||||
|
|
||||||
token, _ = validation.validate_token(
|
token, _ = validation.validate_token(
|
||||||
keystone_host=args['keystone_host'].value,
|
keystone_host=args['keystone_host'],
|
||||||
keystone_port=args['keystone_port'].value,
|
keystone_port=args['keystone_port'],
|
||||||
user=args['user_name'].value,
|
user=args['user_name'],
|
||||||
tenant=args['tenant_name'].value,
|
tenant=args['tenant_name'],
|
||||||
password=args['user_password'].value,
|
password=args['user_password'],
|
||||||
)
|
)
|
||||||
|
@ -11,11 +11,11 @@ def test(resource):
|
|||||||
args = resource.args
|
args = resource.args
|
||||||
|
|
||||||
token, token_data = validation.validate_token(
|
token, token_data = validation.validate_token(
|
||||||
keystone_host=args['auth_host'].value,
|
keystone_host=args['auth_host'],
|
||||||
keystone_port=args['auth_port'].value,
|
keystone_port=args['auth_port'],
|
||||||
user=args['admin_user'].value,
|
user=args['admin_user'],
|
||||||
tenant=args['admin_tenant_name'].value,
|
tenant=args['admin_tenant_name'],
|
||||||
password=args['admin_password'].value,
|
password=args['admin_password'],
|
||||||
)
|
)
|
||||||
|
|
||||||
endpoints = [
|
endpoints = [
|
||||||
@ -89,4 +89,3 @@ def test(resource):
|
|||||||
)
|
)
|
||||||
|
|
||||||
log.debug('NOVA API IMAGES: %s', images.json())
|
log.debug('NOVA API IMAGES: %s', images.json())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user