Merge "Add a tests for service clients"
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index 2b0f268..b08df97 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -89,7 +89,7 @@
@test.services('network')
def test_associate_ip_to_server_without_passing_floating_ip(self):
# Negative test:Association of empty floating IP to specific server
- # should raise NotFound exception
- self.assertRaises(exceptions.NotFound,
+ # should raise NotFound or BadRequest(In case of Nova V2.1) exception.
+ self.assertRaises((exceptions.NotFound, exceptions.BadRequest),
self.client.associate_floating_ip_to_server,
'', self.server_id)
diff --git a/tempest/cli/simple_read_only/compute/test_nova_manage.py b/tempest/cli/simple_read_only/compute/test_nova_manage.py
deleted file mode 100644
index 34ec671..0000000
--- a/tempest/cli/simple_read_only/compute/test_nova_manage.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# 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.
-
-from tempest_lib import exceptions
-
-from tempest import cli
-from tempest import config
-from tempest.openstack.common import log as logging
-
-
-CONF = config.CONF
-LOG = logging.getLogger(__name__)
-
-
-class SimpleReadOnlyNovaManageTest(cli.ClientTestBase):
-
- """
- This is a first pass at a simple read only nova-manage test. This
- only exercises client commands that are read only.
-
- This should test commands:
- * with and without optional parameters
- * initially just check return codes, and later test command outputs
-
- """
-
- @classmethod
- def resource_setup(cls):
- if not CONF.service_available.nova:
- msg = ("%s skipped as Nova is not available" % cls.__name__)
- raise cls.skipException(msg)
- if not CONF.cli.has_manage:
- msg = ("%s skipped as *-manage commands not available"
- % cls.__name__)
- raise cls.skipException(msg)
- super(SimpleReadOnlyNovaManageTest, cls).resource_setup()
-
- def nova_manage(self, *args, **kwargs):
- return self.clients.nova_manage(*args, **kwargs)
-
- def test_admin_fake_action(self):
- self.assertRaises(exceptions.CommandFailed,
- self.nova_manage,
- 'this-does-nova-exist')
-
- # NOTE(jogo): Commands in order listed in 'nova-manage -h'
-
- # test flags
- def test_help_flag(self):
- self.nova_manage('', '-h')
-
- def test_version_flag(self):
- # Bug 1159957: nova-manage --version writes to stderr
- self.assertNotEqual("", self.nova_manage('', '--version',
- merge_stderr=True))
- self.assertEqual(self.nova_manage('version'),
- self.nova_manage('', '--version', merge_stderr=True))
-
- def test_debug_flag(self):
- self.assertNotEqual("", self.nova_manage('service list',
- '--debug'))
-
- def test_verbose_flag(self):
- self.assertNotEqual("", self.nova_manage('service list',
- '--verbose'))
-
- # test actions
- def test_version(self):
- self.assertNotEqual("", self.nova_manage('version'))
-
- def test_db_sync(self):
- # make sure command doesn't error out
- self.nova_manage('db sync')
-
- def test_db_version(self):
- self.assertNotEqual("", self.nova_manage('db version'))
-
- def test_cell_list(self):
- # make sure command doesn't error out
- self.nova_manage('cell list')
-
- def test_host_list(self):
- # make sure command doesn't error out
- self.nova_manage('host list')
diff --git a/tempest/cli/simple_read_only/data_processing/test_sahara.py b/tempest/cli/simple_read_only/data_processing/test_sahara.py
index 1f2403c..c06c2c9 100644
--- a/tempest/cli/simple_read_only/data_processing/test_sahara.py
+++ b/tempest/cli/simple_read_only/data_processing/test_sahara.py
@@ -16,6 +16,7 @@
import re
from tempest_lib import exceptions
+import testtools
from tempest import cli
from tempest import config
@@ -59,8 +60,12 @@
'title'
])
+ @testtools.skipUnless(CONF.data_processing_feature_enabled.plugins,
+ 'No plugins defined')
def test_sahara_plugins_show(self):
- result = self.sahara('plugin-show', params='--name vanilla')
+ name_param = '--name %s' % \
+ (CONF.data_processing_feature_enabled.plugins[0])
+ result = self.sahara('plugin-show', params=name_param)
plugin = self.parser.listing(result)
self.assertTableStruct(plugin, [
'Property',
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index a7e0ee3..65a3a95 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -335,7 +335,7 @@
continue
results = verify_extensions(os, service, results)
- # Verify API verisons of all services in the keystone catalog and keystone
+ # Verify API versions of all services in the keystone catalog and keystone
# itself.
services.append('keystone')
for service in services:
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index 1a82e78..dc82217 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -60,7 +60,7 @@
self.sec_grp = self._create_security_group(tenant_id=self.tenant_id)
self.srv_kwargs = {
'key_name': self.keypair['name'],
- 'security_groups': [self.sec_grp]}
+ 'security_groups': [{'name': self.sec_grp['name']}]}
def prepare_network(self, address6_mode):
"""Creates network with
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index de6b0f9..83739fd 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -70,7 +70,7 @@
* test that cross-tenant traffic is enabled once an appropriate
rule has been created on destination tenant.
* test that reverse traffic is still blocked
- * test than revesre traffic is enabled once an appropriate rule has
+ * test than reverse traffic is enabled once an appropriate rule has
been created on source tenant
7._test_port_update_new_security_group:
* test that traffic is blocked with default security group
@@ -85,7 +85,7 @@
to it, and cross tenant check will be done on the private IP of the
destination tenant
or
- * not defined (empty string), in which case each tanant will have
+ * not defined (empty string), in which case each tenant will have
its own router connected to the public network
"""
@@ -466,7 +466,7 @@
def test_port_update_new_security_group(self):
"""
This test verifies the traffic after updating the vm port with new
- security group having appropiate rule.
+ security group having appropriate rule.
"""
new_tenant = self.primary_tenant
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index c7ee5f7..e92708c 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -57,7 +57,7 @@
'ipsecpolicies': 'vpn',
'vpnservices': 'vpn',
'ikepolicies': 'vpn',
- 'ipsecpolicies': 'vpn',
+ 'ipsec-site-connections': 'vpn',
'metering_labels': 'metering',
'metering_label_rules': 'metering',
'firewall_rules': 'fw',
@@ -85,7 +85,7 @@
'security_group_rules': 'security_group_rules',
'ipsecpolicy': 'ipsecpolicies',
'ikepolicy': 'ikepolicies',
- 'ipsecpolicy': 'ipsecpolicies',
+ 'ipsec_site_connection': 'ipsec-site-connections',
'quotas': 'quotas',
'firewall_policy': 'firewall_policies'
}
diff --git a/tox.ini b/tox.ini
index fe2f79e..2e8b509 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@
skipsdist = True
[tempestenv]
-sitepackages = True
+sitepackages = False
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./tempest/test_discover
deps = setuptools