Rename refstack-client to refstack_client

This renaming and change of project structure is necessary for adding
the unit tests.

Change-Id: I1893afbb05c86c83312983b12ce601d59a7fb417
This commit is contained in:
sslypushenko 2014-09-22 16:32:21 +03:00
parent 0f02152a21
commit 65538f145d
11 changed files with 38 additions and 12 deletions

View File

@ -1,4 +1,4 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./refstack_client/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

31
refstack-client Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env python
#
# Copyright (c) 2014 Piston Cloud Computing, Inc. All Rights Reserved.
#
# 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.
#
"""
Run Tempest and upload results to Refstack.
This module runs the Tempest test suite on an OpenStack environment given a
Tempest configuration file.
"""
from refstack_client import refstack_client
if __name__ == '__main__':
args = refstack_client.parse_cli_args()
test = refstack_client.RefstackClient(args)
test.run()

View File

@ -29,7 +29,6 @@ import ConfigParser
import json
import logging
import os
import requests
import subprocess
import time
@ -39,7 +38,7 @@ from subunit_processor import SubunitProcessor
class RefstackClient:
log_format = "%(asctime)s %(name)s %(levelname)s %(message)s"
log_format = "%(asctime)s %(name)s:%(lineno)d %(levelname)s %(message)s"
def __init__(self, args):
'''Prepare a tempest test against a cloud.'''
@ -184,8 +183,8 @@ class RefstackClient:
self.logger.error('%s failed to complete' % (e))
if __name__ == '__main__':
''' Generate tempest.conf from a tempest.conf.sample and then run test.'''
def parse_cli_args(args=None):
parser = argparse.ArgumentParser(description='Starts a tempest test',
formatter_class=argparse.
ArgumentDefaultsHelpFormatter)
@ -224,8 +223,4 @@ if __name__ == '__main__':
type=str,
help='Specify a subset of test cases to run '
'(e.g. --test-cases tempest.api.compute).')
args = parser.parse_args()
test = RefstackClient(args)
test.run()
return parser.parse_args(args=args)

View File

View File

@ -20,7 +20,7 @@ classifier =
[files]
packages =
refstack-client
refstack_client
[global]
setup-hooks =

View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py33,pep8
envlist = py27,pep8
minversion = 1.6
skipsdist = True