Generalize configuration for controller access.

Add comment about libvirt resize.

Fix stress bug.

Change-Id: Ieb751abd24fb7a5bc4747550c465541ab2fbfc9e
This commit is contained in:
David Kranz 2012-03-20 16:25:47 -04:00
parent e7c423e8a2
commit 30fe84adbd
8 changed files with 22 additions and 17 deletions

View File

@ -21,6 +21,9 @@ build_interval=10
build_timeout=600
catalog_type=compute
create_image_enabled=true
# For resize to work with libvirt/kvm, one of the following must be true:
# Single node: allow_resize_to_same_host=True must be set in nova.conf
# Cluster: the 'nova' user must have scp access between cluster nodes
resize_available=true
[image]

View File

@ -23,14 +23,15 @@ Environment
------------
This particular framework assumes your working Nova cluster understands Nova
API 2.0. The stress tests can read the logs from the cluster. To enable this
you have to
provide the private key and user name for ssh to the cluster in the
you have to provide the hostname to call 'nova-manage' and
the private key and user name for ssh to the cluster in the
[stress] section of tempest.conf. You also need to provide the
value of --logdir in nova.conf:
host_private_key_path=<path to private ssh key>
host_admin_user=<name of user for ssh command>
nova_logdir=<value of --logdir in nova.conf>
controller=<hostname for calling nova-manage>
The stress test needs the top-level tempest directory to be on PYTHONPATH
if you are not using nosetests to run.

View File

@ -41,3 +41,8 @@ class StressConfig(object):
def nova_logdir(self):
"""Directory containing log files on the compute nodes"""
return self.get("nova_logdir", None)
@property
def controller(self):
"""Controller host"""
return self.get("controller", None)

View File

@ -57,7 +57,8 @@ class TestCreateVM(test_case.StressTestCase):
return None
_key_name = kwargs.get('key_name', '')
_timeout = int(kwargs.get('timeout', 60))
_timeout = int(kwargs.get('timeout',
manager.config.compute.build_timeout))
_image_ref = kwargs.get('image_ref', manager.config.compute.image_ref)
_flavor_ref = kwargs.get('flavor_ref',
manager.config.compute.flavor_ref)
@ -172,7 +173,7 @@ class TestKillActiveVM(test_case.StressTestCase):
self._logger.info('no ACTIVE instances to delete')
return
_timeout = kwargs.get('timeout', 600)
_timeout = kwargs.get('timeout', manager.config.compute.build_timeout)
target = random.choice(active_vms)
killtarget = target[0]
@ -240,7 +241,7 @@ class TestKillAnyVM(test_case.StressTestCase):
self._logger.info('no active instances to delete')
return
_timeout = kwargs.get('timeout', 60)
_timeout = kwargs.get('timeout', manager.config.compute.build_timeout)
target = random.choice(vms)
killtarget = target[0]
@ -276,7 +277,7 @@ class TestUpdateVMName(test_case.StressTestCase):
self._logger.info('no active instances to update')
return
_timeout = kwargs.get('timeout', 600)
_timeout = kwargs.get('timeout', manager.config.compute.build_timeout)
target = random.choice(active_vms)
update_target = target[0]

View File

@ -20,13 +20,8 @@ from stress.driver import *
from tempest import openstack
choice_spec = [
BasherAction(TestCreateVM(), 50,
kargs={'timeout': '600',
'image_ref': 2,
'flavor_ref': 1}
),
BasherAction(TestKillActiveVM(), 50,
kargs={'timeout': '600'})
BasherAction(TestCreateVM(), 50),
BasherAction(TestKillActiveVM(), 50)
]
nova = openstack.Manager()

View File

@ -21,10 +21,9 @@ from stress.driver import *
from tempest import openstack
choice_spec = [
BasherAction(TestCreateVM(), 50,
kargs={'timeout': '600'}),
BasherAction(TestCreateVM(), 50),
BasherAction(TestRebootVM(), 50,
kargs={'type': 'HARD'}),
kargs={'type': 'HARD'})
]
nova = openstack.Manager()

View File

@ -32,6 +32,7 @@ def scp(keypath, args):
def ssh(keypath, user, node, command, check=True):
command = 'sudo ' + command
command = "ssh %s %s@%s %s" % (get_ssh_options(keypath), user,
node, command)
popenargs = shlex.split(command)

View File

@ -202,4 +202,4 @@ class ListImagesTest(unittest.TestCase):
Simple test to see all fixture images returned
"""
images = self.client.get_images()
self.assertEqual(10, len(images) - len(cls.original_images))
self.assertEqual(10, len(images) - len(self.original_images))