log.debug instead of print for resource tests

This commit is contained in:
Przemyslaw Kaminski 2015-07-09 13:02:39 +02:00
parent 8127d0ce58
commit 82e7d0645b
6 changed files with 22 additions and 9 deletions

View File

@ -1,9 +1,11 @@
import json import json
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print 'Testing glance_service' log.debug('Testing glance_service')
token_data = requests.post( token_data = requests.post(
'http://%s:%s/v2.0/tokens' % (resource.args['ip'].value, resource.args['keystone_port'].value), 'http://%s:%s/v2.0/tokens' % (resource.args['ip'].value, resource.args['keystone_port'].value),
json.dumps({ json.dumps({
@ -19,7 +21,7 @@ def test(resource):
) )
token = token_data.json()['access']['token']['id'] token = token_data.json()['access']['token']['id']
print 'GLANCE TOKEN: {}'.format(token) log.debug('GLANCE TOKEN: %s', token)
images = requests.get( images = requests.get(
'http://%s:%s/v1/images' % (resource.args['ip'].value, 9393), 'http://%s:%s/v1/images' % (resource.args['ip'].value, 9393),

View File

@ -1,8 +1,10 @@
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print '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'].value, resource.args['ports'].value[0]['value'][0]['value'])
) )

View File

@ -1,8 +1,10 @@
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print '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'].value, resource.args['port'].value)
) )

View File

@ -1,8 +1,10 @@
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print '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'].value, resource.args['port'].value)
) )

View File

@ -1,12 +1,15 @@
import json import json
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print 'Testing keystone_user {}'.format(resource.args['user_name'].value) log.debug('Testing keystone_user %s', resource.args['user_name'].value)
token_data = requests.post( token_data = requests.post(
'http://%s:%s/v2.0/tokens' % (resource.args['keystone_host'].value, resource.args['keystone_port'].value), 'http://%s:%s/v2.0/tokens' % (resource.args['keystone_host'].value,
resource.args['keystone_port'].value),
json.dumps({ json.dumps({
'auth': { 'auth': {
'tenantName': resource.args['tenant_name'].value, 'tenantName': resource.args['tenant_name'].value,
@ -21,4 +24,4 @@ def test(resource):
token = token_data.json()['access']['token']['id'] token = token_data.json()['access']['token']['id']
print '{} TOKEN: {}'.format(resource.args['user_name'].value, token) log.debug('%s TOKEN: %s', resource.args['user_name'].value, token)

View File

@ -1,7 +1,9 @@
import requests import requests
from solar.core.log import log
def test(resource): def test(resource):
print 'Testing rabbitmq_service' log.debug('Testing rabbitmq_service')
requests.get('http://%s:%s' % (resource.args['ip'].value, resource.args['management_port'].value)) requests.get('http://%s:%s' % (resource.args['ip'].value, resource.args['management_port'].value))