diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 780e48d8fa..aae4453505 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -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] diff --git a/stress/README.rst b/stress/README.rst index 00e3b90c6b..bf44f13ac0 100644 --- a/stress/README.rst +++ b/stress/README.rst @@ -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= host_admin_user= nova_logdir= + controller= The stress test needs the top-level tempest directory to be on PYTHONPATH if you are not using nosetests to run. diff --git a/stress/config.py b/stress/config.py index 3f107af823..0dce81662f 100755 --- a/stress/config.py +++ b/stress/config.py @@ -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) diff --git a/stress/test_servers.py b/stress/test_servers.py index 3f62ac3204..47d30b5250 100644 --- a/stress/test_servers.py +++ b/stress/test_servers.py @@ -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] diff --git a/stress/tests/create_kill.py b/stress/tests/create_kill.py index 1457279f8e..752f72dde1 100644 --- a/stress/tests/create_kill.py +++ b/stress/tests/create_kill.py @@ -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() diff --git a/stress/tests/hard_reboots.py b/stress/tests/hard_reboots.py index 503159e46a..f38ef6f818 100644 --- a/stress/tests/hard_reboots.py +++ b/stress/tests/hard_reboots.py @@ -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() diff --git a/stress/utils/util.py b/stress/utils/util.py index aac6c263a0..ac8f062930 100644 --- a/stress/utils/util.py +++ b/stress/utils/util.py @@ -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) diff --git a/tempest/tests/image/test_images.py b/tempest/tests/image/test_images.py index 70dec32083..8f75f08b07 100644 --- a/tempest/tests/image/test_images.py +++ b/tempest/tests/image/test_images.py @@ -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))