Multiple fix: now running
This commit is contained in:
parent
df2232eebc
commit
04ab7c0dd4
51
README.rst
51
README.rst
@ -23,11 +23,11 @@ the private key and user name for ssh to the cluster in the
|
||||
[stress] section of tempest.conf. You also need to provide the
|
||||
location of the log files:
|
||||
|
||||
target_logfiles = "regexp to all log files to be checked for errors"
|
||||
target_private_key_path = "private ssh key for controller and log file nodes"
|
||||
target_ssh_user = "username for controller and log file nodes"
|
||||
target_controller = "hostname or ip of controller node (for nova-manage)
|
||||
log_check_interval = "time between checking logs for errors (default 60s)"
|
||||
- target_logfiles = "regexp to all log files to be checked for errors"
|
||||
- target_private_key_path = "private ssh key for controller and log file nodes"
|
||||
- target_ssh_user = "username for controller and log file nodes"
|
||||
- target_controller = "hostname or ip of controller node (for nova-manage)
|
||||
- log_check_interval = "time between checking logs for errors (default 60s)"
|
||||
|
||||
To activate logging on your console please make sure that you activate `use_stderr`
|
||||
in tempest.conf or use the default `logging.conf.sample` file.
|
||||
@ -35,34 +35,51 @@ in tempest.conf or use the default `logging.conf.sample` file.
|
||||
Running default stress test set
|
||||
-------------------------------
|
||||
|
||||
Installation
|
||||
------------
|
||||
#. You first need to clone this repo.::
|
||||
|
||||
$ git clone https://github.com/ghanshyammann/tempest_stress
|
||||
$ cd tempest_stress
|
||||
|
||||
#. Intall::
|
||||
|
||||
$ python setup.py install
|
||||
|
||||
#. Install `Tempest`_
|
||||
|
||||
.. _Tempest: http://docs.openstack.org/developer/tempest/overview.html#quickstart
|
||||
|
||||
|
||||
Configuration
|
||||
*************
|
||||
|
||||
To Run stress tests, two configuration files are needed:
|
||||
|
||||
1. tempest.conf - As per Tempest configuration guidlines
|
||||
1. tempest.conf - As per Tempest configuration guidlines here: `configuration`_
|
||||
|
||||
2. stress_tests.conf - same location as tempest.conf
|
||||
|
||||
later one is being used to define all config options specific to stress tests.
|
||||
|
||||
Run:
|
||||
****
|
||||
The stress test framework can automatically discover test inside the tempest
|
||||
test suite. All test flag with the `@stresstest` decorator will be executed.
|
||||
In order to use this discovery you have to install tempest CLI, be in the
|
||||
tempest root directory and execute the following:
|
||||
.. _configuration: http://docs.openstack.org/developer/tempest/configuration.html#tempest-configuration
|
||||
|
||||
tempest run-stress -a -d 30
|
||||
|
||||
Running the sample test
|
||||
-----------------------
|
||||
Run
|
||||
***
|
||||
|
||||
To test installation, do the following:
|
||||
Run all tests::
|
||||
|
||||
tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
|
||||
$ run-tempest-stress -a -d 30
|
||||
|
||||
Run specific test::
|
||||
|
||||
$ run-tempest-stress -t ./tempest_stress/etc/server-create-destroy-test.json -d 30
|
||||
This sample test tries to create a few VMs and kill a few VMs.
|
||||
|
||||
For more information please refer run-tempest-stress CLI help::
|
||||
|
||||
$ run-tempest-stress -h
|
||||
|
||||
Additional Tools
|
||||
----------------
|
||||
|
@ -4,5 +4,7 @@
|
||||
|
||||
pbr>=1.6 # Apache-2.0
|
||||
Babel>=1.3
|
||||
oslo.config>=3.14.0 # Apache-2.0
|
||||
oslo.log>=1.14.0 # Apache-2.0
|
||||
tempest>=13.0.0
|
||||
tempest>=12.1.0 # Apache-2.0
|
||||
unittest2 # BSD
|
||||
|
2
setup.py
2
setup.py
@ -26,4 +26,4 @@ except ImportError:
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
||||
pbr=True)
|
||||
|
@ -15,6 +15,7 @@
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -17,6 +17,7 @@ from tempest.common.utils import data_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
|
||||
from tempest import config
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
@ -74,7 +74,7 @@ class UnitTest(stressaction.StressAction):
|
||||
def run(self):
|
||||
if self.class_setup_per != SetUpClassRunTime.application:
|
||||
if (self.class_setup_per == SetUpClassRunTime.action
|
||||
or self.setupclass_called is False):
|
||||
or self.setupclass_called is False):
|
||||
self.klass.setUpClass()
|
||||
self.setupclass_called = True
|
||||
|
||||
@ -82,7 +82,7 @@ class UnitTest(stressaction.StressAction):
|
||||
self.run_core()
|
||||
finally:
|
||||
if (CONF.stress.leave_dirty_stack is False
|
||||
and self.class_setup_per == SetUpClassRunTime.action):
|
||||
and self.class_setup_per == SetUpClassRunTime.action):
|
||||
self.klass.tearDownClass()
|
||||
else:
|
||||
self.run_core()
|
||||
|
@ -14,6 +14,7 @@
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -17,6 +17,7 @@ from tempest.common.utils.linux import remote_client
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import test_utils
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -15,7 +15,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from tempest.common import credentials_factory as credentials
|
||||
from tempest.common import waiters
|
||||
|
||||
|
@ -25,8 +25,8 @@ except ImportError:
|
||||
from unittest2 import loader
|
||||
|
||||
from oslo_log import log as logging
|
||||
from testtools import testsuite
|
||||
from tempest import config
|
||||
from testtools import testsuite
|
||||
|
||||
from tempest_stress import config as stress_cfg
|
||||
from tempest_stress import driver
|
||||
@ -35,8 +35,8 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def discover_stress_tests(path="./", filter_attr=None, call_inherited=False):
|
||||
"""Discovers all tests and create action out of them
|
||||
"""
|
||||
"""Discovers all tests and create action out of them."""
|
||||
|
||||
LOG.info("Start test discovery")
|
||||
tests = []
|
||||
testloader = loader.TestLoader()
|
||||
@ -65,7 +65,7 @@ def discover_stress_tests(path="./", filter_attr=None, call_inherited=False):
|
||||
}
|
||||
}
|
||||
if (not call_inherited and
|
||||
getattr(test_func, "st_allow_inheritance") is not True):
|
||||
getattr(test_func, "st_allow_inheritance") is not True):
|
||||
class_structure = inspect.getmro(test_func.im_class)
|
||||
if test_func.__name__ not in class_structure[0].__dict__:
|
||||
continue
|
||||
@ -75,8 +75,8 @@ def discover_stress_tests(path="./", filter_attr=None, call_inherited=False):
|
||||
|
||||
parser = argparse.ArgumentParser(description='Run stress tests')
|
||||
parser.add_argument('-c', '--config-file-path',
|
||||
metavar='/etc/',
|
||||
help='path to tempest and stress tests config files')
|
||||
metavar='/etc/tempest',
|
||||
help='path to tempest and stress tests config files')
|
||||
parser.add_argument('-d', '--duration', default=300, type=int,
|
||||
help="Duration of test in secs")
|
||||
parser.add_argument('-s', '--serial', action='store_true',
|
||||
|
@ -57,6 +57,7 @@ StressGroup = [
|
||||
' every project.')
|
||||
]
|
||||
|
||||
|
||||
class StressConfigPrivate(object):
|
||||
|
||||
DEFAULT_CONFIG_FILE = "stress_tests.conf"
|
||||
@ -66,7 +67,8 @@ class StressConfigPrivate(object):
|
||||
super(StressConfigPrivate, self).__init__()
|
||||
|
||||
# Environment variables override defaults.
|
||||
conf_file = os.environ.get('STRESS_TEST_CONFIG', self.DEFAULT_CONFIG_FILE)
|
||||
conf_file = os.environ.get('STRESS_TEST_CONFIG',
|
||||
self.DEFAULT_CONFIG_FILE)
|
||||
conf_path = ''
|
||||
if config_path:
|
||||
config_path + '/' + self.DEFAULT_CONFIG_FILE
|
||||
@ -93,6 +95,7 @@ class StressConfigPrivate(object):
|
||||
class StressConfigProxy(object):
|
||||
_config = None
|
||||
_path = None
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if not self._config:
|
||||
self._config = StressConfigPrivate(config_path=self._path)
|
||||
|
@ -2,7 +2,7 @@
|
||||
"threads": 8,
|
||||
"use_admin": true,
|
||||
"use_isolated_tenants": true,
|
||||
"kwargs": {"test_method": "tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_fake_action",
|
||||
"kwargs": {"test_method": "tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_stop_start"",
|
||||
"class_setup_per": "process"}
|
||||
}
|
||||
]
|
||||
|
@ -16,9 +16,8 @@ import abc
|
||||
import signal
|
||||
import sys
|
||||
|
||||
import six
|
||||
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
@ -13,9 +13,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
import tempest.test
|
||||
|
||||
import tempest_stress.stressaction as stressaction
|
||||
|
||||
|
||||
class FakeStressAction(stressaction.StressAction):
|
||||
def __init__(self, manager, max_runs=None, stop_on_error=False):
|
||||
|
@ -10,5 +10,4 @@ sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
|
||||
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testscenarios>=0.4 # Apache-2.0/BSD
|
||||
testtools>=1.4.0 # MIT
|
||||
|
5
tox.ini
5
tox.ini
@ -13,13 +13,12 @@ commands = python setup.py test --slowest --testr-args='{posargs}'
|
||||
|
||||
[testenv:stress]
|
||||
envdir = .tox/tempest_stress
|
||||
sitepackages = {[tempestenv]sitepackages}
|
||||
setenv = {[tempestenv]setenv}
|
||||
deps = {[tempestenv]deps}
|
||||
sitepackages = False
|
||||
commands =
|
||||
run-tempest-stress {posargs}
|
||||
|
||||
[testenv:pep8]
|
||||
sitepackages = False
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[testenv:venv]
|
||||
|
Loading…
Reference in New Issue
Block a user