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:
parent
0f02152a21
commit
65538f145d
@ -1,4 +1,4 @@
|
|||||||
[DEFAULT]
|
[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_id_option=--load-list $IDFILE
|
||||||
test_list_option=--list
|
test_list_option=--list
|
||||||
|
31
refstack-client
Executable file
31
refstack-client
Executable 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()
|
@ -29,7 +29,6 @@ import ConfigParser
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import requests
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ from subunit_processor import SubunitProcessor
|
|||||||
|
|
||||||
|
|
||||||
class RefstackClient:
|
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):
|
def __init__(self, args):
|
||||||
'''Prepare a tempest test against a cloud.'''
|
'''Prepare a tempest test against a cloud.'''
|
||||||
@ -184,8 +183,8 @@ class RefstackClient:
|
|||||||
self.logger.error('%s failed to complete' % (e))
|
self.logger.error('%s failed to complete' % (e))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def parse_cli_args(args=None):
|
||||||
''' Generate tempest.conf from a tempest.conf.sample and then run test.'''
|
|
||||||
parser = argparse.ArgumentParser(description='Starts a tempest test',
|
parser = argparse.ArgumentParser(description='Starts a tempest test',
|
||||||
formatter_class=argparse.
|
formatter_class=argparse.
|
||||||
ArgumentDefaultsHelpFormatter)
|
ArgumentDefaultsHelpFormatter)
|
||||||
@ -224,8 +223,4 @@ if __name__ == '__main__':
|
|||||||
type=str,
|
type=str,
|
||||||
help='Specify a subset of test cases to run '
|
help='Specify a subset of test cases to run '
|
||||||
'(e.g. --test-cases tempest.api.compute).')
|
'(e.g. --test-cases tempest.api.compute).')
|
||||||
|
return parser.parse_args(args=args)
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
test = RefstackClient(args)
|
|
||||||
test.run()
|
|
0
refstack_client/tests/unit/__init__.py
Normal file
0
refstack_client/tests/unit/__init__.py
Normal file
@ -20,7 +20,7 @@ classifier =
|
|||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
refstack-client
|
refstack_client
|
||||||
|
|
||||||
[global]
|
[global]
|
||||||
setup-hooks =
|
setup-hooks =
|
||||||
|
Loading…
Reference in New Issue
Block a user