functional tests: add 'run_ssh' parameter to config

and switch it off for nova-network. because nova-network is very unstable
in this.

Change-Id: I4e1e3c642ec77a9cfa4b1249da0a980336698a08
This commit is contained in:
Andrey Pavlov 2015-10-29 12:24:29 +03:00
parent 08ad73786d
commit 7fc44d5c4e
6 changed files with 12 additions and 13 deletions

View File

@ -87,6 +87,9 @@ AWSGroup = [
cfg.StrOpt('ami_image_location',
default=None,
help="S3 URL with manifest of AMI Machine Image."),
cfg.BoolOpt('run_ssh',
default=True,
help='Can block all tests that wants to ssh into instance.'),
]

View File

@ -17,7 +17,6 @@ import time
from oslo_log import log
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions
from ec2api.tests.functional import base
from ec2api.tests.functional import config
@ -130,15 +129,3 @@ class BaseScenarioTest(base.EC2TestCase):
self.get_network_interface_waiter().wait_available(ni_id)
return ni_id
def correct_ns_if_needed(self, ssh_client):
try:
ssh_client.exec_command("host www.com")
except exceptions.SSHExecCommandFailed:
LOG.exception('Can`t resolve www.com. Fixing resolv.conf')
LOG.warning(ssh_client.exec_command("cat /etc/resolv.conf"))
LOG.warning(ssh_client.exec_command("ping -c 1 8.8.8.8 1>&2"))
# NOTE(apavlov) update nameservers (mandatory for local devstack)
ssh_client.exec_command("sudo su -c 'echo nameserver 8.8.8.8 "
"> /etc/resolv.conf'")
ssh_client.exec_command("host www.com")

View File

@ -28,6 +28,7 @@ LOG = log.getLogger(__name__)
class InstanceRestartTest(scenario_base.BaseScenarioTest):
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.')
@testtools.skipUnless(CONF.aws.image_id_ubuntu,
"ubuntu image id is not defined")
@ -59,6 +60,7 @@ class InstanceRestartTest(scenario_base.BaseScenarioTest):
data = ssh_client.exec_command('last -x')
self.assertIn("shutdown", data)
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.')
@testtools.skipUnless(CONF.aws.image_id_ubuntu,
"ubuntu image id is not defined")

View File

@ -71,6 +71,7 @@ PUBLIC_KEY_MATERIAL = (
class InstancesTest(scenario_base.BaseScenarioTest):
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
def test_metadata(self):
key_name = data_utils.rand_name('testkey')
@ -107,6 +108,7 @@ class InstancesTest(scenario_base.BaseScenarioTest):
'curl %s/latest/meta-data/public-keys/0/openssh-key' % url)
self.assertEqual(PUBLIC_KEY_MATERIAL, data)
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
def test_compare_console_output(self):
key_name = data_utils.rand_name('testkey')
@ -134,6 +136,7 @@ class InstancesTest(scenario_base.BaseScenarioTest):
waiter = base.EC2Waiter(_compare_console_output)
waiter.wait_no_exception()
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.ami_image_location, "Image is absent in S3")
def test_run_and_ping_registered_image(self):
image_name = data_utils.rand_name("ami-name")

View File

@ -59,16 +59,19 @@ class InstancesInVPCTest(scenario_base.BaseScenarioTest):
waiter.wait_no_exception('ping %s -c 1' % last_ip)
@base.skip_without_vpc()
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
def test_instances_in_min_subnet(self):
self._test_instances(28)
@base.skip_without_vpc()
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
def test_instances_in_max_subnet(self):
self._test_instances(16)
@base.skip_without_vpc()
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
def test_default_gateway(self):
novpc_group = self.create_standard_security_group()

View File

@ -65,6 +65,7 @@ class VpnTest(scenario_base.BaseScenarioTest):
self.assertEqual('active', route['State'])
self.assertEqual('EnableVgwRoutePropagation', route['Origin'])
@testtools.skipUnless(CONF.aws.run_ssh, 'SSH tests are disabled.')
@testtools.skipUnless(CONF.aws.run_long_tests, 'Slow test has skipped.')
@testtools.skipUnless(CONF.aws.image_id_ubuntu,
"ubuntu image id is not defined")