Remove '.value' from inputs in resource tests

This commit is contained in:
Przemyslaw Kaminski 2015-09-15 09:56:20 +02:00
parent 39462ef2e4
commit 03252c368f
14 changed files with 39 additions and 41 deletions

View File

@ -6,6 +6,6 @@ from solar.core.log import log
def test(resource):
log.debug('Testing apache_puppet')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, 80)
'http://%s:%s' % (resource.args['ip'], 80)
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing cinder_api_puppet')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, resource.args['service_port'].value)
'http://%s:%s' % (resource.args['ip'], resource.args['service_port'])
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing cinder_puppet')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
)

View File

@ -6,7 +6,7 @@ from solar.core.log import log
def test(resource):
log.debug('Testing cinder_scheduler_puppet')
# 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
# http://docs.openstack.org/developer/nova/devref/scheduler.html
# )

View File

@ -6,7 +6,7 @@ from solar.core.log import log
def test(resource):
log.debug('Testing cinder_volume_puppet')
# 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
# http://docs.openstack.org/developer/nova/devref/volume.html
# )

View File

@ -10,15 +10,15 @@ def test(resource):
args = resource.args
token, _ = validation.validate_token(
keystone_host=args['keystone_host'].value,
keystone_port=args['keystone_port'].value,
keystone_host=args['keystone_host'],
keystone_port=args['keystone_port'],
user='glance_admin',
tenant='services',
password=args['keystone_password'].value,
password=args['keystone_password'],
)
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}
)
assert images.json() == {'images': []}

View File

@ -7,16 +7,16 @@ from solar.core import validation
def test(resource):
log.debug('Testing glance_puppet')
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
args = resource.args
token, _ = validation.validate_token(
keystone_host=args['keystone_host'].value,
keystone_port=args['keystone_port'].value,
user=args['keystone_user'].value,
tenant=args['keystone_tenant'].value,
password=args['keystone_password'].value,
keystone_host=args['keystone_host'],
keystone_port=args['keystone_port'],
user=args['keystone_user'],
tenant=args['keystone_tenant'],
password=args['keystone_password'],
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing glance_registry_puppet')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, resource.args['bind_port'].value)
'http://%s:%s' % (resource.args['ip'], resource.args['bind_port'])
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing haproxy_service')
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])
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing keystone_puppet')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
)

View File

@ -6,5 +6,5 @@ from solar.core.log import log
def test(resource):
log.debug('Testing keystone_service')
requests.get(
'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
'http://%s:%s' % (resource.args['ip'], resource.args['port'])
)

View File

@ -9,26 +9,26 @@ def test(resource):
log.debug('Testing keystone_service_endpoint %s', resource.name)
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={
'X-Auth-Token': resource.args['admin_token'].value,
'X-Auth-Token': resource.args['admin_token'],
}
)
resp_json = 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']
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))
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={
'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:
endpoints[endpoint['interface']] = endpoint
assert jinja2.Template(resource.args['adminurl'].value).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['publicurl'].value).render(**resource.args_dict()) == endpoints['public']['url']
assert jinja2.Template(resource.args['adminurl']).render(**resource.args_dict()) == endpoints['admin']['url']
assert jinja2.Template(resource.args['internalurl']).render(**resource.args_dict()) == endpoints['internal']['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))

View File

@ -5,14 +5,14 @@ from solar.core import validation
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
token, _ = validation.validate_token(
keystone_host=args['keystone_host'].value,
keystone_port=args['keystone_port'].value,
user=args['user_name'].value,
tenant=args['tenant_name'].value,
password=args['user_password'].value,
keystone_host=args['keystone_host'],
keystone_port=args['keystone_port'],
user=args['user_name'],
tenant=args['tenant_name'],
password=args['user_password'],
)

View File

@ -11,11 +11,11 @@ def test(resource):
args = resource.args
token, token_data = validation.validate_token(
keystone_host=args['auth_host'].value,
keystone_port=args['auth_port'].value,
user=args['admin_user'].value,
tenant=args['admin_tenant_name'].value,
password=args['admin_password'].value,
keystone_host=args['auth_host'],
keystone_port=args['auth_port'],
user=args['admin_user'],
tenant=args['admin_tenant_name'],
password=args['admin_password'],
)
endpoints = [
@ -89,4 +89,3 @@ def test(resource):
)
log.debug('NOVA API IMAGES: %s', images.json())