Malini Kamalambal 5477b646cc Add System Tests
This patch adds the System level testing framework &
the initial set of tests for Marconi.This will allow
developers to run the system tests (regression suite for
Marconi system level tests), against local Marconi server.

Refer tests/system/README.rst file for details on
how to add new tests and run the existing tests.

Change-Id: I2f47e03091acc260293b19edad69ff5c83888ec3
Implements: blueprint system-tests
2013-06-03 12:39:22 -04:00

72 lines
2.0 KiB
Python

# Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import ConfigParser
import os
import uuid
class Config(object):
def __init__(self, config_path=None):
if config_path is None:
if os.path.exists('/etc/marconi/system-tests.conf'):
config_path = '/etc/marconi/system-tests.conf'
else:
config_path = os.path.expanduser('~/.marconi'
'/system-tests.conf')
self.parser = ConfigParser.SafeConfigParser()
self.parser.read(config_path)
@property
def auth_enabled(self):
return self.parser.getboolean('auth', 'auth_on')
@property
def username(self):
return self.parser.get('auth', 'username')
@property
def password(self):
return self.parser.get('auth', 'password')
@property
def base_server(self):
return self.parser.get('marconi_env', 'marconi_url')
@property
def marconi_version(self):
return self.parser.get('marconi_env', 'marconi_version')
@property
def tenant_id(self):
return self.parser.get('marconi_env', 'tenant_id')
@property
def base_url(self):
return (self.base_server + '/' + self.marconi_version +
'/' + self.tenant_id)
@property
def uuid(self):
return str(uuid.uuid1())
@property
def user_agent(self):
return self.parser.get('header_values', 'useragent')
@property
def host(self):
return self.parser.get('header_values', 'host')