Merge "Fix invalid URL in AccountClientCustomizedHeader"
diff --git a/HACKING.rst b/HACKING.rst
index 8fbc9bb..e57b670 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -213,8 +213,10 @@
Sample Configuration File
-------------------------
The sample config file is autogenerated using a script. If any changes are made
-to the config variables in tempest then the sample config file must be
-regenerated. This can be done running the script: tools/generate_sample.sh
+to the config variables in tempest/config.py then the sample config file must be
+regenerated. This can be done running::
+
+ tox -egenconfig
Unit Tests
----------
diff --git a/README.rst b/README.rst
index ea36619..5284bbf 100644
--- a/README.rst
+++ b/README.rst
@@ -79,8 +79,10 @@
document. The etc/tempest.conf.sample attempts to be a self
documenting version of the configuration.
-The sample config file is auto generated using the script:
-tools/generate_sample.sh
+To generate the sample tempest.conf file, run the following
+command from the top level of the tempest directory:
+
+ tox -egenconfig
The most important pieces that are needed are the user ids, openstack
endpoints, and basic flavors and images needed to run tests.
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 9a9952d..d5311a9 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -758,8 +758,10 @@
# value)
#public_network_id =
-# Id of the public router that provides external connectivity (string
-# value)
+# Id of the public router that provides external connectivity. This
+# should only be used when Neutron's 'allow_overlapping_ips' is set to
+# 'False' in neutron.conf. usually not needed past 'Grizzly' release
+# (string value)
#public_router_id =
# The network region name to use. If empty, the value of
diff --git a/requirements.txt b/requirements.txt
index ac72017..a856d09 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,20 +5,20 @@
anyjson>=0.3.3
httplib2>=0.7.5
jsonschema>=2.0.0,<3.0.0
-testtools>=0.9.34
+testtools>=0.9.36,!=1.2.0,!=1.4.0
lxml>=2.3
boto>=2.32.1
paramiko>=1.13.0
netaddr>=0.7.12
python-ceilometerclient>=1.0.6
python-glanceclient>=0.14.0
-python-keystoneclient>=0.10.0
+python-keystoneclient>=0.11.1
python-novaclient>=2.18.0
python-neutronclient>=2.3.6,<3
python-cinderclient>=1.1.0
python-heatclient>=0.2.9
python-ironicclient>=0.2.1
-python-saharaclient>=0.7.3
+python-saharaclient>=0.7.5
python-swiftclient>=2.2.0
testresources>=0.2.4
testrepository>=0.0.18
diff --git a/tempest/api/compute/admin/test_flavors_negative.py b/tempest/api/compute/admin/test_flavors_negative.py
index 3389aee..5bc3d10 100644
--- a/tempest/api/compute/admin/test_flavors_negative.py
+++ b/tempest/api/compute/admin/test_flavors_negative.py
@@ -58,7 +58,7 @@
resp, flavor = self.client.create_flavor(flavor_name,
self.ram,
self.vcpus, self.disk,
- '',
+ None,
ephemeral=self.ephemeral,
swap=self.swap,
rxtx=self.rxtx)
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index 6c29f51..a494896 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -14,11 +14,8 @@
# under the License.
from tempest.api.compute import base
-from tempest import config
from tempest import test
-CONF = config.CONF
-
class ServerAddressesTestJSON(base.BaseV2ComputeTest):
@@ -31,8 +28,6 @@
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
- @test.skip_because(bug="1210483",
- condition=CONF.service_available.neutron)
@test.attr(type='smoke')
@test.services('network')
def test_list_server_addresses(self):
diff --git a/tempest/api/compute/servers/test_servers_negative_new.py b/tempest/api/compute/servers/test_servers_negative_new.py
deleted file mode 100644
index 7fc2d4f..0000000
--- a/tempest/api/compute/servers/test_servers_negative_new.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2014 Red Hat, Inc & Deutsche Telekom AG
-# 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.api.compute import base
-from tempest.api_schema.request.compute.v2 import servers
-from tempest import test
-
-
-load_tests = test.NegativeAutoTest.load_tests
-
-
-@test.SimpleNegativeAutoTest
-class GetConsoleOutputNegativeTestJSON(base.BaseV2ComputeTest,
- test.NegativeAutoTest):
- _service = 'compute'
- _schema = servers.get_console_output
-
- @classmethod
- def resource_setup(cls):
- super(GetConsoleOutputNegativeTestJSON, cls).resource_setup()
- _resp, server = cls.create_test_server()
- cls.set_resource("server", server['id'])
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index 0590146..7b41d71 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -14,11 +14,8 @@
# under the License.
from tempest.api.compute import base
-from tempest import config
from tempest import test
-CONF = config.CONF
-
class ServerAddressesV3Test(base.BaseV3ComputeTest):
@@ -31,8 +28,6 @@
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
- @test.skip_because(bug="1210483",
- condition=CONF.service_available.neutron)
@test.attr(type='smoke')
def test_list_server_addresses(self):
# All public and private addresses for
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 2e58dae..5e6d8f3 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -84,6 +84,41 @@
self.assertEqual(self.network['id'], show_net['id'])
self.assertFalse(show_net['router:external'])
+ def test_delete_external_networks_with_floating_ip(self):
+ """Verifies external network can be deleted while still holding
+ (unassociated) floating IPs
+
+ """
+ # Set cls.client to admin to use base.create_subnet()
+ client = self.admin_client
+ _, body = client.create_network(**{'router:external': True})
+ external_network = body['network']
+ self.addCleanup(self._try_delete_resource,
+ client.delete_network,
+ external_network['id'])
+ subnet = self.create_subnet(external_network, client=client)
+ _, body = client.create_floatingip(
+ floating_network_id=external_network['id'])
+ created_floating_ip = body['floatingip']
+ self.addCleanup(self._try_delete_resource,
+ client.delete_floatingip,
+ created_floating_ip['id'])
+ _, floatingip_list = client.list_floatingips(
+ network=external_network['id'])
+ self.assertIn(created_floating_ip['id'],
+ (f['id'] for f in floatingip_list['floatingips']))
+ client.delete_network(external_network['id'])
+ # Verifies floating ip is deleted
+ _, floatingip_list = client.list_floatingips()
+ self.assertNotIn(created_floating_ip['id'],
+ (f['id'] for f in floatingip_list['floatingips']))
+ # Verifies subnet is deleted
+ _, subnet_list = client.list_subnets()
+ self.assertNotIn(subnet['id'],
+ (s['id'] for s in subnet_list))
+ # Removes subnet from the cleanup list
+ self.subnets.remove(subnet)
+
class ExternalNetworksTestXML(ExternalNetworksTestJSON):
_interface = 'xml'
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 7ba68f7..cd04ef7 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -93,58 +93,95 @@
if CONF.service_available.neutron:
# Clean up ipsec policies
for ipsecpolicy in cls.ipsecpolicies:
- cls.client.delete_ipsecpolicy(ipsecpolicy['id'])
+ cls._try_delete_resource(cls.client.delete_ipsecpolicy,
+ ipsecpolicy['id'])
# Clean up firewall policies
for fw_policy in cls.fw_policies:
- cls.client.delete_firewall_policy(fw_policy['id'])
+ cls._try_delete_resource(cls.client.delete_firewall_policy,
+ fw_policy['id'])
# Clean up firewall rules
for fw_rule in cls.fw_rules:
- cls.client.delete_firewall_rule(fw_rule['id'])
+ cls._try_delete_resource(cls.client.delete_firewall_rule,
+ fw_rule['id'])
# Clean up ike policies
for ikepolicy in cls.ikepolicies:
- cls.client.delete_ikepolicy(ikepolicy['id'])
+ cls._try_delete_resource(cls.client.delete_ikepolicy,
+ ikepolicy['id'])
# Clean up vpn services
for vpnservice in cls.vpnservices:
- cls.client.delete_vpnservice(vpnservice['id'])
+ cls._try_delete_resource(cls.client.delete_vpnservice,
+ vpnservice['id'])
# Clean up floating IPs
for floating_ip in cls.floating_ips:
- cls.client.delete_floatingip(floating_ip['id'])
+ cls._try_delete_resource(cls.client.delete_floatingip,
+ floating_ip['id'])
# Clean up routers
for router in cls.routers:
- cls.delete_router(router)
+ cls._try_delete_resource(cls.delete_router,
+ router)
# Clean up health monitors
for health_monitor in cls.health_monitors:
- cls.client.delete_health_monitor(health_monitor['id'])
+ cls._try_delete_resource(cls.client.delete_health_monitor,
+ health_monitor['id'])
# Clean up members
for member in cls.members:
- cls.client.delete_member(member['id'])
+ cls._try_delete_resource(cls.client.delete_member,
+ member['id'])
# Clean up vips
for vip in cls.vips:
- cls.client.delete_vip(vip['id'])
+ cls._try_delete_resource(cls.client.delete_vip,
+ vip['id'])
# Clean up pools
for pool in cls.pools:
- cls.client.delete_pool(pool['id'])
+ cls._try_delete_resource(cls.client.delete_pool,
+ pool['id'])
# Clean up metering label rules
for metering_label_rule in cls.metering_label_rules:
- cls.admin_client.delete_metering_label_rule(
+ cls._try_delete_resource(
+ cls.admin_client.delete_metering_label_rule,
metering_label_rule['id'])
# Clean up metering labels
for metering_label in cls.metering_labels:
- cls.admin_client.delete_metering_label(metering_label['id'])
+ cls._try_delete_resource(
+ cls.admin_client.delete_metering_label,
+ metering_label['id'])
# Clean up ports
for port in cls.ports:
- cls.client.delete_port(port['id'])
+ cls._try_delete_resource(cls.client.delete_port,
+ port['id'])
# Clean up subnets
for subnet in cls.subnets:
- cls.client.delete_subnet(subnet['id'])
+ cls._try_delete_resource(cls.client.delete_subnet,
+ subnet['id'])
# Clean up networks
for network in cls.networks:
- cls.client.delete_network(network['id'])
+ cls._try_delete_resource(cls.client.delete_network,
+ network['id'])
cls.clear_isolated_creds()
super(BaseNetworkTest, cls).resource_cleanup()
@classmethod
+ def _try_delete_resource(self, delete_callable, *args, **kwargs):
+ """Cleanup resources in case of test-failure
+
+ Some resources are explicitly deleted by the test.
+ If the test failed to delete a resource, this method will execute
+ the appropriate delete methods. Otherwise, the method ignores NotFound
+ exceptions thrown for resources that were correctly deleted by the
+ test.
+
+ :param delete_callable: delete method
+ :param args: arguments for delete method
+ :param kwargs: keyword arguments for delete method
+ """
+ try:
+ delete_callable(*args, **kwargs)
+ # if resource is not found, this means it was deleted in the test
+ except exceptions.NotFound:
+ pass
+
+ @classmethod
def create_network(cls, network_name=None):
"""Wrapper utility that returns a test network."""
network_name = network_name or data_utils.rand_name('test-network-')
@@ -156,8 +193,13 @@
@classmethod
def create_subnet(cls, network, gateway='', cidr=None, mask_bits=None,
- ip_version=None, **kwargs):
+ ip_version=None, client=None, **kwargs):
"""Wrapper utility that returns a test subnet."""
+
+ # allow tests to use admin client
+ if not client:
+ client = cls.client
+
# The cidr and mask_bits depend on the ip version.
ip_version = ip_version if ip_version is not None else cls._ip_version
gateway_not_set = gateway == ''
@@ -175,7 +217,7 @@
else:
gateway_ip = gateway
try:
- resp, body = cls.client.create_subnet(
+ resp, body = client.create_subnet(
network_id=network['id'],
cidr=str(subnet_cidr),
ip_version=ip_version,
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index c085c39..6a772f1 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -13,9 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
+import netaddr
+
from tempest.api.network import base
+from tempest import config
from tempest import test
+CONF = config.CONF
+
class AllowedAddressPairTestJSON(base.BaseNetworkTest):
_interface = 'json'
@@ -68,22 +73,50 @@
self._confirm_allowed_address_pair(port[0], self.ip_address)
@test.attr(type='smoke')
- def test_update_port_with_address_pair(self):
+ def _update_port_with_address(self, address, mac_address=None, **kwargs):
# Create a port without allowed address pair
_, body = self.client.create_port(network_id=self.network['id'])
port_id = body['port']['id']
self.addCleanup(self.client.delete_port, port_id)
-
- # Confirm port is created
- _, body = self.client.show_port(port_id)
+ if mac_address is None:
+ mac_address = self.mac_address
# Update allowed address pair attribute of port
- allowed_address_pairs = [{'ip_address': self.ip_address,
- 'mac_address': self.mac_address}]
+ allowed_address_pairs = [{'ip_address': address,
+ 'mac_address': mac_address}]
+ if kwargs:
+ allowed_address_pairs.append(kwargs['allowed_address_pairs'])
_, body = self.client.update_port(
port_id, allowed_address_pairs=allowed_address_pairs)
- newport = body['port']
- self._confirm_allowed_address_pair(newport, self.ip_address)
+ allowed_address_pair = body['port']['allowed_address_pairs']
+ self.assertEqual(allowed_address_pair, allowed_address_pairs)
+
+ @test.attr(type='smoke')
+ def test_update_port_with_address_pair(self):
+ # Update port with allowed address pair
+ self._update_port_with_address(self.ip_address)
+
+ @test.attr(type='smoke')
+ def test_update_port_with_cidr_address_pair(self):
+ # Update allowed address pair with cidr
+ cidr = str(netaddr.IPNetwork(CONF.network.tenant_network_cidr))
+ self._update_port_with_address(cidr)
+
+ @test.attr(type='smoke')
+ def test_update_port_with_multiple_ip_mac_address_pair(self):
+ # Create an ip _address and mac_address through port create
+ _, resp = self.client.create_port(network_id=self.network['id'])
+ newportid = resp['port']['id']
+ self.addCleanup(self.client.delete_port, newportid)
+ ipaddress = resp['port']['fixed_ips'][0]['ip_address']
+ macaddress = resp['port']['mac_address']
+
+ # Update allowed address pair port with multiple ip and mac
+ allowed_address_pairs = {'ip_address': ipaddress,
+ 'mac_address': macaddress}
+ self._update_port_with_address(
+ self.ip_address, self.mac_address,
+ allowed_address_pairs=allowed_address_pairs)
def _confirm_allowed_address_pair(self, port, ip):
msg = 'Port allowed address pairs should not be empty'
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index dd81a09..b9086cc 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -12,6 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+import itertools
import netaddr
import testtools
@@ -42,6 +43,7 @@
network update
subnet update
delete a network also deletes its subnets
+ list external networks
All subnet tests are run once with ipv4 and once with ipv6.
@@ -345,6 +347,28 @@
enable_dhcp=True,
**self.subnet_dict(['gateway', 'host_routes', 'dns_nameservers']))
+ @test.attr(type='smoke')
+ def test_external_network_visibility(self):
+ """Verifies user can see external networks but not subnets."""
+ _, body = self.client.list_networks(**{'router:external': True})
+ networks = [network['id'] for network in body['networks']]
+ self.assertNotEmpty(networks, "No external networks found")
+
+ nonexternal = [net for net in body['networks'] if
+ not net['router:external']]
+ self.assertEmpty(nonexternal, "Found non-external networks"
+ " in filtered list (%s)." % nonexternal)
+ self.assertIn(CONF.network.public_network_id, networks)
+
+ subnets_iter = (network['subnets'] for network in body['networks'])
+ # subnets_iter is a list (iterator) of lists. This flattens it to a
+ # list of UUIDs
+ public_subnets_iter = itertools.chain(*subnets_iter)
+ _, body = self.client.list_subnets()
+ subnets = [sub['id'] for sub in body['subnets']
+ if sub['id'] in public_subnets_iter]
+ self.assertEmpty(subnets, "Public subnets visible")
+
class NetworksTestXML(NetworksTestJSON):
_interface = 'xml'
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
index c61bf41..96b9804 100644
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ b/tempest/api/network/test_vpnaas_extensions.py
@@ -39,6 +39,7 @@
msg = "vpnaas extension not enabled."
raise cls.skipException(msg)
super(VPNaaSTestJSON, cls).resource_setup()
+ cls.ext_net_id = CONF.network.public_network_id
cls.network = cls.create_network()
cls.subnet = cls.create_subnet(cls.network)
cls.router = cls.create_router(
@@ -121,17 +122,21 @@
tenant_id = self._get_tenant_id()
# Create vpn service for the newly created tenant
+ network2 = self.create_network()
+ subnet2 = self.create_subnet(network2)
+ router2 = self.create_router(data_utils.rand_name('router-'),
+ external_network_id=self.ext_net_id)
+ self.create_router_interface(router2['id'], subnet2['id'])
name = data_utils.rand_name('vpn-service')
_, body = self.admin_client.create_vpnservice(
- subnet_id=self.subnet['id'],
- router_id=self.router['id'],
+ subnet_id=subnet2['id'],
+ router_id=router2['id'],
name=name,
admin_state_up=True,
tenant_id=tenant_id)
vpnservice = body['vpnservice']
self.assertIsNotNone(vpnservice['id'])
self.addCleanup(self.admin_client.delete_vpnservice, vpnservice['id'])
-
# Assert that created vpnservice is found in API list call
_, body = self.client.list_vpnservices()
vpn_services = [vs['id'] for vs in body['vpnservices']]
@@ -167,9 +172,14 @@
@test.attr(type='smoke')
def test_create_update_delete_vpn_service(self):
# Creates a VPN service and sets up deletion
- name = data_utils.rand_name('vpn-service')
- _, body = self.client.create_vpnservice(subnet_id=self.subnet['id'],
- router_id=self.router['id'],
+ network1 = self.create_network()
+ subnet1 = self.create_subnet(network1)
+ router1 = self.create_router(data_utils.rand_name('router-'),
+ external_network_id=self.ext_net_id)
+ self.create_router_interface(router1['id'], subnet1['id'])
+ name = data_utils.rand_name('vpn-service1')
+ _, body = self.client.create_vpnservice(subnet_id=subnet1['id'],
+ router_id=router1['id'],
name=name,
admin_state_up=True)
vpnservice = body['vpnservice']
diff --git a/tempest/api/object_storage/test_account_bulk.py b/tempest/api/object_storage/test_account_bulk.py
index 743f1aa..31a80cf 100644
--- a/tempest/api/object_storage/test_account_bulk.py
+++ b/tempest/api/object_storage/test_account_bulk.py
@@ -74,8 +74,6 @@
self.containers.append(container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
-
# When uploading an archived file with the bulk operation, the response
# does not contain 'content-length' header. This is the special case,
# therefore the existence of response headers is checked without
@@ -91,7 +89,6 @@
param = {'format': 'json'}
resp, body = self.account_client.list_account_containers(param)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertIn(container_name, [b['name'] for b in body])
@@ -100,7 +97,6 @@
resp, contents_list = self.container_client.list_container_contents(
container_name, param)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertIn(object_name, [c['name'] for c in contents_list])
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index 97e9195..e75e971 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -83,7 +83,6 @@
resp, _ = self.object_client.create_object(self.container_name,
object_name, data)
- self.assertEqual(resp["status"], "201")
self.assertHeaders(resp, 'Object', 'PUT')
@test.attr(type=["smoke"])
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index a0436ee..2bc4f59 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -67,7 +67,6 @@
resp, container_list = \
os_test_user.account_client.list_account_containers()
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# When sending a request to an account which has not received a PUT
# container request, the response does not contain 'accept-ranges'
@@ -93,7 +92,6 @@
params = {'format': 'json'}
resp, container_list = self.account_client.list_account_containers(
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertIsNotNone(container_list)
self.assertTrue([c['name'] for c in container_list])
@@ -106,7 +104,6 @@
params = {'format': 'xml'}
resp, container_list = self.account_client.list_account_containers(
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertIsNotNone(container_list)
self.assertEqual(container_list.tag, 'account')
@@ -123,7 +120,6 @@
def test_list_extensions(self):
resp, extensions = self.account_client.list_extensions()
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertThat(resp, custom_matchers.AreAllWellFormatted())
@test.attr(type='smoke')
@@ -182,7 +178,6 @@
'end_marker': self.containers[self.containers_count - 1]}
resp, container_list = self.account_client.list_account_containers(
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertEqual(len(container_list), self.containers_count - 2)
@@ -208,7 +203,6 @@
'end_marker': self.containers[self.containers_count / 2]}
resp, container_list = self.account_client.list_account_containers(
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertEqual(len(container_list),
min(limit, self.containers_count / 2))
@@ -222,7 +216,6 @@
'end_marker': self.containers[self.containers_count - 1]}
resp, container_list = self.account_client.list_account_containers(
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'GET')
self.assertEqual(len(container_list),
min(limit, self.containers_count - 2))
@@ -237,7 +230,6 @@
resp, _ = self.account_client.create_account_metadata(metadata)
resp, _ = self.account_client.list_account_metadata()
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'HEAD')
self.assertIn('x-account-meta-test-account-meta1', resp)
self.assertIn('x-account-meta-test-account-meta2', resp)
@@ -247,7 +239,6 @@
def test_list_no_account_metadata(self):
# list no account metadata
resp, _ = self.account_client.list_account_metadata()
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'HEAD')
self.assertNotIn('x-account-meta-', str(resp))
@@ -256,7 +247,6 @@
# add metadata to account
metadata = {'test-account-meta1': 'Meta1'}
resp, _ = self.account_client.create_account_metadata(metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'POST')
resp, body = self.account_client.list_account_metadata()
@@ -272,7 +262,6 @@
metadata = {'test-account-meta1': 'Meta1'}
self.account_client.create_account_metadata(metadata)
resp, _ = self.account_client.delete_account_metadata(metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'POST')
resp, _ = self.account_client.list_account_metadata()
@@ -284,7 +273,6 @@
# registered at a server
metadata = {'test-account-meta1': ''}
resp, _ = self.account_client.create_account_metadata(metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'POST')
resp, _ = self.account_client.list_account_metadata()
@@ -298,7 +286,6 @@
self.account_client.create_account_metadata(metadata_1)
metadata_2 = {'test-account-meta1': ''}
resp, _ = self.account_client.delete_account_metadata(metadata_2)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'POST')
resp, _ = self.account_client.list_account_metadata()
@@ -313,7 +300,6 @@
resp, body = self.account_client.create_and_delete_account_metadata(
metadata_2,
metadata_1)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Account', 'POST')
resp, _ = self.account_client.list_account_metadata()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index e816a9f..2244900 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -45,13 +45,11 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
object_name = data_utils.rand_name(name='Object')
resp, _ = self.object_client.create_object(self.container_name,
object_name, 'data')
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to read the object with rights
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -60,7 +58,6 @@
)
resp, _ = self.custom_object_client.get_object(
self.container_name, object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
@test.attr(type='smoke')
@@ -72,7 +69,6 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object with rights
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -83,5 +79,4 @@
resp, _ = self.custom_object_client.create_object(
self.container_name,
object_name, 'data')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index 9b49db3..fed4549 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -88,7 +88,6 @@
object_name = data_utils.rand_name(name='Object')
resp, _ = self.object_client.create_object(
self.container_name, object_name, 'data')
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# trying to get object with non authorized user token
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -106,7 +105,6 @@
object_name = data_utils.rand_name(name='Object')
resp, _ = self.object_client.create_object(
self.container_name, object_name, 'data')
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# trying to delete object with non-authorized user token
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -125,13 +123,11 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
object_name = data_utils.rand_name(name='Object')
resp, _ = self.object_client.create_object(self.container_name,
object_name, 'data')
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to read the object without rights
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -150,7 +146,6 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object without rights
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -173,7 +168,6 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object without write rights
self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -196,13 +190,11 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
object_name = data_utils.rand_name(name='Object')
resp, _ = self.object_client.create_object(self.container_name,
object_name, 'data')
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to delete the object without write rights
self.custom_object_client.auth_provider.set_alt_auth_data(
diff --git a/tempest/api/object_storage/test_container_quotas.py b/tempest/api/object_storage/test_container_quotas.py
index 59b84d9..46944ed 100644
--- a/tempest/api/object_storage/test_container_quotas.py
+++ b/tempest/api/object_storage/test_container_quotas.py
@@ -61,7 +61,6 @@
resp, _ = self.object_client.create_object(
self.container_name, object_name, data)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'PUT')
nafter = self._get_bytes_used()
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 8689d10..fe06fd0 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -51,7 +51,6 @@
container_name = data_utils.rand_name(name='TestContainer')
resp, body = self.container_client.create_container(container_name)
self.containers.append(container_name)
- self.assertIn(resp['status'], ('202', '201'))
self.assertHeaders(resp, 'Container', 'PUT')
@test.attr(type='smoke')
@@ -62,7 +61,6 @@
self.containers.append(container_name)
resp, _ = self.container_client.create_container(container_name)
- self.assertIn(resp['status'], ('202', '201'))
self.assertHeaders(resp, 'Container', 'PUT')
@test.attr(type='smoke')
@@ -74,7 +72,6 @@
container_name,
metadata=metadata)
self.containers.append(container_name)
- self.assertIn(resp['status'], ('201', '202'))
self.assertHeaders(resp, 'Container', 'PUT')
resp, _ = self.container_client.list_container_metadata(
@@ -93,7 +90,6 @@
container_name,
metadata=metadata)
self.containers.append(container_name)
- self.assertIn(resp['status'], ('201', '202'))
self.assertHeaders(resp, 'Container', 'PUT')
resp, _ = self.container_client.list_container_metadata(
@@ -116,7 +112,6 @@
resp, _ = self.container_client.create_container(
container_name,
remove_metadata=metadata_2)
- self.assertIn(resp['status'], ('201', '202'))
self.assertHeaders(resp, 'Container', 'PUT')
resp, _ = self.container_client.list_container_metadata(
@@ -135,7 +130,6 @@
resp, _ = self.container_client.create_container(
container_name,
remove_metadata=metadata)
- self.assertIn(resp['status'], ('201', '202'))
self.assertHeaders(resp, 'Container', 'PUT')
resp, _ = self.container_client.list_container_metadata(
@@ -146,11 +140,9 @@
def test_delete_container(self):
# create a container
container_name = self._create_container()
- # delete container
+ # delete container, success asserted within
resp, _ = self.container_client.delete_container(container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'DELETE')
-
self.containers.remove(container_name)
@test.attr(type='smoke')
@@ -161,7 +153,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -172,7 +163,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual('', object_list.strip('\n'))
@@ -187,7 +177,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name.split('/')[0], object_list.strip('/\n'))
@@ -201,7 +190,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -215,7 +203,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertIsNotNone(object_list)
@@ -235,7 +222,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertIsNotNone(object_list)
@@ -260,7 +246,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -274,7 +259,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -289,7 +273,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -304,7 +287,6 @@
resp, object_list = self.container_client.list_container_contents(
container_name,
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'GET')
self.assertEqual(object_name, object_list.strip('\n'))
@@ -320,7 +302,6 @@
resp, _ = self.container_client.list_container_metadata(
container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'HEAD')
self.assertIn('x-container-meta-name', resp)
self.assertEqual(resp['x-container-meta-name'], metadata['name'])
@@ -332,7 +313,6 @@
resp, _ = self.container_client.list_container_metadata(
container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'HEAD')
self.assertNotIn('x-container-meta-', str(resp))
@@ -350,7 +330,6 @@
container_name,
metadata=metadata_2,
remove_metadata=metadata_1)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'POST')
resp, _ = self.container_client.list_container_metadata(
@@ -369,7 +348,6 @@
resp, _ = self.container_client.update_container_metadata(
container_name,
metadata=metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'POST')
resp, _ = self.container_client.list_container_metadata(
@@ -390,7 +368,6 @@
resp, _ = self.container_client.delete_container_metadata(
container_name,
metadata=metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'POST')
resp, _ = self.container_client.list_container_metadata(
@@ -406,7 +383,6 @@
resp, _ = self.container_client.update_container_metadata(
container_name,
metadata=metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'POST')
resp, _ = self.container_client.list_container_metadata(
@@ -426,7 +402,6 @@
resp, _ = self.container_client.delete_container_metadata(
container_name,
metadata=metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'POST')
resp, _ = self.container_client.list_container_metadata(container_name)
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 966a08d..5c4e0bf 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -67,7 +67,6 @@
# we should retrieve the self.object_name file
resp, body = self.custom_account_client.request("GET",
self.container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# This request is equivalent to GET object
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, self.object_data)
@@ -92,7 +91,6 @@
# we should retrieve a listing of objects
resp, body = self.custom_account_client.request("GET",
self.container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# The target of the request is not any Swift resource. Therefore, the
# existence of response header is checked without a custom matcher.
self.assertIn('content-length', resp)
@@ -131,7 +129,6 @@
# we should retrieve a listing of objects
resp, body = self.custom_account_client.request("GET",
self.container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertIn(self.object_name, body)
css = '<link rel="stylesheet" type="text/css" href="listings.css" />'
self.assertIn(css, body)
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index aebcb5c..a50e392 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -90,12 +90,10 @@
(client_base_url, str(cont[1]))}
resp, body = \
cont_client[0].put(str(cont[0]), body=None, headers=headers)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# create object in container
object_name = data_utils.rand_name(name='TestSyncObject')
data = object_name[::-1] # data_utils.arbitrary_string()
resp, _ = obj_client[0].create_object(cont[0], object_name, data)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.objects.append(object_name)
# wait until container contents list is not empty
@@ -108,7 +106,6 @@
cont_client[client_index].\
list_container_contents(self.containers[client_index],
params=params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
object_lists.append(dict(
(obj['name'], obj) for obj in object_list))
# check that containers are not empty and have equal keys()
@@ -128,5 +125,4 @@
for obj_client, cont in obj_clients:
for obj_name in object_lists[0]:
resp, object_content = obj_client.get_object(cont, obj_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertEqual(object_content, obj_name[::-1])
diff --git a/tempest/api/object_storage/test_crossdomain.py b/tempest/api/object_storage/test_crossdomain.py
index f6d1fb9..66e8176 100644
--- a/tempest/api/object_storage/test_crossdomain.py
+++ b/tempest/api/object_storage/test_crossdomain.py
@@ -43,7 +43,6 @@
def test_get_crossdomain_policy(self):
resp, body = self.account_client.get("crossdomain.xml", {})
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertTrue(body.startswith(self.xml_start) and
body.endswith(self.xml_end))
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index a1138e6..53c0347 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -36,9 +36,6 @@
resp, _ = self.account_client.get("healthcheck", {})
- # The status is expected to be 200
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
-
# The target of the request is not any Swift resource. Therefore, the
# existence of response header is checked without a custom matcher.
self.assertIn('content-length', resp)
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 8cec2fc..5fa209d 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -51,7 +51,6 @@
resp, _ = \
self.object_client.list_object_metadata(self.container_name,
self.object_name)
- self.assertEqual(resp['status'], '200')
self.assertHeaders(resp, 'Object', 'HEAD')
self.assertIn('x-delete-at', resp)
# we want to ensure that we will sleep long enough for things to
@@ -60,7 +59,6 @@
resp, body = self.object_client.get_object(self.container_name,
self.object_name)
- self.assertEqual(resp['status'], '200')
self.assertHeaders(resp, 'Object', 'GET')
self.assertIn('x-delete-at', resp)
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index 05c8ff2..7a9fcf6 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -117,12 +117,10 @@
url = "%s/%s" % (self.container_name, self.object_name)
resp, body = self.object_client.post(url, body, headers=headers)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, "Object", "POST")
# Ensure object is available
resp, body = self.object_client.get("%s/%s%s" % (
self.container_name, self.object_name, "testfile"))
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, "Object", "GET")
self.assertEqual(body, "hello world")
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 56ab1fb..f78220c 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -60,7 +60,6 @@
for i in six.moves.xrange(segments):
resp, _ = self.object_client.create_object_segments(
self.container_name, object_name, i, data_segments[i])
- self.assertEqual(resp['status'], '201')
return object_name, data_segments
@@ -97,7 +96,6 @@
data = data_utils.arbitrary_string()
resp, _ = self.object_client.create_object(self.container_name,
object_name, data)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# check uploaded content
@@ -117,7 +115,6 @@
object_name,
data,
metadata=metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(
@@ -144,7 +141,6 @@
object_name,
data,
metadata=metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# download compressed object
@@ -168,7 +164,6 @@
object_name,
data,
metadata=metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# check uploaded content
@@ -212,7 +207,6 @@
name=object_name,
contents=StringIO.StringIO(data),
chunk_size=512)
- self.assertEqual(status, 201)
self.assertHeaders(resp_headers, 'Object', 'PUT')
# check uploaded content
@@ -239,7 +233,6 @@
object_name,
'',
metadata=metadata_2)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(self.container_name,
@@ -258,7 +251,6 @@
object_name,
data,
metadata=metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(self.container_name,
@@ -278,7 +270,6 @@
object_name,
data,
metadata=metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(self.container_name,
@@ -303,7 +294,6 @@
object_name,
data,
metadata=metadata_remove)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(self.container_name,
@@ -327,7 +317,6 @@
object_name,
data,
metadata=metadata_remove)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
resp, body = self.object_client.get_object(self.container_name,
@@ -345,7 +334,6 @@
# delete object
resp, _ = self.object_client.delete_object(self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'DELETE')
@test.attr(type='smoke')
@@ -359,7 +347,6 @@
object_name,
metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -384,7 +371,6 @@
object_name,
update_metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -410,7 +396,6 @@
object_name,
update_metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -439,7 +424,6 @@
object_name,
update_metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -458,7 +442,6 @@
object_name,
update_metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -484,7 +467,6 @@
object_name,
update_metadata,
metadata_prefix='')
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
resp, _ = self.object_client.list_object_metadata(
@@ -506,7 +488,6 @@
resp, _ = self.object_client.list_object_metadata(
self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'HEAD')
self.assertIn('x-object-meta-test-meta', resp)
self.assertEqual(resp['x-object-meta-test-meta'], 'Meta')
@@ -519,7 +500,6 @@
resp, _ = self.object_client.list_object_metadata(
self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'HEAD')
self.assertNotIn('x-object-meta-', str(resp))
@@ -542,7 +522,6 @@
resp, _ = self.object_client.list_object_metadata(
self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# Check only the existence of common headers with custom matcher
self.assertThat(resp, custom_matchers.ExistsAllResponseHeaders(
@@ -573,7 +552,6 @@
# get object
resp, body = self.object_client.get_object(self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -592,7 +570,6 @@
self.container_name,
object_name,
metadata=None)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertIn('x-object-meta-test-meta', resp)
self.assertEqual(resp['x-object-meta-test-meta'], 'Meta')
@@ -613,7 +590,6 @@
self.container_name,
object_name,
metadata=metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data[rand_num - 3: rand_num])
@@ -637,7 +613,6 @@
self.container_name,
object_name,
metadata=None)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
# Check only the existence of common headers with custom matcher
self.assertThat(resp, custom_matchers.ExistsAllResponseHeaders(
@@ -678,7 +653,6 @@
self.container_name,
object_name,
metadata=list_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -699,7 +673,6 @@
self.container_name,
object_name,
metadata=list_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -721,7 +694,6 @@
self.container_name,
object_name,
metadata=list_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -737,7 +709,6 @@
self.container_name,
object_name,
metadata=list_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -751,7 +722,6 @@
self.container_name,
object_name,
metadata=list_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, data)
@@ -774,7 +744,6 @@
# copy source object to destination
resp, _ = self.object_client.copy_object_in_same_container(
self.container_name, src_object_name, dst_object_name)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# check data
@@ -796,7 +765,6 @@
self.assertNotEqual(resp_tmp['content-type'], metadata['content-type'])
resp, _ = self.object_client.copy_object_in_same_container(
self.container_name, object_name, object_name, metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# check the content type
@@ -822,7 +790,6 @@
resp, _ = self.object_client.copy_object_2d_way(self.container_name,
src_object_name,
dst_object_name)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'COPY')
self.assertEqual(
resp['x-copied-from'],
@@ -855,14 +822,12 @@
resp, _ = self.object_client.update_object_metadata(src_container_name,
object_name,
orig_metadata)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'POST')
# copy object from source container to destination container
resp, _ = self.object_client.copy_object_across_containers(
src_container_name, object_name, dst_container_name,
object_name)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# check if object is present in destination container
@@ -884,7 +849,6 @@
dst_object_name, resp = self._copy_object_2d(src_object_name,
metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'COPY')
self.assertNotIn('x-object-meta-src', resp)
@@ -904,7 +868,6 @@
metadata = {'x-object-meta-test': ''}
dst_obj_name, resp = self._copy_object_2d(src_obj_name, metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'COPY')
expected = {'x-object-meta-test': '',
@@ -927,7 +890,6 @@
metadata = {'x-object-meta-test': 'value'}
dst_obj_name, resp = self._copy_object_2d(src_obj_name, metadata)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'COPY')
expected = {'x-object-meta-test': 'value',
@@ -951,7 +913,6 @@
for i in six.moves.xrange(segments):
resp, _ = self.object_client.create_object_segments(
self.container_name, object_name, i, data_segments[i])
- self.assertEqual(resp['status'], '201')
# creating a manifest file
metadata = {'X-Object-Manifest': '%s/%s/'
% (self.container_name, object_name)}
@@ -1012,7 +973,6 @@
md5 = hashlib.md5(local_data).hexdigest()
headers = {'If-None-Match': md5}
resp, body = self.object_client.get(url, headers=headers)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
@@ -1035,7 +995,6 @@
cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers, metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
@@ -1044,13 +1003,11 @@
base_text=object_name)
resp, _ = self.object_client.create_object(self.container_name,
object_name, data)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# list container metadata
resp_meta, _ = self.container_client.list_container_metadata(
self.container_name)
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'HEAD')
self.assertIn('x-container-read', resp_meta)
@@ -1075,7 +1032,6 @@
resp_meta, body = self.container_client.update_container_metadata(
self.container_name, metadata=cont_headers,
metadata_prefix='')
- self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp_meta, 'Container', 'POST')
# create object
@@ -1084,13 +1040,11 @@
base_text=object_name)
resp, _ = self.object_client.create_object(self.container_name,
object_name, data)
- self.assertEqual(resp['status'], '201')
self.assertHeaders(resp, 'Object', 'PUT')
# list container metadata
resp, _ = self.container_client.list_container_metadata(
self.container_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Container', 'HEAD')
self.assertIn('x-container-read', resp)
diff --git a/tempest/api/object_storage/test_object_slo.py b/tempest/api/object_storage/test_object_slo.py
index 159ad5c..6622349 100644
--- a/tempest/api/object_storage/test_object_slo.py
+++ b/tempest/api/object_storage/test_object_slo.py
@@ -120,7 +120,6 @@
manifest,
params)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self._assertHeadersSLO(resp, 'PUT')
@test.attr(type='gate')
@@ -132,7 +131,6 @@
self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self._assertHeadersSLO(resp, 'HEAD')
@test.attr(type='gate')
@@ -144,7 +142,6 @@
self.container_name,
object_name)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self._assertHeadersSLO(resp, 'GET')
sum_data = self.content + self.content
@@ -161,8 +158,6 @@
object_name,
params=params_del)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
-
# When deleting SLO using multipart manifest, the response contains
# not 'content-length' but 'transfer-encoding' header. This is the
# special case, therefore the existence of response headers is checked
diff --git a/tempest/api/object_storage/test_object_temp_url.py b/tempest/api/object_storage/test_object_temp_url.py
index e70bd9a..dd4fd17 100644
--- a/tempest/api/object_storage/test_object_temp_url.py
+++ b/tempest/api/object_storage/test_object_temp_url.py
@@ -105,13 +105,11 @@
# trying to get object using temp url within expiry time
resp, body = self.object_client.get(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, self.content)
# Testing a HEAD on this Temp URL
resp, body = self.object_client.head(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'HEAD')
@test.attr(type='gate')
@@ -136,7 +134,6 @@
self.object_name, "GET",
expires, key2)
resp, body = self.object_client.get(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertEqual(body, self.content)
@test.attr(type='gate')
@@ -153,12 +150,10 @@
# trying to put random data in the object using temp url
resp, body = self.object_client.put(url, new_data, None)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'PUT')
# Testing a HEAD on this Temp URL
resp, body = self.object_client.head(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'HEAD')
# Validate that the content of the object has been modified
@@ -181,7 +176,6 @@
# Testing a HEAD on this Temp URL
resp, body = self.object_client.head(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'HEAD')
@test.attr(type='gate')
@@ -196,7 +190,6 @@
# trying to get object using temp url within expiry time
resp, body = self.object_client.get(url)
- self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, self.content)
self.assertEqual(resp['content-disposition'], 'inline')
diff --git a/tempest/api/object_storage/test_object_version.py b/tempest/api/object_storage/test_object_version.py
index 5fe4fc8..da40e5a 100644
--- a/tempest/api/object_storage/test_object_version.py
+++ b/tempest/api/object_storage/test_object_version.py
@@ -36,7 +36,6 @@
def assertContainer(self, container, count, byte, versioned):
resp, _ = self.container_client.list_container_metadata(container)
- self.assertEqual(resp['status'], ('204'))
self.assertHeaders(resp, 'Container', 'HEAD')
header_value = resp.get('x-container-object-count', 'Missing Header')
self.assertEqual(header_value, count)
@@ -55,7 +54,6 @@
resp, body = self.container_client.create_container(
vers_container_name)
self.containers.append(vers_container_name)
- self.assertIn(resp['status'], ('202', '201'))
self.assertHeaders(resp, 'Container', 'PUT')
self.assertContainer(vers_container_name, '0', '0', 'Missing Header')
@@ -66,7 +64,6 @@
metadata=headers,
metadata_prefix='')
self.containers.append(base_container_name)
- self.assertIn(resp['status'], ('202', '201'))
self.assertHeaders(resp, 'Container', 'PUT')
self.assertContainer(base_container_name, '0', '0',
vers_container_name)
diff --git a/tempest/api/volume/admin/test_volume_hosts.py b/tempest/api/volume/admin/test_volume_hosts.py
index 017363d..c92a60c 100644
--- a/tempest/api/volume/admin/test_volume_hosts.py
+++ b/tempest/api/volume/admin/test_volume_hosts.py
@@ -17,7 +17,7 @@
from tempest import test
-class VolumeHostsAdminTestsJSON(base.BaseVolumeV1AdminTest):
+class VolumeHostsAdminV2TestsJSON(base.BaseVolumeAdminTest):
_interface = "json"
@test.attr(type='gate')
@@ -27,5 +27,9 @@
"response of list hosts is: % s" % hosts)
-class VolumeHostsAdminTestsXML(VolumeHostsAdminTestsJSON):
+class VolumeHostsAdminV1TestsJSON(VolumeHostsAdminV2TestsJSON):
+ _api_version = 1
+
+
+class VolumeHostsAdminV1TestsXML(VolumeHostsAdminV1TestsJSON):
_interface = 'xml'
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 1189c8f..6e45b0f 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -71,7 +71,7 @@
@test.attr(type='gate')
def test_show_quota_usage(self):
_, quota_usage = self.quotas_client.get_quota_usage(
- self.os_adm.credentials.tenant_name)
+ self.os_adm.credentials.tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quota_usage)
for usage_key in QUOTA_USAGE_KEYS:
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index a0792f1..a481224 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -21,7 +21,7 @@
CONF = config.CONF
-class VolumeTypesTest(base.BaseVolumeV1AdminTest):
+class VolumeTypesV2Test(base.BaseVolumeAdminTest):
_interface = "json"
def _delete_volume(self, volume_id):
@@ -43,6 +43,7 @@
volume = {}
vol_name = data_utils.rand_name("volume-")
vol_type_name = data_utils.rand_name("volume-type-")
+ self.name_field = self.special_fields['name_field']
proto = CONF.volume.storage_protocol
vendor = CONF.volume.vendor_name
extra_specs = {"storage_protocol": proto,
@@ -54,21 +55,20 @@
self.assertIn('id', body)
self.addCleanup(self._delete_volume_type, body['id'])
self.assertIn('name', body)
+ params = {self.name_field: vol_name, 'volume_type': vol_type_name}
_, volume = self.volumes_client.create_volume(
- size=1, display_name=vol_name,
- volume_type=vol_type_name)
+ size=1, **params)
self.assertIn('id', volume)
self.addCleanup(self._delete_volume, volume['id'])
- self.assertIn('display_name', volume)
- self.assertEqual(volume['display_name'], vol_name,
+ self.assertIn(self.name_field, volume)
+ self.assertEqual(volume[self.name_field], vol_name,
"The created volume name is not equal "
"to the requested name")
self.assertTrue(volume['id'] is not None,
"Field volume id is empty or not found.")
- self.volumes_client.wait_for_volume_status(volume['id'],
- 'available')
+ self.volumes_client.wait_for_volume_status(volume['id'], 'available')
_, fetched_volume = self.volumes_client.get_volume(volume['id'])
- self.assertEqual(vol_name, fetched_volume['display_name'],
+ self.assertEqual(vol_name, fetched_volume[self.name_field],
'The fetched Volume is different '
'from the created Volume')
self.assertEqual(volume['id'], fetched_volume['id'],
@@ -154,3 +154,7 @@
self.volume_types_client.get_encryption_type(
encryption_type['volume_type_id']))
self.assertEmpty(deleted_encryption_type)
+
+
+class VolumeTypesV1Test(VolumeTypesV2Test):
+ _api_version = 1
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index a4d6431..9c9913f 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -20,16 +20,18 @@
from tempest import test
-class VolumeTypesNegativeTest(base.BaseVolumeV1AdminTest):
+class VolumeTypesNegativeV2Test(base.BaseVolumeAdminTest):
_interface = 'json'
@test.attr(type='gate')
def test_create_with_nonexistent_volume_type(self):
# Should not be able to create volume with nonexistent volume_type.
+ self.name_field = self.special_fields['name_field']
+ params = {self.name_field: str(uuid.uuid4()),
+ 'volume_type': str(uuid.uuid4())}
self.assertRaises(exceptions.NotFound,
self.volumes_client.create_volume, size=1,
- display_name=str(uuid.uuid4()),
- volume_type=str(uuid.uuid4()))
+ **params)
@test.attr(type='gate')
def test_create_with_empty_name(self):
@@ -52,5 +54,9 @@
str(uuid.uuid4()))
-class VolumesTypesNegativeTestXML(VolumeTypesNegativeTest):
+class VolumeTypesNegativeV1Test(VolumeTypesNegativeV2Test):
+ _api_version = 1
+
+
+class VolumeTypesNegativeV1TestXML(VolumeTypesNegativeV1Test):
_interface = 'xml'
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 8170cbf..638f76c 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -165,7 +165,6 @@
cls.qos_specs = []
- cls.hosts_client = cls.os_adm.volume_hosts_client
cls.quotas_client = cls.os_adm.volume_quotas_client
if cls._api_version == 1:
@@ -175,6 +174,7 @@
cls.volume_qos_client = cls.os_adm.volume_qos_client
cls.volume_types_client = cls.os_adm.volume_types_client
cls.admin_volume_client = cls.os_adm.volumes_client
+ cls.hosts_client = cls.os_adm.volume_hosts_client
elif cls._api_version == 2:
if not CONF.volume_feature_enabled.api_v2:
msg = "Volume API v2 is disabled"
@@ -182,6 +182,7 @@
cls.volume_qos_client = cls.os_adm.volume_qos_v2_client
cls.volume_types_client = cls.os_adm.volume_types_v2_client
cls.admin_volume_client = cls.os_adm.volumes_v2_client
+ cls.hosts_client = cls.os_adm.volume_hosts_v2_client
@classmethod
def resource_cleanup(cls):
diff --git a/tempest/cli/simple_read_only/network/test_neutron.py b/tempest/cli/simple_read_only/network/test_neutron.py
index 2b3920d..6090882 100644
--- a/tempest/cli/simple_read_only/network/test_neutron.py
+++ b/tempest/cli/simple_read_only/network/test_neutron.py
@@ -162,6 +162,42 @@
'allocation_pools'])
@test.attr(type='smoke')
+ @test.requires_ext(extension='vpnaas', service='network')
+ def test_neutron_vpn_ikepolicy_list(self):
+ ikepolicy = self.parser.listing(self.neutron('vpn-ikepolicy-list'))
+ self.assertTableStruct(ikepolicy, ['id', 'name',
+ 'auth_algorithm',
+ 'encryption_algorithm',
+ 'ike_version', 'pfs'])
+
+ @test.attr(type='smoke')
+ @test.requires_ext(extension='vpnaas', service='network')
+ def test_neutron_vpn_ipsecpolicy_list(self):
+ ipsecpolicy = self.parser.listing(self.neutron('vpn-ipsecpolicy-list'))
+ self.assertTableStruct(ipsecpolicy, ['id', 'name',
+ 'auth_algorithm',
+ 'encryption_algorithm',
+ 'pfs'])
+
+ @test.attr(type='smoke')
+ @test.requires_ext(extension='vpnaas', service='network')
+ def test_neutron_vpn_service_list(self):
+ vpn_list = self.parser.listing(self.neutron('vpn-service-list'))
+ self.assertTableStruct(vpn_list, ['id', 'name',
+ 'router_id', 'status'])
+
+ @test.attr(type='smoke')
+ @test.requires_ext(extension='vpnaas', service='network')
+ def test_neutron_ipsec_site_connection_list(self):
+ ipsec_site = self.parser.listing(self.neutron
+ ('ipsec-site-connection-list'))
+ self.assertTableStruct(ipsec_site, ['id', 'name',
+ 'peer_address',
+ 'peer_cidrs',
+ 'route_mode',
+ 'auth_mode', 'status'])
+
+ @test.attr(type='smoke')
def test_neutron_help(self):
help_text = self.neutron('help')
lines = help_text.split('\n')
diff --git a/tempest/cli/simple_read_only/volume/test_cinder.py b/tempest/cli/simple_read_only/volume/test_cinder.py
index 6e1e7d3..c2e0a42 100644
--- a/tempest/cli/simple_read_only/volume/test_cinder.py
+++ b/tempest/cli/simple_read_only/volume/test_cinder.py
@@ -20,6 +20,7 @@
import testtools
from tempest import cli
+from tempest import clients
from tempest import config
@@ -41,6 +42,9 @@
msg = ("%s skipped as Cinder is not available" % cls.__name__)
raise cls.skipException(msg)
super(SimpleReadOnlyCinderClientTest, cls).resource_setup()
+ id_cl = clients.AdminManager().identity_client
+ tenant = id_cl.get_tenant_by_name(CONF.identity.admin_tenant_name)
+ cls.admin_tenant_id = tenant['id']
def cinder(self, *args, **kwargs):
return self.clients.cinder(*args,
@@ -87,15 +91,13 @@
def test_cinder_quota_defaults(self):
"""This CLI can accept and string as param."""
roles = self.parser.listing(self.cinder('quota-defaults',
- params=CONF.identity.
- admin_tenant_name))
+ params=self.admin_tenant_id))
self.assertTableStruct(roles, ['Property', 'Value'])
def test_cinder_quota_show(self):
"""This CLI can accept and string as param."""
roles = self.parser.listing(self.cinder('quota-show',
- params=CONF.identity.
- admin_tenant_name))
+ params=self.admin_tenant_id))
self.assertTableStruct(roles, ['Property', 'Value'])
def test_cinder_rate_limits(self):
@@ -137,8 +139,7 @@
def test_cinder_service_list(self):
service_list = self.parser.listing(self.cinder('service-list'))
self.assertTableStruct(service_list, ['Binary', 'Host', 'Zone',
- 'Status', 'State', 'Updated_at',
- 'Disabled Reason'])
+ 'Status', 'State', 'Updated_at'])
def test_cinder_transfer_list(self):
transfer_list = self.parser.listing(self.cinder('transfer-list'))
diff --git a/tempest/clients.py b/tempest/clients.py
index 4269812..6f50730 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -181,6 +181,8 @@
from tempest.services.volume.json.qos_client import QosSpecsClientJSON
from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
from tempest.services.volume.json.volumes_client import VolumesClientJSON
+from tempest.services.volume.v2.json.admin.volume_hosts_client import \
+ VolumeHostsV2ClientJSON
from tempest.services.volume.v2.json.admin.volume_types_client import \
VolumeTypesV2ClientJSON
from tempest.services.volume.v2.json.availability_zone_client import \
@@ -230,22 +232,9 @@
# super cares for credentials validation
super(Manager, self).__init__(credentials=credentials)
+ self._set_compute_clients(self.interface)
+
if self.interface == 'xml':
- self.certificates_client = CertificatesClientXML(
- self.auth_provider)
- self.servers_client = ServersClientXML(self.auth_provider)
- self.limits_client = LimitsClientXML(self.auth_provider)
- self.images_client = ImagesClientXML(self.auth_provider)
- self.keypairs_client = KeyPairsClientXML(self.auth_provider)
- self.quotas_client = QuotasClientXML(self.auth_provider)
- self.quota_classes_client = QuotaClassesClientXML(
- self.auth_provider)
- self.flavors_client = FlavorsClientXML(self.auth_provider)
- self.extensions_client = ExtensionsClientXML(self.auth_provider)
- self.volumes_extensions_client = VolumesExtensionsClientXML(
- self.auth_provider)
- self.floating_ips_client = FloatingIPsClientXML(
- self.auth_provider)
self.backups_client = BackupsClientXML(self.auth_provider)
self.snapshots_client = SnapshotsClientXML(self.auth_provider)
self.snapshots_v2_client = SnapshotsV2ClientXML(self.auth_provider)
@@ -256,29 +245,15 @@
self.identity_client = IdentityClientXML(self.auth_provider)
self.identity_v3_client = IdentityV3ClientXML(
self.auth_provider)
- self.security_groups_client = SecurityGroupsClientXML(
- self.auth_provider)
- self.interfaces_client = InterfacesClientXML(self.auth_provider)
self.endpoints_client = EndPointClientXML(self.auth_provider)
- self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
- self.availability_zone_client = AvailabilityZoneClientXML(
- self.auth_provider)
self.service_client = ServiceClientXML(self.auth_provider)
self.volume_services_client = VolumesServicesClientXML(
self.auth_provider)
- self.aggregates_client = AggregatesClientXML(self.auth_provider)
- self.services_client = ServicesClientXML(self.auth_provider)
- self.tenant_usages_client = TenantUsagesClientXML(
- self.auth_provider)
self.policy_client = PolicyClientXML(self.auth_provider)
self.region_client = RegionClientXML(self.auth_provider)
- self.hosts_client = HostsClientXML(self.auth_provider)
- self.hypervisor_client = HypervisorClientXML(self.auth_provider)
self.network_client = NetworkClientXML(self.auth_provider)
self.credentials_client = CredentialsClientXML(
self.auth_provider)
- self.instance_usages_audit_log_client = \
- InstanceUsagesAuditLogClientXML(self.auth_provider)
self.volume_hosts_client = VolumeHostsClientXML(
self.auth_provider)
self.volume_quotas_client = VolumeQuotasClientXML(
@@ -299,32 +274,7 @@
VolumeV2AvailabilityZoneClientXML(self.auth_provider)
elif self.interface == 'json':
- self.certificates_client = CertificatesClientJSON(
- self.auth_provider)
- self.certificates_v3_client = CertificatesV3ClientJSON(
- self.auth_provider)
self.baremetal_client = BaremetalClientJSON(self.auth_provider)
- self.servers_client = ServersClientJSON(self.auth_provider)
- self.servers_v3_client = ServersV3ClientJSON(self.auth_provider)
- self.limits_client = LimitsClientJSON(self.auth_provider)
- self.images_client = ImagesClientJSON(self.auth_provider)
- self.keypairs_client = KeyPairsClientJSON(self.auth_provider)
- self.keypairs_v3_client = KeyPairsV3ClientJSON(
- self.auth_provider)
- self.quotas_client = QuotasClientJSON(self.auth_provider)
- self.quota_classes_client = QuotaClassesClientJSON(
- self.auth_provider)
- self.quotas_v3_client = QuotasV3ClientJSON(self.auth_provider)
- self.flavors_client = FlavorsClientJSON(self.auth_provider)
- self.flavors_v3_client = FlavorsV3ClientJSON(self.auth_provider)
- self.extensions_v3_client = ExtensionsV3ClientJSON(
- self.auth_provider)
- self.extensions_client = ExtensionsClientJSON(
- self.auth_provider)
- self.volumes_extensions_client = VolumesExtensionsClientJSON(
- self.auth_provider)
- self.floating_ips_client = FloatingIPsClientJSON(
- self.auth_provider)
self.backups_client = BackupsClientJSON(self.auth_provider)
self.snapshots_client = SnapshotsClientJSON(self.auth_provider)
self.snapshots_v2_client = SnapshotsV2ClientJSON(
@@ -338,55 +288,26 @@
self.identity_client = IdentityClientJSON(self.auth_provider)
self.identity_v3_client = IdentityV3ClientJSON(
self.auth_provider)
- self.security_groups_client = SecurityGroupsClientJSON(
- self.auth_provider)
- self.interfaces_v3_client = InterfacesV3ClientJSON(
- self.auth_provider)
- self.interfaces_client = InterfacesClientJSON(
- self.auth_provider)
self.endpoints_client = EndPointClientJSON(self.auth_provider)
- self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider)
- self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
- self.auth_provider)
- self.availability_zone_client = AvailabilityZoneClientJSON(
- self.auth_provider)
- self.services_v3_client = ServicesV3ClientJSON(
- self.auth_provider)
self.service_client = ServiceClientJSON(self.auth_provider)
self.volume_services_client = VolumesServicesClientJSON(
self.auth_provider)
- self.agents_v3_client = AgentsV3ClientJSON(self.auth_provider)
- self.aggregates_v3_client = AggregatesV3ClientJSON(
- self.auth_provider)
- self.aggregates_client = AggregatesClientJSON(
- self.auth_provider)
- self.services_client = ServicesClientJSON(self.auth_provider)
- self.tenant_usages_client = TenantUsagesClientJSON(
- self.auth_provider)
- self.version_v3_client = VersionV3ClientJSON(self.auth_provider)
- self.migrations_v3_client = MigrationsV3ClientJSON(
- self.auth_provider)
self.policy_client = PolicyClientJSON(self.auth_provider)
self.region_client = RegionClientJSON(self.auth_provider)
- self.hosts_client = HostsClientJSON(self.auth_provider)
- self.hypervisor_v3_client = HypervisorV3ClientJSON(
- self.auth_provider)
- self.hypervisor_client = HypervisorClientJSON(
- self.auth_provider)
self.network_client = NetworkClientJSON(self.auth_provider)
self.credentials_client = CredentialsClientJSON(
self.auth_provider)
- self.instance_usages_audit_log_client = \
- InstanceUsagesAuditLogClientJSON(self.auth_provider)
self.volume_hosts_client = VolumeHostsClientJSON(
self.auth_provider)
+ self.volume_hosts_v2_client = VolumeHostsV2ClientJSON(
+ self.auth_provider)
self.volume_quotas_client = VolumeQuotasClientJSON(
self.auth_provider)
self.volumes_extension_client = VolumeExtensionClientJSON(
self.auth_provider)
self.volumes_v2_extension_client = VolumeV2ExtensionClientJSON(
self.auth_provider)
- self.hosts_v3_client = HostsV3ClientJSON(self.auth_provider)
+
self.database_flavors_client = DatabaseFlavorsClientJSON(
self.auth_provider)
self.database_versions_client = DatabaseVersionsClientJSON(
@@ -446,6 +367,83 @@
self.volume_qos_v2_client = QosSpecsV2ClientJSON(
self.auth_provider)
+ def _set_compute_clients(self, type):
+ if type == 'json':
+ self._set_compute_json_clients()
+ else:
+ self._set_compute_xml_clients()
+
+ def _set_compute_xml_clients(self):
+ self.certificates_client = CertificatesClientXML(self.auth_provider)
+ self.servers_client = ServersClientXML(self.auth_provider)
+ self.limits_client = LimitsClientXML(self.auth_provider)
+ self.images_client = ImagesClientXML(self.auth_provider)
+ self.keypairs_client = KeyPairsClientXML(self.auth_provider)
+ self.quotas_client = QuotasClientXML(self.auth_provider)
+ self.quota_classes_client = QuotaClassesClientXML(self.auth_provider)
+ self.flavors_client = FlavorsClientXML(self.auth_provider)
+ self.extensions_client = ExtensionsClientXML(self.auth_provider)
+ self.volumes_extensions_client = VolumesExtensionsClientXML(
+ self.auth_provider)
+ self.floating_ips_client = FloatingIPsClientXML(self.auth_provider)
+ self.security_groups_client = SecurityGroupsClientXML(
+ self.auth_provider)
+ self.interfaces_client = InterfacesClientXML(self.auth_provider)
+ self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
+ self.availability_zone_client = AvailabilityZoneClientXML(
+ self.auth_provider)
+ self.aggregates_client = AggregatesClientXML(self.auth_provider)
+ self.services_client = ServicesClientXML(self.auth_provider)
+ self.tenant_usages_client = TenantUsagesClientXML(self.auth_provider)
+ self.hosts_client = HostsClientXML(self.auth_provider)
+ self.hypervisor_client = HypervisorClientXML(self.auth_provider)
+ self.instance_usages_audit_log_client = \
+ InstanceUsagesAuditLogClientXML(self.auth_provider)
+
+ def _set_compute_json_clients(self):
+ self.certificates_client = CertificatesClientJSON(self.auth_provider)
+ self.certificates_v3_client = CertificatesV3ClientJSON(
+ self.auth_provider)
+ self.servers_client = ServersClientJSON(self.auth_provider)
+ self.servers_v3_client = ServersV3ClientJSON(self.auth_provider)
+ self.limits_client = LimitsClientJSON(self.auth_provider)
+ self.images_client = ImagesClientJSON(self.auth_provider)
+ self.keypairs_client = KeyPairsClientJSON(self.auth_provider)
+ self.keypairs_v3_client = KeyPairsV3ClientJSON(self.auth_provider)
+ self.quotas_client = QuotasClientJSON(self.auth_provider)
+ self.quota_classes_client = QuotaClassesClientJSON(self.auth_provider)
+ self.quotas_v3_client = QuotasV3ClientJSON(self.auth_provider)
+ self.flavors_client = FlavorsClientJSON(self.auth_provider)
+ self.flavors_v3_client = FlavorsV3ClientJSON(self.auth_provider)
+ self.extensions_client = ExtensionsClientJSON(self.auth_provider)
+ self.extensions_v3_client = ExtensionsV3ClientJSON(self.auth_provider)
+ self.volumes_extensions_client = VolumesExtensionsClientJSON(
+ self.auth_provider)
+ self.floating_ips_client = FloatingIPsClientJSON(self.auth_provider)
+ self.security_groups_client = SecurityGroupsClientJSON(
+ self.auth_provider)
+ self.interfaces_client = InterfacesClientJSON(self.auth_provider)
+ self.interfaces_v3_client = InterfacesV3ClientJSON(self.auth_provider)
+ self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider)
+ self.availability_zone_client = AvailabilityZoneClientJSON(
+ self.auth_provider)
+ self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
+ self.auth_provider)
+ self.services_v3_client = ServicesV3ClientJSON(self.auth_provider)
+ self.agents_v3_client = AgentsV3ClientJSON(self.auth_provider)
+ self.aggregates_client = AggregatesClientJSON(self.auth_provider)
+ self.aggregates_v3_client = AggregatesV3ClientJSON(self.auth_provider)
+ self.services_client = ServicesClientJSON(self.auth_provider)
+ self.tenant_usages_client = TenantUsagesClientJSON(self.auth_provider)
+ self.version_v3_client = VersionV3ClientJSON(self.auth_provider)
+ self.migrations_v3_client = MigrationsV3ClientJSON(self.auth_provider)
+ self.hosts_client = HostsClientJSON(self.auth_provider)
+ self.hosts_v3_client = HostsV3ClientJSON(self.auth_provider)
+ self.hypervisor_client = HypervisorClientJSON(self.auth_provider)
+ self.hypervisor_v3_client = HypervisorV3ClientJSON(self.auth_provider)
+ self.instance_usages_audit_log_client = \
+ InstanceUsagesAuditLogClientJSON(self.auth_provider)
+
class AdminManager(Manager):
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index c290dad..6f2e1bd 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -42,7 +42,7 @@
# convert a structure into a string safely
-def safe_body(body, maxlen=2048):
+def safe_body(body, maxlen=4096):
try:
text = six.text_type(body)
except UnicodeDecodeError:
diff --git a/tempest/config.py b/tempest/config.py
index 6e8238a..163817c 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -449,7 +449,9 @@
cfg.StrOpt('public_router_id',
default="",
help="Id of the public router that provides external "
- "connectivity"),
+ "connectivity. This should only be used when Neutron's "
+ "'allow_overlapping_ips' is set to 'False' in "
+ "neutron.conf. usually not needed past 'Grizzly' release"),
cfg.IntOpt('build_timeout',
default=300,
help="Timeout in seconds to wait for network operation to "
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 2ebfdd1..ea4365e 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -475,9 +475,9 @@
@classmethod
def resource_setup(cls):
+ cls.check_preconditions()
super(NetworkScenarioTest, cls).resource_setup()
cls.tenant_id = cls.manager.identity_client.tenant_id
- cls.check_preconditions()
def _create_network(self, client=None, tenant_id=None,
namestart='network-smoke-'):
@@ -1022,12 +1022,11 @@
class BaremetalScenarioTest(ScenarioTest):
@classmethod
def resource_setup(cls):
- super(BaremetalScenarioTest, cls).resource_setup()
-
if (not CONF.service_available.ironic or
not CONF.baremetal.driver_enabled):
msg = 'Ironic not available or Ironic compute driver not enabled'
raise cls.skipException(msg)
+ super(BaremetalScenarioTest, cls).resource_setup()
# use an admin client manager for baremetal client
manager = clients.Manager(
@@ -1201,9 +1200,9 @@
@classmethod
def resource_setup(cls):
- super(OrchestrationScenarioTest, cls).resource_setup()
if not CONF.service_available.heat:
raise cls.skipException("Heat support is required")
+ super(OrchestrationScenarioTest, cls).resource_setup()
@classmethod
def credentials(cls):
@@ -1246,12 +1245,12 @@
@classmethod
def resource_setup(cls):
- cls.set_network_resources()
- super(SwiftScenarioTest, cls).resource_setup()
if not CONF.service_available.swift:
skip_msg = ("%s skipped as swift is not available" %
cls.__name__)
raise cls.skipException(skip_msg)
+ cls.set_network_resources()
+ super(SwiftScenarioTest, cls).resource_setup()
# Clients for Swift
cls.account_client = cls.manager.account_client
cls.container_client = cls.manager.container_client
@@ -1269,6 +1268,9 @@
# look for the container to assure it is created
self.list_and_check_container_objects(name)
LOG.debug('Container %s created' % (name))
+ self.addCleanup(self.delete_wrapper,
+ self.container_client.delete_container,
+ name)
return name
def delete_container(self, container_name):
@@ -1279,6 +1281,10 @@
obj_name = obj_name or data_utils.rand_name('swift-scenario-object')
obj_data = data_utils.arbitrary_string()
self.object_client.create_object(container_name, obj_name, obj_data)
+ self.addCleanup(self.delete_wrapper,
+ self.object_client.delete_object,
+ container_name,
+ obj_name)
return obj_name, obj_data
def delete_object(self, container_name, filename):
diff --git a/tempest/scenario/orchestration/test_server_cfn_init.py b/tempest/scenario/orchestration/test_server_cfn_init.py
index 791c564..ddfabe4 100644
--- a/tempest/scenario/orchestration/test_server_cfn_init.py
+++ b/tempest/scenario/orchestration/test_server_cfn_init.py
@@ -129,6 +129,7 @@
raise e
@test.attr(type='slow')
+ @test.skip_because(bug='1374175')
@test.services('orchestration', 'compute')
def test_server_cfn_init(self):
self.assign_keypair()
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index f218fb2..875a1d9 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -35,11 +35,10 @@
@classmethod
def resource_setup(cls):
- cls.set_network_resources()
- super(TestDashboardBasicOps, cls).resource_setup()
-
if not CONF.service_available.horizon:
raise cls.skipException("Horizon support is required")
+ cls.set_network_resources()
+ super(TestDashboardBasicOps, cls).resource_setup()
def check_login_page(self):
response = urllib2.urlopen(CONF.dashboard.dashboard_url)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index ac4f004..e3f87e9 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -89,13 +89,13 @@
@classmethod
def resource_setup(cls):
- # Create no network resources for these tests.
- cls.set_network_resources()
- super(TestNetworkBasicOps, cls).resource_setup()
for ext in ['router', 'security-group']:
if not test.is_extension_enabled(ext, 'network'):
msg = "%s extension not enabled." % ext
raise cls.skipException(msg)
+ # Create no network resources for these tests.
+ cls.set_network_resources()
+ super(TestNetworkBasicOps, cls).resource_setup()
def setUp(self):
super(TestNetworkBasicOps, self).setUp()
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index c53e22b..d10fcce 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -36,12 +36,11 @@
@classmethod
def resource_setup(cls):
- cls.set_network_resources()
- super(TestServerAdvancedOps, cls).resource_setup()
-
if CONF.compute.flavor_ref_alt == CONF.compute.flavor_ref:
msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
raise cls.skipException(msg)
+ cls.set_network_resources()
+ super(TestServerAdvancedOps, cls).resource_setup()
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
'Resize is not available.')
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 7fc1edf..e30c824 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -52,10 +52,9 @@
@classmethod
def resource_setup(cls):
- super(TestStampPattern, cls).resource_setup()
-
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
+ super(TestStampPattern, cls).resource_setup()
def _wait_for_volume_snapshot_status(self, volume_snapshot, status):
self.snapshots_client.wait_for_snapshot_status(volume_snapshot['id'],
diff --git a/tempest/scenario/test_swift_basic_ops.py b/tempest/scenario/test_swift_basic_ops.py
index 9e0fee0..fcb9505 100644
--- a/tempest/scenario/test_swift_basic_ops.py
+++ b/tempest/scenario/test_swift_basic_ops.py
@@ -44,9 +44,12 @@
self.get_swift_stat()
container_name = self.create_container()
obj_name, obj_data = self.upload_object_to_container(container_name)
- self.list_and_check_container_objects(container_name, [obj_name])
+ self.list_and_check_container_objects(container_name,
+ present_obj=[obj_name])
self.download_and_verify(container_name, obj_name, obj_data)
self.delete_object(container_name, obj_name)
+ self.list_and_check_container_objects(container_name,
+ not_present_obj=[obj_name])
self.delete_container(container_name)
@test.services('object_storage')
@@ -68,5 +71,3 @@
self.change_container_acl(container_name, '.r:*')
resp, _ = http_client.request(obj_url, 'GET')
self.assertEqual(resp.status, 200)
- self.delete_object(container_name, obj_name)
- self.delete_container(container_name)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index a20db5c..62876c4 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -37,10 +37,9 @@
"""
@classmethod
def resource_setup(cls):
- super(TestVolumeBootPattern, cls).resource_setup()
-
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
+ super(TestVolumeBootPattern, cls).resource_setup()
def _create_volume_from_image(self):
img_uuid = CONF.compute.image_ref
diff --git a/tempest/scenario/utils.py b/tempest/scenario/utils.py
index c20f20c..e6624a3 100644
--- a/tempest/scenario/utils.py
+++ b/tempest/scenario/utils.py
@@ -25,6 +25,7 @@
from tempest import clients
from tempest.common.utils import misc
from tempest import config
+from tempest import exceptions
CONF = config.CONF
@@ -151,9 +152,12 @@
loader, standard_tests, pattern = args
else:
standard_tests, module, loader = args
- scenario_utils = InputScenarioUtils()
- scenario_flavor = scenario_utils.scenario_flavors
- scenario_image = scenario_utils.scenario_images
+ try:
+ scenario_utils = InputScenarioUtils()
+ scenario_flavor = scenario_utils.scenario_flavors
+ scenario_image = scenario_utils.scenario_images
+ except exceptions.InvalidConfiguration:
+ return standard_tests
for test in testtools.iterate_tests(standard_tests):
setattr(test, 'scenarios', testscenarios.multiply_scenarios(
scenario_image,
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 78ed56f..46475f0 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -85,8 +85,14 @@
update_body['admin_state_up'] = kwargs.get(
'admin_state_up', body['router']['admin_state_up'])
cur_gw_info = body['router']['external_gateway_info']
- if cur_gw_info and not set_enable_snat:
- cur_gw_info.pop('enable_snat', None)
+ if cur_gw_info:
+ # TODO(kevinbenton): setting the external gateway info is not
+ # allowed for a regular tenant. If the ability to update is also
+ # merged, a test case for this will need to be added similar to
+ # the SNAT case.
+ cur_gw_info.pop('external_fixed_ips', None)
+ if not set_enable_snat:
+ cur_gw_info.pop('enable_snat', None)
update_body['external_gateway_info'] = kwargs.get(
'external_gateway_info', body['router']['external_gateway_info'])
update_body = dict(router=update_body)
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 410d0a0..4417e3b 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -52,6 +52,7 @@
headers[remove_metadata_prefix + key] = remove_metadata[key]
resp, body = self.put(url, data, headers)
+ self.expected_success(200, resp.status)
return resp, body
def delete_account(self, data=None, params=None):
@@ -61,6 +62,7 @@
url = '?%s%s' % (url, urllib.urlencode(params))
resp, body = self.delete(url, headers={}, body=data)
+ self.expected_success(200, resp.status)
return resp, body
def list_account_metadata(self):
@@ -69,6 +71,7 @@
Returns all account metadata headers
"""
resp, body = self.head('')
+ self.expected_success(204, resp.status)
return resp, body
def create_account_metadata(self, metadata,
@@ -85,6 +88,7 @@
url = '?%s%s' % (url, urllib.urlencode(params))
resp, body = self.post(url, headers=headers, body=data)
+ self.expected_success([200, 204], resp.status)
return resp, body
def delete_account_metadata(self, metadata,
@@ -97,6 +101,7 @@
for item in metadata:
headers[metadata_prefix + item] = metadata[item]
resp, body = self.post('', headers=headers, body=None)
+ self.expected_success(204, resp.status)
return resp, body
def create_and_delete_account_metadata(
@@ -115,6 +120,7 @@
headers[delete_metadata_prefix + key] = delete_metadata[key]
resp, body = self.post('', headers=headers, body=None)
+ self.expected_success(204, resp.status)
return resp, body
def list_account_containers(self, params=None):
@@ -147,6 +153,7 @@
body = etree.fromstring(body)
else:
body = body.strip().splitlines()
+ self.expected_success([200, 204], resp.status)
return resp, body
def list_extensions(self):
@@ -156,6 +163,7 @@
finally:
self.reset_path()
body = json.loads(body)
+ self.expected_success(200, resp.status)
return resp, body
@@ -230,4 +238,5 @@
headers[str(key)] = metadata[key]
resp, body = self.get(url, headers=headers)
+ self.expected_success(200, resp.status)
return resp, body
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index ffc1326..182c4d0 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -53,12 +53,14 @@
headers[remove_metadata_prefix + key] = remove_metadata[key]
resp, body = self.put(url, body=None, headers=headers)
+ self.expected_success([201, 202], resp.status)
return resp, body
def delete_container(self, container_name):
"""Deletes the container (if it's empty)."""
url = str(container_name)
resp, body = self.delete(url)
+ self.expected_success(204, resp.status)
return resp, body
def update_container_metadata(
@@ -79,6 +81,7 @@
headers[remove_metadata_prefix + key] = remove_metadata[key]
resp, body = self.post(url, body=None, headers=headers)
+ self.expected_success(204, resp.status)
return resp, body
def delete_container_metadata(self, container_name, metadata,
@@ -92,6 +95,7 @@
headers[metadata_prefix + item] = metadata[item]
resp, body = self.post(url, body=None, headers=headers)
+ self.expected_success(204, resp.status)
return resp, body
def list_container_metadata(self, container_name):
@@ -100,6 +104,7 @@
"""
url = str(container_name)
resp, body = self.head(url)
+ self.expected_success(204, resp.status)
return resp, body
def list_all_container_objects(self, container, params=None):
@@ -121,6 +126,7 @@
resp, objlist = self.list_container_contents(
container,
params={'limit': limit, 'format': 'json'})
+ self.expected_success(200, resp.status)
return objlist
"""tmp = []
for obj in objlist:
@@ -186,4 +192,5 @@
body = json.loads(body)
elif params and params.get('format') == 'xml':
body = etree.fromstring(body)
+ self.expected_success([200, 204], resp.status)
return resp, body
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index b2f8205..2231407 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -46,11 +46,14 @@
url += '?%s' % urllib.urlencode(params)
resp, body = self.put(url, data, headers)
+ self.expected_success(201, resp.status)
return resp, body
def update_object(self, container, object_name, data):
"""Upload data to replace current storage object."""
- return self.create_object(container, object_name, data)
+ resp, body = self.create_object(container, object_name, data)
+ self.expected_success(201, resp.status)
+ return resp, body
def delete_object(self, container, object_name, params=None):
"""Delete storage object."""
@@ -58,6 +61,7 @@
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.delete(url, headers={})
+ self.expected_success([200, 204], resp.status)
return resp, body
def update_object_metadata(self, container, object_name, metadata,
@@ -70,6 +74,7 @@
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.post(url, None, headers=headers)
+ self.expected_success(202, resp.status)
return resp, body
def list_object_metadata(self, container, object_name):
@@ -77,6 +82,7 @@
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.head(url)
+ self.expected_success(200, resp.status)
return resp, body
def get_object(self, container, object_name, metadata=None):
@@ -89,6 +95,7 @@
url = "{0}/{1}".format(container, object_name)
resp, body = self.get(url, headers=headers)
+ self.expected_success([200, 206], resp.status)
return resp, body
def copy_object_in_same_container(self, container, src_object_name,
@@ -105,6 +112,7 @@
headers[str(key)] = metadata[key]
resp, body = self.put(url, None, headers=headers)
+ self.expected_success(201, resp.status)
return resp, body
def copy_object_across_containers(self, src_container, src_object_name,
@@ -122,6 +130,7 @@
headers[str(key)] = metadata[key]
resp, body = self.put(url, None, headers=headers)
+ self.expected_success(201, resp.status)
return resp, body
def copy_object_2d_way(self, container, src_object_name, dest_object_name,
@@ -137,12 +146,14 @@
headers[str(key)] = metadata[key]
resp, body = self.copy(url, headers=headers)
+ self.expected_success(201, resp.status)
return resp, body
def create_object_segments(self, container, object_name, segment, data):
"""Creates object segments."""
url = "{0}/{1}/{2}".format(container, object_name, segment)
resp, body = self.put(url, data)
+ self.expected_success(201, resp.status)
return resp, body
def put_object_with_chunk(self, container, name, contents, chunk_size):
@@ -167,7 +178,7 @@
resp_headers[header.lower()] = value
self._error_checker('PUT', None, headers, contents, resp, body)
-
+ self.expected_success(201, resp.status)
return resp.status, resp.reason, resp_headers
@@ -220,6 +231,7 @@
url = "{0}/{1}".format(container, object_name)
resp, body = self.get(url, headers=headers)
+ self.expected_success(200, resp.status)
return resp, body
def create_object(self, container, object_name, data, metadata=None):
@@ -234,6 +246,7 @@
headers['content-length'] = '0'
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.put(url, data, headers=headers)
+ self.expected_success(201, resp.status)
return resp, body
def delete_object(self, container, object_name, metadata=None):
@@ -246,6 +259,7 @@
url = "%s/%s" % (str(container), str(object_name))
resp, body = self.delete(url, headers=headers)
+ self.expected_success(200, resp.status)
return resp, body
def create_object_continue(self, container, object_name,
diff --git a/tempest/services/volume/json/admin/volume_hosts_client.py b/tempest/services/volume/json/admin/volume_hosts_client.py
index b3a22b5..10cb0be 100644
--- a/tempest/services/volume/json/admin/volume_hosts_client.py
+++ b/tempest/services/volume/json/admin/volume_hosts_client.py
@@ -22,13 +22,13 @@
CONF = config.CONF
-class VolumeHostsClientJSON(rest_client.RestClient):
+class BaseVolumeHostsClientJSON(rest_client.RestClient):
"""
Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
"""
def __init__(self, auth_provider):
- super(VolumeHostsClientJSON, self).__init__(auth_provider)
+ super(BaseVolumeHostsClientJSON, self).__init__(auth_provider)
self.service = CONF.volume.catalog_type
self.build_interval = CONF.volume.build_interval
@@ -45,3 +45,9 @@
body = json.loads(body)
self.expected_success(200, resp.status)
return resp, body['hosts']
+
+
+class VolumeHostsClientJSON(BaseVolumeHostsClientJSON):
+ """
+ Client class to send CRUD Volume Host API V1 requests to a Cinder endpoint
+ """
diff --git a/tempest/services/volume/v2/json/admin/volume_hosts_client.py b/tempest/services/volume/v2/json/admin/volume_hosts_client.py
new file mode 100644
index 0000000..d631570
--- /dev/null
+++ b/tempest/services/volume/v2/json/admin/volume_hosts_client.py
@@ -0,0 +1,28 @@
+# Copyright 2014 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.services.volume.json.admin import volume_hosts_client
+
+
+class VolumeHostsV2ClientJSON(volume_hosts_client.BaseVolumeHostsClientJSON):
+ """
+ Client class to send CRUD Volume V2 API requests to a Cinder endpoint
+ """
+
+ def __init__(self, auth_provider):
+ super(VolumeHostsV2ClientJSON, self).__init__(auth_provider)
+
+ self.api_version = "v2"
diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py
index 98a7c58..583b2c5 100644
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ b/tempest/services/volume/xml/admin/volume_hosts_client.py
@@ -24,14 +24,14 @@
CONF = config.CONF
-class VolumeHostsClientXML(rest_client.RestClient):
+class BaseVolumeHostsClientXML(rest_client.RestClient):
"""
Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
"""
TYPE = "xml"
def __init__(self, auth_provider):
- super(VolumeHostsClientXML, self).__init__(auth_provider)
+ super(BaseVolumeHostsClientXML, self).__init__(auth_provider)
self.service = CONF.volume.catalog_type
self.build_interval = CONF.compute.build_interval
self.build_timeout = CONF.compute.build_timeout
@@ -72,3 +72,9 @@
self.expected_success(200, resp.status)
body = self._parse_array(etree.fromstring(body))
return resp, body
+
+
+class VolumeHostsClientXML(BaseVolumeHostsClientXML):
+ """
+ Client class to send CRUD Volume Host API V1 requests to a Cinder endpoint
+ """
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 2464016..03d39a8 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -25,14 +25,14 @@
CONF = config.CONF
-class VolumeTypesClientXML(rest_client.RestClient):
+class BaseVolumeTypesClientXML(rest_client.RestClient):
"""
Client class to send CRUD Volume Types API requests to a Cinder endpoint
"""
TYPE = "xml"
def __init__(self, auth_provider):
- super(VolumeTypesClientXML, self).__init__(auth_provider)
+ super(BaseVolumeTypesClientXML, self).__init__(auth_provider)
self.service = CONF.volume.catalog_type
self.build_interval = CONF.compute.build_interval
self.build_timeout = CONF.compute.build_timeout
@@ -210,3 +210,9 @@
def resource_type(self):
"""Returns the primary type of resource this client works with."""
return 'volume-type'
+
+
+class VolumeTypesClientXML(BaseVolumeTypesClientXML):
+ """
+ Client class to send CRUD Volume Type API V1 requests to a Cinder endpoint
+ """
diff --git a/tempest/tests/test_list_tests.py b/tempest/tests/test_list_tests.py
index 157fc5f..efdb413 100644
--- a/tempest/tests/test_list_tests.py
+++ b/tempest/tests/test_list_tests.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
import re
import subprocess
@@ -20,16 +21,23 @@
class TestTestList(base.TestCase):
- def test_no_import_errors(self):
+ def test_testr_list_tests_no_errors(self):
+ # Remove unit test discover path from env to test tempest tests
+ test_env = os.environ.copy()
+ test_env.pop('OS_TEST_PATH')
import_failures = []
- p = subprocess.Popen(['testr', 'list-tests'], stdout=subprocess.PIPE)
- ids = p.stdout.read()
+ p = subprocess.Popen(['testr', 'list-tests'], stdout=subprocess.PIPE,
+ env=test_env)
+ ids, err = p.communicate()
+ self.assertEqual(0, p.returncode,
+ "test discovery failed, one or more files cause an "
+ "error on import")
ids = ids.split('\n')
for test_id in ids:
if re.match('(\w+\.){3}\w+', test_id):
if not test_id.startswith('tempest.'):
- fail_id = test_id.split('unittest.loader.ModuleImport'
- 'Failure.')[1]
+ parts = test_id.partition('tempest')
+ fail_id = parts[1] + parts[2]
import_failures.append(fail_id)
error_message = ("The following tests have import failures and aren't"
" being run with test filters %s" % import_failures)
diff --git a/test-requirements.txt b/test-requirements.txt
index ba70259..6eefeee 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,11 +3,11 @@
# process, which may cause wedges in the gate later.
hacking>=0.9.2,<0.10
# needed for doc build
-sphinx>=1.1.2,!=1.2.0,<1.3
+sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
python-subunit>=0.0.18
oslosphinx>=2.2.0 # Apache-2.0
mox>=0.5.3
mock>=1.0
coverage>=3.6
-oslotest>=1.1.0 # Apache-2.0
-stevedore>=1.0.0 # Apache-2.0
+oslotest>=1.2.0 # Apache-2.0
+stevedore>=1.1.0 # Apache-2.0