Change tempest BadRequest exc to tempest-lib exc
This commit changes tempest.exceptions.BadRequest to tempest_lib.exceptions.BadRequest. This is one of the migrating rest client to tempest-lib works. Change-Id: I859bd25c07c6344e6455c4010c253cbdf04315b3
This commit is contained in:
@@ -14,7 +14,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.baremetal.admin import base
|
from tempest.api.baremetal.admin import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions as exc
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -32,19 +31,19 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
node_id = self.node['uuid']
|
node_id = self.node['uuid']
|
||||||
address = 'malformed:mac'
|
address = 'malformed:mac'
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_port, node_id=node_id, address=address)
|
self.create_port, node_id=node_id, address=address)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_create_port_nonexsistent_node_id(self):
|
def test_create_port_nonexsistent_node_id(self):
|
||||||
node_id = str(data_utils.rand_uuid())
|
node_id = str(data_utils.rand_uuid())
|
||||||
address = data_utils.rand_mac_address()
|
address = data_utils.rand_mac_address()
|
||||||
self.assertRaises(exc.BadRequest, self.create_port, node_id=node_id,
|
self.assertRaises(lib_exc.BadRequest, self.create_port,
|
||||||
address=address)
|
node_id=node_id, address=address)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_show_port_malformed_uuid(self):
|
def test_show_port_malformed_uuid(self):
|
||||||
self.assertRaises(exc.BadRequest, self.client.show_port,
|
self.assertRaises(lib_exc.BadRequest, self.client.show_port,
|
||||||
'malformed:uuid')
|
'malformed:uuid')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -54,7 +53,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_show_port_by_mac_not_allowed(self):
|
def test_show_port_by_mac_not_allowed(self):
|
||||||
self.assertRaises(exc.BadRequest, self.client.show_port,
|
self.assertRaises(lib_exc.BadRequest, self.client.show_port,
|
||||||
data_utils.rand_mac_address())
|
data_utils.rand_mac_address())
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -71,15 +70,15 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
def test_create_port_no_mandatory_field_node_id(self):
|
def test_create_port_no_mandatory_field_node_id(self):
|
||||||
address = data_utils.rand_mac_address()
|
address = data_utils.rand_mac_address()
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.create_port, node_id=None,
|
self.assertRaises(lib_exc.BadRequest, self.create_port, node_id=None,
|
||||||
address=address)
|
address=address)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_create_port_no_mandatory_field_mac(self):
|
def test_create_port_no_mandatory_field_mac(self):
|
||||||
node_id = self.node['uuid']
|
node_id = self.node['uuid']
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.create_port, node_id=node_id,
|
self.assertRaises(lib_exc.BadRequest, self.create_port,
|
||||||
address=None)
|
node_id=node_id, address=None)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_create_port_malformed_port_uuid(self):
|
def test_create_port_malformed_port_uuid(self):
|
||||||
@@ -87,13 +86,13 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
address = data_utils.rand_mac_address()
|
address = data_utils.rand_mac_address()
|
||||||
uuid = 'malformed:uuid'
|
uuid = 'malformed:uuid'
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.create_port, node_id=node_id,
|
self.assertRaises(lib_exc.BadRequest, self.create_port,
|
||||||
address=address, uuid=uuid)
|
node_id=node_id, address=address, uuid=uuid)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_create_port_malformed_node_id(self):
|
def test_create_port_malformed_node_id(self):
|
||||||
address = data_utils.rand_mac_address()
|
address = data_utils.rand_mac_address()
|
||||||
self.assertRaises(exc.BadRequest, self.create_port,
|
self.assertRaises(lib_exc.BadRequest, self.create_port,
|
||||||
node_id='malformed:nodeid', address=address)
|
node_id='malformed:nodeid', address=address)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -117,7 +116,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
'value': 'new-value'}]
|
'value': 'new-value'}]
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_port, address,
|
self.client.update_port, address,
|
||||||
patch)
|
patch)
|
||||||
|
|
||||||
@@ -147,7 +146,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
self.create_port(node_id=node_id, address=address)
|
self.create_port(node_id=node_id, address=address)
|
||||||
|
|
||||||
new_address = data_utils.rand_mac_address()
|
new_address = data_utils.rand_mac_address()
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port,
|
||||||
uuid='malformed:uuid',
|
uuid='malformed:uuid',
|
||||||
patch=[{'path': '/address', 'op': 'replace',
|
patch=[{'path': '/address', 'op': 'replace',
|
||||||
'value': new_address}])
|
'value': new_address}])
|
||||||
@@ -160,7 +159,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
_, port = self.create_port(node_id=node_id, address=address)
|
_, port = self.create_port(node_id=node_id, address=address)
|
||||||
port_id = port['uuid']
|
port_id = port['uuid']
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port, port_id,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
|
||||||
[{'path': '/nonexistent', ' op': 'add',
|
[{'path': '/nonexistent', ' op': 'add',
|
||||||
'value': 'value'}])
|
'value': 'value'}])
|
||||||
|
|
||||||
@@ -175,7 +174,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
patch = [{'path': '/node_uuid',
|
patch = [{'path': '/node_uuid',
|
||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
'value': 'malformed:node_uuid'}]
|
'value': 'malformed:node_uuid'}]
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_port, port_id, patch)
|
self.client.update_port, port_id, patch)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -206,7 +205,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
patch = [{'path': '/node_uuid',
|
patch = [{'path': '/node_uuid',
|
||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
'value': data_utils.rand_uuid()}]
|
'value': data_utils.rand_uuid()}]
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_port, port_id, patch)
|
self.client.update_port, port_id, patch)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -221,7 +220,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
'value': 'malformed:mac'}]
|
'value': 'malformed:mac'}]
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_port, port_id, patch)
|
self.client.update_port, port_id, patch)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -234,7 +233,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
|
|
||||||
patch = [{'path': '/nonexistent', ' op': 'replace', 'value': 'value'}]
|
patch = [{'path': '/nonexistent', ' op': 'replace', 'value': 'value'}]
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_port, port_id, patch)
|
self.client.update_port, port_id, patch)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -245,7 +244,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
_, port = self.create_port(node_id=node_id, address=address)
|
_, port = self.create_port(node_id=node_id, address=address)
|
||||||
port_id = port['uuid']
|
port_id = port['uuid']
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port, port_id,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
|
||||||
[{'path': '/address', 'op': 'remove'}])
|
[{'path': '/address', 'op': 'remove'}])
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -256,7 +255,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
_, port = self.create_port(node_id=node_id, address=address)
|
_, port = self.create_port(node_id=node_id, address=address)
|
||||||
port_id = port['uuid']
|
port_id = port['uuid']
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port, port_id,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
|
||||||
[{'path': '/uuid', 'op': 'remove'}])
|
[{'path': '/uuid', 'op': 'remove'}])
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -267,7 +266,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
_, port = self.create_port(node_id=node_id, address=address)
|
_, port = self.create_port(node_id=node_id, address=address)
|
||||||
port_id = port['uuid']
|
port_id = port['uuid']
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port, port_id,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
|
||||||
[{'path': '/nonexistent', 'op': 'remove'}])
|
[{'path': '/nonexistent', 'op': 'remove'}])
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
@@ -276,7 +275,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
address = data_utils.rand_mac_address()
|
address = data_utils.rand_mac_address()
|
||||||
|
|
||||||
self.create_port(node_id=node_id, address=address)
|
self.create_port(node_id=node_id, address=address)
|
||||||
self.assertRaises(exc.BadRequest, self.client.delete_port, address)
|
self.assertRaises(lib_exc.BadRequest, self.client.delete_port, address)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_update_port_mixed_ops_integrity(self):
|
def test_update_port_mixed_ops_integrity(self):
|
||||||
@@ -306,7 +305,7 @@ class TestPortsNegative(base.BaseBaremetalTest):
|
|||||||
'op': 'replace',
|
'op': 'replace',
|
||||||
'value': 'value'}]
|
'value': 'value'}]
|
||||||
|
|
||||||
self.assertRaises(exc.BadRequest, self.client.update_port, port_id,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
|
||||||
patch)
|
patch)
|
||||||
|
|
||||||
# patch should not be applied
|
# patch should not be applied
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common import tempest_fixtures as fixtures
|
from tempest.common import tempest_fixtures as fixtures
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ class AggregatesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_aggregate_create_aggregate_name_length_less_than_1(self):
|
def test_aggregate_create_aggregate_name_length_less_than_1(self):
|
||||||
# the length of aggregate name should >= 1 and <=255
|
# the length of aggregate name should >= 1 and <=255
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_aggregate,
|
self.client.create_aggregate,
|
||||||
name='')
|
name='')
|
||||||
|
|
||||||
@@ -60,7 +59,7 @@ class AggregatesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
def test_aggregate_create_aggregate_name_length_exceeds_255(self):
|
def test_aggregate_create_aggregate_name_length_exceeds_255(self):
|
||||||
# the length of aggregate name should >= 1 and <=255
|
# the length of aggregate name should >= 1 and <=255
|
||||||
aggregate_name = 'a' * 256
|
aggregate_name = 'a' * 256
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_aggregate,
|
self.client.create_aggregate,
|
||||||
name=aggregate_name)
|
name=aggregate_name)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -73,7 +72,7 @@ class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
|
|||||||
# NOTE(eliqiao): in Juno, the exception is NotFound, but in master, we
|
# NOTE(eliqiao): in Juno, the exception is NotFound, but in master, we
|
||||||
# change the error code to BadRequest, both exceptions should be
|
# change the error code to BadRequest, both exceptions should be
|
||||||
# accepted by tempest
|
# accepted by tempest
|
||||||
self.assertRaises((lib_exc.NotFound, exceptions.BadRequest),
|
self.assertRaises((lib_exc.NotFound, lib_exc.BadRequest),
|
||||||
self.client.reserve_fixed_ip,
|
self.client.reserve_fixed_ip,
|
||||||
"my.invalid.ip", body)
|
"my.invalid.ip", body)
|
||||||
|
|
||||||
@@ -81,6 +80,6 @@ class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
|
|||||||
@test.services('network')
|
@test.services('network')
|
||||||
def test_fixed_ip_with_invalid_action(self):
|
def test_fixed_ip_with_invalid_action(self):
|
||||||
body = {"invalid_action": "None"}
|
body = {"invalid_action": "None"}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.reserve_fixed_ip,
|
self.client.reserve_fixed_ip,
|
||||||
self.ip, body)
|
self.ip, body)
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
self.addCleanup(self.flavor_clean_up, flavor['id'])
|
self.addCleanup(self.flavor_clean_up, flavor['id'])
|
||||||
|
|
||||||
# Verify flavor is not used by other user
|
# Verify flavor is not used by other user
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.os.servers_client.create_server,
|
self.os.servers_client.create_server,
|
||||||
'test', self.image_ref, flavor['id'])
|
'test', self.image_ref, flavor['id'])
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +109,7 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_flavor_update_mismatch_key(self):
|
def test_flavor_update_mismatch_key(self):
|
||||||
# the key will be updated should be match the key in the body
|
# the key will be updated should be match the key in the body
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_flavor_extra_spec,
|
self.client.update_flavor_extra_spec,
|
||||||
self.flavor['id'],
|
self.flavor['id'],
|
||||||
"key2",
|
"key2",
|
||||||
@@ -119,7 +118,7 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_flavor_update_more_key(self):
|
def test_flavor_update_more_key(self):
|
||||||
# there should be just one item in the request body
|
# there should be just one item in the request body
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_flavor_extra_spec,
|
self.client.update_flavor_extra_spec,
|
||||||
self.flavor['id'],
|
self.flavor['id'],
|
||||||
"key1",
|
"key1",
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
# only 'status' and 'maintenance_mode' are the valid params.
|
# only 'status' and 'maintenance_mode' are the valid params.
|
||||||
hostname = self._get_host_name()
|
hostname = self._get_host_name()
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_host,
|
self.client.update_host,
|
||||||
hostname,
|
hostname,
|
||||||
status='enable',
|
status='enable',
|
||||||
@@ -84,7 +83,7 @@ class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
# 'status' can only be 'enable' or 'disable'
|
# 'status' can only be 'enable' or 'disable'
|
||||||
hostname = self._get_host_name()
|
hostname = self._get_host_name()
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_host,
|
self.client.update_host,
|
||||||
hostname,
|
hostname,
|
||||||
status='invalid',
|
status='invalid',
|
||||||
@@ -95,7 +94,7 @@ class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
# 'maintenance_mode' can only be 'enable' or 'disable'
|
# 'maintenance_mode' can only be 'enable' or 'disable'
|
||||||
hostname = self._get_host_name()
|
hostname = self._get_host_name()
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_host,
|
self.client.update_host,
|
||||||
hostname,
|
hostname,
|
||||||
status='enable',
|
status='enable',
|
||||||
@@ -106,7 +105,7 @@ class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
# 'status' or 'maintenance_mode' needed for host update
|
# 'status' or 'maintenance_mode' needed for host update
|
||||||
hostname = self._get_host_name()
|
hostname = self._get_host_name()
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_host,
|
self.client.update_host,
|
||||||
hostname)
|
hostname)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import urllib
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -44,6 +43,6 @@ class InstanceUsageAuditLogNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_get_instance_usage_audit_logs_with_invalid_time(self):
|
def test_get_instance_usage_audit_logs_with_invalid_time(self):
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.adm_client.get_instance_usage_audit_log,
|
self.adm_client.get_instance_usage_audit_log,
|
||||||
"invalid_time")
|
"invalid_time")
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from tempest.api.compute import base
|
|||||||
from tempest.common import tempest_fixtures as fixtures
|
from tempest.common import tempest_fixtures as fixtures
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -100,13 +99,13 @@ class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_reset_state_server_invalid_state(self):
|
def test_reset_state_server_invalid_state(self):
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.reset_state, self.s1_id,
|
self.client.reset_state, self.s1_id,
|
||||||
state='invalid')
|
state='invalid')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_reset_state_server_invalid_type(self):
|
def test_reset_state_server_invalid_type(self):
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.reset_state, self.s1_id,
|
self.client.reset_state, self.s1_id,
|
||||||
state=1)
|
state=1)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import datetime
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ class TenantUsagesNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
# Get usage for tenant with invalid date
|
# Get usage for tenant with invalid date
|
||||||
params = {'start': self.end,
|
params = {'start': self.end,
|
||||||
'end': self.start}
|
'end': self.start}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.adm_client.get_tenant_usage,
|
self.adm_client.get_tenant_usage,
|
||||||
self.client.tenant_id, params)
|
self.client.tenant_id, params)
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.compute.floating_ips import base
|
from tempest.api.compute.floating_ips import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -92,6 +91,6 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
|
|||||||
def test_associate_ip_to_server_without_passing_floating_ip(self):
|
def test_associate_ip_to_server_without_passing_floating_ip(self):
|
||||||
# Negative test:Association of empty floating IP to specific server
|
# Negative test:Association of empty floating IP to specific server
|
||||||
# should raise NotFound or BadRequest(In case of Nova V2.1) exception.
|
# should raise NotFound or BadRequest(In case of Nova V2.1) exception.
|
||||||
self.assertRaises((lib_exc.NotFound, exceptions.BadRequest),
|
self.assertRaises((lib_exc.NotFound, lib_exc.BadRequest),
|
||||||
self.client.associate_floating_ip_to_server,
|
self.client.associate_floating_ip_to_server,
|
||||||
'', self.server_id)
|
'', self.server_id)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest.openstack.common import log as logging
|
from tempest.openstack.common import log as logging
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
@@ -79,7 +78,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Return an error when creating image with invalid metadata
|
# Return an error when creating image with invalid metadata
|
||||||
snapshot_name = data_utils.rand_name('test-snap-')
|
snapshot_name = data_utils.rand_name('test-snap-')
|
||||||
meta = {'': ''}
|
meta = {'': ''}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
self.server_id, snapshot_name, meta)
|
self.server_id, snapshot_name, meta)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -87,7 +86,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Return an error when creating image with meta data over 256 chars
|
# Return an error when creating image with meta data over 256 chars
|
||||||
snapshot_name = data_utils.rand_name('test-snap-')
|
snapshot_name = data_utils.rand_name('test-snap-')
|
||||||
meta = {'a' * 260: 'b' * 260}
|
meta = {'a' * 260: 'b' * 260}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
self.server_id, snapshot_name, meta)
|
self.server_id, snapshot_name, meta)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -112,7 +111,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Return an error if snapshot name over 256 characters is passed
|
# Return an error if snapshot name over 256 characters is passed
|
||||||
|
|
||||||
snapshot_name = data_utils.rand_name('a' * 260)
|
snapshot_name = data_utils.rand_name('a' * 260)
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
self.server_id, snapshot_name)
|
self.server_id, snapshot_name)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +37,7 @@ class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Keypair should not be created with a non RSA public key
|
# Keypair should not be created with a non RSA public key
|
||||||
k_name = data_utils.rand_name('keypair-')
|
k_name = data_utils.rand_name('keypair-')
|
||||||
pub_key = "ssh-rsa JUNK nova@ubuntu"
|
pub_key = "ssh-rsa JUNK nova@ubuntu"
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self._create_keypair, k_name, pub_key)
|
self._create_keypair, k_name, pub_key)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -53,7 +52,7 @@ class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Keypair should not be created with an empty public key
|
# Keypair should not be created with an empty public key
|
||||||
k_name = data_utils.rand_name("keypair-")
|
k_name = data_utils.rand_name("keypair-")
|
||||||
pub_key = ' '
|
pub_key = ' '
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_keypair,
|
self.assertRaises(lib_exc.BadRequest, self._create_keypair,
|
||||||
k_name, pub_key)
|
k_name, pub_key)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -61,7 +60,7 @@ class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Keypair should not be created when public key bits are too long
|
# Keypair should not be created when public key bits are too long
|
||||||
k_name = data_utils.rand_name("keypair-")
|
k_name = data_utils.rand_name("keypair-")
|
||||||
pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu'
|
pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu'
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_keypair,
|
self.assertRaises(lib_exc.BadRequest, self._create_keypair,
|
||||||
k_name, pub_key)
|
k_name, pub_key)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -77,19 +76,19 @@ class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_keypair_with_empty_name_string(self):
|
def test_create_keypair_with_empty_name_string(self):
|
||||||
# Keypairs with name being an empty string should not be created
|
# Keypairs with name being an empty string should not be created
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_keypair,
|
self.assertRaises(lib_exc.BadRequest, self._create_keypair,
|
||||||
'')
|
'')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_keypair_with_long_keynames(self):
|
def test_create_keypair_with_long_keynames(self):
|
||||||
# Keypairs with name longer than 255 chars should not be created
|
# Keypairs with name longer than 255 chars should not be created
|
||||||
k_name = 'keypair-'.ljust(260, '0')
|
k_name = 'keypair-'.ljust(260, '0')
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_keypair,
|
self.assertRaises(lib_exc.BadRequest, self._create_keypair,
|
||||||
k_name)
|
k_name)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_keypair_invalid_name(self):
|
def test_create_keypair_invalid_name(self):
|
||||||
# Keypairs with name being an invalid name should not be created
|
# Keypairs with name being an invalid name should not be created
|
||||||
k_name = 'key_/.\@:'
|
k_name = 'key_/.\@:'
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_keypair,
|
self.assertRaises(lib_exc.BadRequest, self._create_keypair,
|
||||||
k_name)
|
k_name)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.compute.security_groups import base
|
from tempest.api.compute.security_groups import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -62,7 +61,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
ip_protocol = 'tcp'
|
ip_protocol = 'tcp'
|
||||||
from_port = 22
|
from_port = 22
|
||||||
to_port = 22
|
to_port = 22
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port, to_port)
|
parent_group_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
to_port)
|
to_port)
|
||||||
self.addCleanup(self.client.delete_security_group_rule, rule['id'])
|
self.addCleanup(self.client.delete_security_group_rule, rule['id'])
|
||||||
# Add the same rule to the group should fail
|
# Add the same rule to the group should fail
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port, to_port)
|
parent_group_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
@@ -102,7 +101,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
from_port = 22
|
from_port = 22
|
||||||
to_port = 22
|
to_port = 22
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port, to_port)
|
parent_group_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
ip_protocol = 'tcp'
|
ip_protocol = 'tcp'
|
||||||
from_port = data_utils.rand_int_id(start=65536)
|
from_port = data_utils.rand_int_id(start=65536)
|
||||||
to_port = 22
|
to_port = 22
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port, to_port)
|
parent_group_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
@@ -134,7 +133,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
ip_protocol = 'tcp'
|
ip_protocol = 'tcp'
|
||||||
from_port = 22
|
from_port = 22
|
||||||
to_port = data_utils.rand_int_id(start=65536)
|
to_port = data_utils.rand_int_id(start=65536)
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port, to_port)
|
parent_group_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
@@ -150,7 +149,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
ip_protocol = 'tcp'
|
ip_protocol = 'tcp'
|
||||||
from_port = 22
|
from_port = 22
|
||||||
to_port = 21
|
to_port = 21
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
secgroup_id, ip_protocol, from_port, to_port)
|
secgroup_id, ip_protocol, from_port, to_port)
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute.security_groups import base
|
from tempest.api.compute.security_groups import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
|
|
||||||
# Check that we are not able to delete the security
|
# Check that we are not able to delete the security
|
||||||
# group since it is in use by an active server
|
# group since it is in use by an active server
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.delete_security_group,
|
self.client.delete_security_group,
|
||||||
sg['id'])
|
sg['id'])
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
|
|
||||||
# Check that we are not able to delete the other security
|
# Check that we are not able to delete the other security
|
||||||
# group since it is in use by an active server
|
# group since it is in use by an active server
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.delete_security_group,
|
self.client.delete_security_group,
|
||||||
sg2['id'])
|
sg2['id'])
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import testtools
|
|||||||
from tempest.api.compute.security_groups import base
|
from tempest.api.compute.security_groups import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -66,15 +65,15 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
# as an empty string/with white spaces/chars more than 255
|
# as an empty string/with white spaces/chars more than 255
|
||||||
s_description = data_utils.rand_name('description-')
|
s_description = data_utils.rand_name('description-')
|
||||||
# Create Security Group with empty string as group name
|
# Create Security Group with empty string as group name
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, "", s_description)
|
self.client.create_security_group, "", s_description)
|
||||||
# Create Security Group with white space in group name
|
# Create Security Group with white space in group name
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, " ",
|
self.client.create_security_group, " ",
|
||||||
s_description)
|
s_description)
|
||||||
# Create Security Group with group name longer than 255 chars
|
# Create Security Group with group name longer than 255 chars
|
||||||
s_name = 'securitygroup-'.ljust(260, '0')
|
s_name = 'securitygroup-'.ljust(260, '0')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, s_name,
|
self.client.create_security_group, s_name,
|
||||||
s_description)
|
s_description)
|
||||||
|
|
||||||
@@ -87,14 +86,14 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
# as an empty string/with white spaces/chars more than 255
|
# as an empty string/with white spaces/chars more than 255
|
||||||
s_name = data_utils.rand_name('securitygroup-')
|
s_name = data_utils.rand_name('securitygroup-')
|
||||||
# Create Security Group with empty string as description
|
# Create Security Group with empty string as description
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, s_name, "")
|
self.client.create_security_group, s_name, "")
|
||||||
# Create Security Group with white space in description
|
# Create Security Group with white space in description
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, s_name, " ")
|
self.client.create_security_group, s_name, " ")
|
||||||
# Create Security Group with group description longer than 255 chars
|
# Create Security Group with group description longer than 255 chars
|
||||||
s_description = 'description-'.ljust(260, '0')
|
s_description = 'description-'.ljust(260, '0')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, s_name,
|
self.client.create_security_group, s_name,
|
||||||
s_description)
|
s_description)
|
||||||
|
|
||||||
@@ -109,7 +108,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
s_description = data_utils.rand_name('description-')
|
s_description = data_utils.rand_name('description-')
|
||||||
self.create_security_group(s_name, s_description)
|
self.create_security_group(s_name, s_description)
|
||||||
# Now try the Security Group with the same 'Name'
|
# Now try the Security Group with the same 'Name'
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_security_group, s_name,
|
self.client.create_security_group, s_name,
|
||||||
s_description)
|
s_description)
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
default_security_group_id = body[i]['id']
|
default_security_group_id = body[i]['id']
|
||||||
break
|
break
|
||||||
# Deleting the "default" Security Group
|
# Deleting the "default" Security Group
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.delete_security_group,
|
self.client.delete_security_group,
|
||||||
default_security_group_id)
|
default_security_group_id)
|
||||||
|
|
||||||
@@ -154,7 +153,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
s_description = data_utils.rand_name('description-')
|
s_description = data_utils.rand_name('description-')
|
||||||
# Create a non int sg_id
|
# Create a non int sg_id
|
||||||
sg_id_invalid = data_utils.rand_name('sg-')
|
sg_id_invalid = data_utils.rand_name('sg-')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_security_group, sg_id_invalid,
|
self.client.update_security_group, sg_id_invalid,
|
||||||
name=s_name, description=s_description)
|
name=s_name, description=s_description)
|
||||||
|
|
||||||
@@ -169,7 +168,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
securitygroup_id = securitygroup['id']
|
securitygroup_id = securitygroup['id']
|
||||||
# Update Security Group with group name longer than 255 chars
|
# Update Security Group with group name longer than 255 chars
|
||||||
s_new_name = 'securitygroup-'.ljust(260, '0')
|
s_new_name = 'securitygroup-'.ljust(260, '0')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_security_group,
|
self.client.update_security_group,
|
||||||
securitygroup_id, name=s_new_name)
|
securitygroup_id, name=s_new_name)
|
||||||
|
|
||||||
@@ -184,7 +183,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
|||||||
securitygroup_id = securitygroup['id']
|
securitygroup_id = securitygroup['id']
|
||||||
# Update Security Group with group description longer than 255 chars
|
# Update Security Group with group description longer than 255 chars
|
||||||
s_new_des = 'des-'.ljust(260, '0')
|
s_new_des = 'des-'.ljust(260, '0')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_security_group,
|
self.client.update_security_group,
|
||||||
securitygroup_id, description=s_new_des)
|
securitygroup_id, description=s_new_des)
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from six import moves
|
from six import moves
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -113,19 +113,19 @@ class ListServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_list_servers_by_limits_pass_string(self):
|
def test_list_servers_by_limits_pass_string(self):
|
||||||
# Return an error if a string value is passed for limit
|
# Return an error if a string value is passed for limit
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
|
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
|
||||||
{'limit': 'testing'})
|
{'limit': 'testing'})
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_list_servers_by_limits_pass_negative_value(self):
|
def test_list_servers_by_limits_pass_negative_value(self):
|
||||||
# Return an error if a negative value for limit is passed
|
# Return an error if a negative value for limit is passed
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
|
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
|
||||||
{'limit': -1})
|
{'limit': -1})
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_list_servers_by_changes_since_invalid_date(self):
|
def test_list_servers_by_changes_since_invalid_date(self):
|
||||||
# Return an error when invalid date format is passed
|
# Return an error when invalid date format is passed
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
|
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
|
||||||
{'changes-since': '2011/01/01'})
|
{'changes-since': '2011/01/01'})
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -13,9 +13,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -38,31 +39,31 @@ class MultipleCreateNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_min_count_less_than_one(self):
|
def test_min_count_less_than_one(self):
|
||||||
invalid_min_count = 0
|
invalid_min_count = 0
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
|
self.assertRaises(lib_exc.BadRequest, self._create_multiple_servers,
|
||||||
min_count=invalid_min_count)
|
min_count=invalid_min_count)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_min_count_non_integer(self):
|
def test_min_count_non_integer(self):
|
||||||
invalid_min_count = 2.5
|
invalid_min_count = 2.5
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
|
self.assertRaises(lib_exc.BadRequest, self._create_multiple_servers,
|
||||||
min_count=invalid_min_count)
|
min_count=invalid_min_count)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_max_count_less_than_one(self):
|
def test_max_count_less_than_one(self):
|
||||||
invalid_max_count = 0
|
invalid_max_count = 0
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
|
self.assertRaises(lib_exc.BadRequest, self._create_multiple_servers,
|
||||||
max_count=invalid_max_count)
|
max_count=invalid_max_count)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_max_count_non_integer(self):
|
def test_max_count_non_integer(self):
|
||||||
invalid_max_count = 2.5
|
invalid_max_count = 2.5
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
|
self.assertRaises(lib_exc.BadRequest, self._create_multiple_servers,
|
||||||
max_count=invalid_max_count)
|
max_count=invalid_max_count)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_max_count_less_than_min_count(self):
|
def test_max_count_less_than_min_count(self):
|
||||||
min_count = 3
|
min_count = 3
|
||||||
max_count = 2
|
max_count = 2
|
||||||
self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
|
self.assertRaises(lib_exc.BadRequest, self._create_multiple_servers,
|
||||||
min_count=min_count,
|
min_count=min_count,
|
||||||
max_count=max_count)
|
max_count=max_count)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -42,7 +41,7 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
for sz in [256, 257, 511, 1023]:
|
for sz in [256, 257, 511, 1023]:
|
||||||
key = "k" * sz
|
key = "k" * sz
|
||||||
meta = {key: 'data1'}
|
meta = {key: 'data1'}
|
||||||
self.assertRaises((exceptions.BadRequest, lib_exc.OverLimit),
|
self.assertRaises((lib_exc.BadRequest, lib_exc.OverLimit),
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
meta=meta)
|
meta=meta)
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_create_server_metadata_blank_key(self):
|
def test_create_server_metadata_blank_key(self):
|
||||||
# Blank key should trigger an error.
|
# Blank key should trigger an error.
|
||||||
meta = {'': 'data1'}
|
meta = {'': 'data1'}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
meta=meta)
|
meta=meta)
|
||||||
|
|
||||||
@@ -78,7 +77,7 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Raise BadRequest if key in uri does not match
|
# Raise BadRequest if key in uri does not match
|
||||||
# the key passed in body.
|
# the key passed in body.
|
||||||
meta = {'testkey': 'testvalue'}
|
meta = {'testkey': 'testvalue'}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.set_server_metadata_item,
|
self.client.set_server_metadata_item,
|
||||||
self.server_id, 'key', meta)
|
self.server_id, 'key', meta)
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_update_metadata_with_blank_key(self):
|
def test_update_metadata_with_blank_key(self):
|
||||||
# Blank key should trigger an error
|
# Blank key should trigger an error
|
||||||
meta = {'': 'data1'}
|
meta = {'': 'data1'}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_server_metadata,
|
self.client.update_server_metadata,
|
||||||
self.server_id, meta=meta)
|
self.server_id, meta=meta)
|
||||||
|
|
||||||
@@ -148,7 +147,7 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Raise a bad request error for blank key.
|
# Raise a bad request error for blank key.
|
||||||
# set_server_metadata will replace all metadata with new value
|
# set_server_metadata will replace all metadata with new value
|
||||||
meta = {'': 'data1'}
|
meta = {'': 'data1'}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.set_server_metadata,
|
self.client.set_server_metadata,
|
||||||
self.server_id, meta=meta)
|
self.server_id, meta=meta)
|
||||||
|
|
||||||
@@ -157,6 +156,6 @@ class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Raise a bad request error for a missing metadata field
|
# Raise a bad request error for a missing metadata field
|
||||||
# set_server_metadata will replace all metadata with new value
|
# set_server_metadata will replace all metadata with new value
|
||||||
meta = {'meta1': 'data1'}
|
meta = {'meta1': 'data1'}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.set_server_metadata,
|
self.client.set_server_metadata,
|
||||||
self.server_id, meta=meta, no_metadata_field=True)
|
self.server_id, meta=meta, no_metadata_field=True)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ from tempest.api.compute import base
|
|||||||
from tempest import clients
|
from tempest import clients
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -54,7 +53,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_server_name_blank(self):
|
def test_server_name_blank(self):
|
||||||
# Create a server with name parameter empty
|
# Create a server with name parameter empty
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
name='')
|
name='')
|
||||||
|
|
||||||
@@ -66,7 +65,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
person = [{'path': '/etc/testfile.txt',
|
person = [{'path': '/etc/testfile.txt',
|
||||||
'contents': file_contents}]
|
'contents': file_contents}]
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
personality=person)
|
personality=person)
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_create_with_invalid_image(self):
|
def test_create_with_invalid_image(self):
|
||||||
# Create a server with an unknown image
|
# Create a server with an unknown image
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
image_id=-1)
|
image_id=-1)
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_create_with_invalid_flavor(self):
|
def test_create_with_invalid_flavor(self):
|
||||||
# Create a server with an unknown flavor
|
# Create a server with an unknown flavor
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
flavor=-1,)
|
flavor=-1,)
|
||||||
|
|
||||||
@@ -91,7 +90,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# An access IPv4 address must match a valid address pattern
|
# An access IPv4 address must match a valid address pattern
|
||||||
|
|
||||||
IPv4 = '1.1.1.1.1.1'
|
IPv4 = '1.1.1.1.1.1'
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server, accessIPv4=IPv4)
|
self.create_test_server, accessIPv4=IPv4)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -100,7 +99,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
|
|
||||||
IPv6 = 'notvalid'
|
IPv6 = 'notvalid'
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server, accessIPv6=IPv6)
|
self.create_test_server, accessIPv6=IPv6)
|
||||||
|
|
||||||
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
|
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
|
||||||
@@ -119,7 +118,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
def test_resize_server_with_non_existent_flavor(self):
|
def test_resize_server_with_non_existent_flavor(self):
|
||||||
# Resize a server with non-existent flavor
|
# Resize a server with non-existent flavor
|
||||||
nonexistent_flavor = data_utils.rand_uuid()
|
nonexistent_flavor = data_utils.rand_uuid()
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.resize,
|
self.assertRaises(lib_exc.BadRequest, self.client.resize,
|
||||||
self.server_id, flavor_ref=nonexistent_flavor)
|
self.server_id, flavor_ref=nonexistent_flavor)
|
||||||
|
|
||||||
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
|
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
|
||||||
@@ -127,7 +126,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_resize_server_with_null_flavor(self):
|
def test_resize_server_with_null_flavor(self):
|
||||||
# Resize a server with null flavor
|
# Resize a server with null flavor
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.resize,
|
self.assertRaises(lib_exc.BadRequest, self.client.resize,
|
||||||
self.server_id, flavor_ref="")
|
self.server_id, flavor_ref="")
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -174,7 +173,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_numeric_server_name(self):
|
def test_create_numeric_server_name(self):
|
||||||
server_name = 12345
|
server_name = 12345
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
name=server_name)
|
name=server_name)
|
||||||
|
|
||||||
@@ -183,7 +182,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Create a server with name length exceeding 256 characters
|
# Create a server with name length exceeding 256 characters
|
||||||
|
|
||||||
server_name = 'a' * 256
|
server_name = 'a' * 256
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
name=server_name)
|
name=server_name)
|
||||||
|
|
||||||
@@ -193,7 +192,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
|
|
||||||
networks = [{'fixed_ip': '10.0.1.1', 'uuid': 'a-b-c-d-e-f-g-h-i-j'}]
|
networks = [{'fixed_ip': '10.0.1.1', 'uuid': 'a-b-c-d-e-f-g-h-i-j'}]
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
networks=networks)
|
networks=networks)
|
||||||
|
|
||||||
@@ -202,7 +201,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Pass a non-existent keypair while creating a server
|
# Pass a non-existent keypair while creating a server
|
||||||
|
|
||||||
key_name = data_utils.rand_name('key')
|
key_name = data_utils.rand_name('key')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
key_name=key_name)
|
key_name=key_name)
|
||||||
|
|
||||||
@@ -211,7 +210,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Pass really long metadata while creating a server
|
# Pass really long metadata while creating a server
|
||||||
|
|
||||||
metadata = {'a': 'b' * 260}
|
metadata = {'a': 'b' * 260}
|
||||||
self.assertRaises((exceptions.BadRequest, lib_exc.OverLimit),
|
self.assertRaises((lib_exc.BadRequest, lib_exc.OverLimit),
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
meta=metadata)
|
meta=metadata)
|
||||||
|
|
||||||
@@ -232,7 +231,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
server_name = data_utils.rand_name('server')
|
server_name = data_utils.rand_name('server')
|
||||||
new_name = ''
|
new_name = ''
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.update_server,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_server,
|
||||||
server_name, name=new_name)
|
server_name, name=new_name)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -249,7 +248,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Update name of server exceed the name length limit
|
# Update name of server exceed the name length limit
|
||||||
|
|
||||||
new_name = 'a' * 256
|
new_name = 'a' * 256
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_server,
|
self.client.update_server,
|
||||||
self.server_id,
|
self.server_id,
|
||||||
name=new_name)
|
name=new_name)
|
||||||
@@ -287,7 +286,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
# Create a server with a nonexistent security group
|
# Create a server with a nonexistent security group
|
||||||
|
|
||||||
security_groups = [{'name': 'does_not_exist'}]
|
security_groups = [{'name': 'does_not_exist'}]
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_test_server,
|
self.create_test_server,
|
||||||
security_groups=security_groups)
|
security_groups=security_groups)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from tempest.api.compute import base
|
|||||||
from tempest import clients
|
from tempest import clients
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest.openstack.common import log as logging
|
from tempest.openstack.common import log as logging
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
@@ -168,7 +167,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
|||||||
@test.attr(type='gate')
|
@test.attr(type='gate')
|
||||||
def test_create_server_with_unauthorized_image(self):
|
def test_create_server_with_unauthorized_image(self):
|
||||||
# Server creation with another user's image should fail
|
# Server creation with another user's image should fail
|
||||||
self.assertRaises(exceptions.BadRequest, self.alt_client.create_server,
|
self.assertRaises(lib_exc.BadRequest, self.alt_client.create_server,
|
||||||
'test', self.image['id'], self.flavor_ref)
|
'test', self.image['id'], self.flavor_ref)
|
||||||
|
|
||||||
@test.attr(type='gate')
|
@test.attr(type='gate')
|
||||||
@@ -180,7 +179,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
|||||||
request_part='url',
|
request_part='url',
|
||||||
auth_data=self.client.auth_provider.auth_data
|
auth_data=self.client.auth_provider.auth_data
|
||||||
)
|
)
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.alt_client.create_server, 'test',
|
self.alt_client.create_server, 'test',
|
||||||
self.image['id'], self.flavor_ref)
|
self.image['id'], self.flavor_ref)
|
||||||
|
|
||||||
@@ -198,7 +197,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
|||||||
)
|
)
|
||||||
resp = {}
|
resp = {}
|
||||||
resp['status'] = None
|
resp['status'] = None
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.alt_keypairs_client.create_keypair, k_name)
|
self.alt_keypairs_client.create_keypair, k_name)
|
||||||
finally:
|
finally:
|
||||||
# Next request the base_url is back to normal
|
# Next request the base_url is back to normal
|
||||||
@@ -249,7 +248,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
|||||||
)
|
)
|
||||||
resp = {}
|
resp = {}
|
||||||
resp['status'] = None
|
resp['status'] = None
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.alt_security_client.create_security_group,
|
self.alt_security_client.create_security_group,
|
||||||
s_name, s_description)
|
s_name, s_description)
|
||||||
finally:
|
finally:
|
||||||
@@ -290,7 +289,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
|||||||
)
|
)
|
||||||
resp = {}
|
resp = {}
|
||||||
resp['status'] = None
|
resp['status'] = None
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.alt_security_client.
|
self.alt_security_client.
|
||||||
create_security_group_rule,
|
create_security_group_rule,
|
||||||
parent_group_id, ip_protocol, from_port,
|
parent_group_id, ip_protocol, from_port,
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -48,6 +48,6 @@ class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
server = self.create_test_server(wait_until="ACTIVE")
|
server = self.create_test_server(wait_until="ACTIVE")
|
||||||
server_id = server['id']
|
server_id = server['id']
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
|
self.assertRaises(lib_exc.BadRequest, self._migrate_server_to,
|
||||||
server_id, target_host)
|
server_id, target_host)
|
||||||
self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
|
self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.compute import base
|
from tempest.api.compute import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -58,7 +57,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
|
|||||||
# in request
|
# in request
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='#$%', display_name=v_name, metadata=metadata)
|
size='#$%', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -67,7 +66,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
|
|||||||
# in request
|
# in request
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='', display_name=v_name, metadata=metadata)
|
size='', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -75,7 +74,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
|
|||||||
# Negative: Should not be able to create volume with size zero
|
# Negative: Should not be able to create volume with size zero
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='0', display_name=v_name, metadata=metadata)
|
size='0', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import uuid
|
|||||||
|
|
||||||
from tempest.api.identity import base
|
from tempest.api.identity import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_role_create_blank_name(self):
|
def test_role_create_blank_name(self):
|
||||||
# Should not be able to create a role with a blank name
|
# Should not be able to create a role with a blank name
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_role, '')
|
self.assertRaises(lib_exc.BadRequest, self.client.create_role, '')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_role_by_unauthorized_user(self):
|
def test_create_role_by_unauthorized_user(self):
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import uuid
|
|||||||
|
|
||||||
from tempest.api.identity import base
|
from tempest.api.identity import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -99,14 +98,14 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_tenant_with_empty_name(self):
|
def test_create_tenant_with_empty_name(self):
|
||||||
# Tenant name should not be empty
|
# Tenant name should not be empty
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_tenant,
|
||||||
name='')
|
name='')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_tenants_name_length_over_64(self):
|
def test_create_tenants_name_length_over_64(self):
|
||||||
# Tenant name length should not be greater than 64 characters
|
# Tenant name length should not be greater than 64 characters
|
||||||
tenant_name = 'a' * 65
|
tenant_name = 'a' * 65
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_tenant,
|
||||||
tenant_name)
|
tenant_name)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import uuid
|
|||||||
|
|
||||||
from tempest.api.identity import base
|
from tempest.api.identity import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
|||||||
def test_create_user_with_empty_name(self):
|
def test_create_user_with_empty_name(self):
|
||||||
# User with an empty name should not be created
|
# User with an empty name should not be created
|
||||||
self.data.setup_test_tenant()
|
self.data.setup_test_tenant()
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_user, '',
|
self.assertRaises(lib_exc.BadRequest, self.client.create_user, '',
|
||||||
self.alt_password, self.data.tenant['id'],
|
self.alt_password, self.data.tenant['id'],
|
||||||
self.alt_email)
|
self.alt_email)
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
|||||||
def test_create_user_with_name_length_over_255(self):
|
def test_create_user_with_name_length_over_255(self):
|
||||||
# Length of user name filed should be restricted to 255 characters
|
# Length of user name filed should be restricted to 255 characters
|
||||||
self.data.setup_test_tenant()
|
self.data.setup_test_tenant()
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_user,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_user,
|
||||||
'a' * 256, self.alt_password,
|
'a' * 256, self.alt_password,
|
||||||
self.data.tenant['id'], self.alt_email)
|
self.data.tenant['id'], self.alt_email)
|
||||||
|
|
||||||
@@ -91,7 +90,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
|||||||
# Attempt to create a user with valid enabled para should fail
|
# Attempt to create a user with valid enabled para should fail
|
||||||
self.data.setup_test_tenant()
|
self.data.setup_test_tenant()
|
||||||
name = data_utils.rand_name('test_user_')
|
name = data_utils.rand_name('test_user_')
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_user,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_user,
|
||||||
name, self.alt_password,
|
name, self.alt_password,
|
||||||
self.data.tenant['id'],
|
self.data.tenant['id'],
|
||||||
self.alt_email, enabled=3)
|
self.alt_email, enabled=3)
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.identity import base
|
from tempest.api.identity import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest):
|
|||||||
interface = 'public'
|
interface = 'public'
|
||||||
url = data_utils.rand_url()
|
url = data_utils.rand_url()
|
||||||
region = data_utils.rand_name('region')
|
region = data_utils.rand_name('region')
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_endpoint,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_endpoint,
|
||||||
self.service_id, interface, url, region=region,
|
self.service_id, interface, url, region=region,
|
||||||
force_enabled='False')
|
force_enabled='False')
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest):
|
|||||||
interface = 'public'
|
interface = 'public'
|
||||||
url = data_utils.rand_url()
|
url = data_utils.rand_url()
|
||||||
region = data_utils.rand_name('region')
|
region = data_utils.rand_name('region')
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_endpoint,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_endpoint,
|
||||||
self.service_id, interface, url, region=region,
|
self.service_id, interface, url, region=region,
|
||||||
force_enabled='True')
|
force_enabled='True')
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest):
|
|||||||
url1, region=region1, enabled=True))
|
url1, region=region1, enabled=True))
|
||||||
self.addCleanup(self.client.delete_endpoint, endpoint_for_update['id'])
|
self.addCleanup(self.client.delete_endpoint, endpoint_for_update['id'])
|
||||||
|
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.update_endpoint,
|
self.assertRaises(lib_exc.BadRequest, self.client.update_endpoint,
|
||||||
endpoint_for_update['id'], force_enabled=enabled)
|
endpoint_for_update['id'], force_enabled=enabled)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.identity import base
|
from tempest.api.identity import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -50,14 +49,14 @@ class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_project_with_empty_name(self):
|
def test_create_project_with_empty_name(self):
|
||||||
# Project name should not be empty
|
# Project name should not be empty
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_project,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_project,
|
||||||
name='')
|
name='')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_create_projects_name_length_over_64(self):
|
def test_create_projects_name_length_over_64(self):
|
||||||
# Project name length should not be greater than 64 characters
|
# Project name length should not be greater than 64 characters
|
||||||
project_name = 'a' * 65
|
project_name = 'a' * 65
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_project,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_project,
|
||||||
project_name)
|
project_name)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from tempest import clients
|
|||||||
from tempest.common import cred_provider
|
from tempest.common import cred_provider
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest.openstack.common import timeutils
|
from tempest.openstack.common import timeutils
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
@@ -237,7 +236,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test):
|
|||||||
# is rejected with the correct error
|
# is rejected with the correct error
|
||||||
# with an expiry specified
|
# with an expiry specified
|
||||||
expires_str = 'bad.123Z'
|
expires_str = 'bad.123Z'
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_trust,
|
self.create_trust,
|
||||||
expires=expires_str)
|
expires=expires_str)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.image import base
|
from tempest.api.image import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -26,12 +25,12 @@ class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_register_with_invalid_container_format(self):
|
def test_register_with_invalid_container_format(self):
|
||||||
# Negative tests for invalid data supplied to POST /images
|
# Negative tests for invalid data supplied to POST /images
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
'test', 'wrong', 'vhd')
|
'test', 'wrong', 'vhd')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_register_with_invalid_disk_format(self):
|
def test_register_with_invalid_disk_format(self):
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
'test', 'bare', 'wrong')
|
'test', 'bare', 'wrong')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.image import base
|
from tempest.api.image import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
|
|||||||
member = self.os_img_client.add_member(image_id,
|
member = self.os_img_client.add_member(image_id,
|
||||||
self.alt_tenant_id)
|
self.alt_tenant_id)
|
||||||
self.assertEqual(member['status'], 'pending')
|
self.assertEqual(member['status'], 'pending')
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.alt_img_client.update_member_status,
|
self.alt_img_client.update_member_status,
|
||||||
image_id, self.alt_tenant_id, 'notavalidstatus')
|
image_id, self.alt_tenant_id, 'notavalidstatus')
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import uuid
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.image import base
|
from tempest.api.image import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -85,10 +84,10 @@ class ImagesNegativeTest(base.BaseV2ImageTest):
|
|||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_register_with_invalid_container_format(self):
|
def test_register_with_invalid_container_format(self):
|
||||||
# Negative tests for invalid data supplied to POST /images
|
# Negative tests for invalid data supplied to POST /images
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
'test', 'wrong', 'vhd')
|
'test', 'wrong', 'vhd')
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_register_with_invalid_disk_format(self):
|
def test_register_with_invalid_disk_format(self):
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_image,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_image,
|
||||||
'test', 'bare', 'wrong')
|
'test', 'bare', 'wrong')
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class BaseNetworkTest(tempest.test.BaseTestCase):
|
|||||||
gateway_ip=gateway_ip,
|
gateway_ip=gateway_ip,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
break
|
break
|
||||||
except exceptions.BadRequest as e:
|
except lib_exc.BadRequest as e:
|
||||||
is_overlapping_cidr = 'overlaps with another subnet' in str(e)
|
is_overlapping_cidr = 'overlaps with another subnet' in str(e)
|
||||||
if not is_overlapping_cidr:
|
if not is_overlapping_cidr:
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.network import base
|
from tempest.api.network import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
|
||||||
@@ -146,7 +145,7 @@ class NetworksTestDHCPv6(base.BaseNetworkTest):
|
|||||||
):
|
):
|
||||||
kwargs = {'ipv6_ra_mode': ra_mode,
|
kwargs = {'ipv6_ra_mode': ra_mode,
|
||||||
'ipv6_address_mode': add_mode}
|
'ipv6_address_mode': add_mode}
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_subnet,
|
self.create_subnet,
|
||||||
self.network,
|
self.network,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
@@ -329,7 +328,7 @@ class NetworksTestDHCPv6(base.BaseNetworkTest):
|
|||||||
subnet["allocation_pools"][0]["end"])
|
subnet["allocation_pools"][0]["end"])
|
||||||
ip = netaddr.IPAddress(random.randrange(
|
ip = netaddr.IPAddress(random.randrange(
|
||||||
ip_range.last + 1, ip_range.last + 10)).format()
|
ip_range.last + 1, ip_range.last + 10)).format()
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.create_port,
|
self.create_port,
|
||||||
self.network,
|
self.network,
|
||||||
fixed_ips=[{'subnet_id': subnet['id'],
|
fixed_ips=[{'subnet_id': subnet['id'],
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.network import base
|
from tempest.api.network import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -59,7 +58,7 @@ class FloatingIPNegativeTestJSON(base.BaseNetworkTest):
|
|||||||
|
|
||||||
@test.attr(type=['negative', 'smoke'])
|
@test.attr(type=['negative', 'smoke'])
|
||||||
def test_create_floatingip_in_private_network(self):
|
def test_create_floatingip_in_private_network(self):
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.create_floatingip,
|
self.client.create_floatingip,
|
||||||
floating_network_id=self.network['id'],
|
floating_network_id=self.network['id'],
|
||||||
port_id=self.port['id'],
|
port_id=self.port['id'],
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
from tempest.api.network import base_routers as base
|
from tempest.api.network import base_routers as base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -54,7 +53,7 @@ class RoutersNegativeTest(base.BaseRouterTest):
|
|||||||
network_name=data_utils.rand_name('router-negative-'))
|
network_name=data_utils.rand_name('router-negative-'))
|
||||||
sub_cidr = netaddr.IPNetwork(self.tenant_cidr).next()
|
sub_cidr = netaddr.IPNetwork(self.tenant_cidr).next()
|
||||||
self.create_subnet(alt_network, cidr=sub_cidr)
|
self.create_subnet(alt_network, cidr=sub_cidr)
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.update_router,
|
self.client.update_router,
|
||||||
self.router['id'],
|
self.router['id'],
|
||||||
external_gateway_info={
|
external_gateway_info={
|
||||||
@@ -70,7 +69,7 @@ class RoutersNegativeTest(base.BaseRouterTest):
|
|||||||
subnet02 = self.create_subnet(network02)
|
subnet02 = self.create_subnet(network02)
|
||||||
self._add_router_interface_with_subnet_id(self.router['id'],
|
self._add_router_interface_with_subnet_id(self.router['id'],
|
||||||
subnet01['id'])
|
subnet01['id'])
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self._add_router_interface_with_subnet_id,
|
self._add_router_interface_with_subnet_id,
|
||||||
self.router['id'],
|
self.router['id'],
|
||||||
subnet02['id'])
|
subnet02['id'])
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.network import base_security_groups as base
|
from tempest.api.network import base_security_groups as base
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -64,7 +63,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
# Create rule with bad protocol name
|
# Create rule with bad protocol name
|
||||||
pname = 'bad_protocol_name'
|
pname = 'bad_protocol_name'
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
protocol=pname, direction='ingress', ethertype=self.ethertype)
|
protocol=pname, direction='ingress', ethertype=self.ethertype)
|
||||||
|
|
||||||
@@ -76,7 +75,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
prefix = ['192.168.1./24', '192.168.1.1/33', 'bad_prefix', '256']
|
prefix = ['192.168.1./24', '192.168.1.1/33', 'bad_prefix', '256']
|
||||||
for remote_ip_prefix in prefix:
|
for remote_ip_prefix in prefix:
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
protocol='tcp', direction='ingress', ethertype=self.ethertype,
|
protocol='tcp', direction='ingress', ethertype=self.ethertype,
|
||||||
remote_ip_prefix=remote_ip_prefix)
|
remote_ip_prefix=remote_ip_prefix)
|
||||||
@@ -103,7 +102,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
# Create rule specifying both remote_ip_prefix and remote_group_id
|
# Create rule specifying both remote_ip_prefix and remote_group_id
|
||||||
prefix = self._tenant_network_cidr
|
prefix = self._tenant_network_cidr
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=sg1_body['security_group']['id'],
|
security_group_id=sg1_body['security_group']['id'],
|
||||||
protocol='tcp', direction='ingress',
|
protocol='tcp', direction='ingress',
|
||||||
ethertype=self.ethertype, remote_ip_prefix=prefix,
|
ethertype=self.ethertype, remote_ip_prefix=prefix,
|
||||||
@@ -116,7 +115,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
# Create rule with bad ethertype
|
# Create rule with bad ethertype
|
||||||
ethertype = 'bad_ethertype'
|
ethertype = 'bad_ethertype'
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
protocol='udp', direction='ingress', ethertype=ethertype)
|
protocol='udp', direction='ingress', ethertype=ethertype)
|
||||||
|
|
||||||
@@ -132,7 +131,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
(-16, 65536, 'Invalid value for port')]
|
(-16, 65536, 'Invalid value for port')]
|
||||||
for pmin, pmax, msg in states:
|
for pmin, pmax, msg in states:
|
||||||
ex = self.assertRaises(
|
ex = self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
protocol='tcp', port_range_min=pmin, port_range_max=pmax,
|
protocol='tcp', port_range_min=pmin, port_range_max=pmax,
|
||||||
direction='ingress', ethertype=self.ethertype)
|
direction='ingress', ethertype=self.ethertype)
|
||||||
@@ -144,7 +143,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
|
|||||||
(300, 1, 'Invalid value for ICMP type')]
|
(300, 1, 'Invalid value for ICMP type')]
|
||||||
for pmin, pmax, msg in states:
|
for pmin, pmax, msg in states:
|
||||||
ex = self.assertRaises(
|
ex = self.assertRaises(
|
||||||
exceptions.BadRequest, self.client.create_security_group_rule,
|
lib_exc.BadRequest, self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
protocol='icmp', port_range_min=pmin, port_range_max=pmax,
|
protocol='icmp', port_range_min=pmin, port_range_max=pmax,
|
||||||
direction='ingress', ethertype=self.ethertype)
|
direction='ingress', ethertype=self.ethertype)
|
||||||
@@ -207,7 +206,7 @@ class NegativeSecGroupIPv6Test(NegativeSecGroupTest):
|
|||||||
'ip_prefix': CONF.network.tenant_network_v6_cidr})
|
'ip_prefix': CONF.network.tenant_network_v6_cidr})
|
||||||
for pair in pairs:
|
for pair in pairs:
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegexp(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
"Conflicting value ethertype",
|
"Conflicting value ethertype",
|
||||||
self.client.create_security_group_rule,
|
self.client.create_security_group_rule,
|
||||||
security_group_id=group_create_body['security_group']['id'],
|
security_group_id=group_create_body['security_group']['id'],
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.orchestration import base
|
from tempest.api.orchestration import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@@ -34,7 +34,7 @@ HeatTemplateFormatVersion: '2012-12-12'
|
|||||||
Description: '%s'
|
Description: '%s'
|
||||||
Outputs:
|
Outputs:
|
||||||
Foo: bar''' % fill
|
Foo: bar''' % fill
|
||||||
ex = self.assertRaises(exceptions.BadRequest, self.create_stack,
|
ex = self.assertRaises(lib_exc.BadRequest, self.create_stack,
|
||||||
stack_name, template)
|
stack_name, template)
|
||||||
self.assertIn('Template exceeds maximum allowed size', str(ex))
|
self.assertIn('Template exceeds maximum allowed size', str(ex))
|
||||||
|
|
||||||
@@ -48,6 +48,6 @@ Outputs:
|
|||||||
for i in range(num_resources):
|
for i in range(num_resources):
|
||||||
template += rsrc_snippet % i
|
template += rsrc_snippet % i
|
||||||
|
|
||||||
ex = self.assertRaises(exceptions.BadRequest, self.create_stack,
|
ex = self.assertRaises(lib_exc.BadRequest, self.create_stack,
|
||||||
stack_name, template)
|
stack_name, template)
|
||||||
self.assertIn('Maximum resources per stack exceeded', str(ex))
|
self.assertIn('Maximum resources per stack exceeded', str(ex))
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.orchestration import base
|
from tempest.api.orchestration import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ Resources:
|
|||||||
@test.attr(type=['gate', 'negative'])
|
@test.attr(type=['gate', 'negative'])
|
||||||
def test_validate_template_url(self):
|
def test_validate_template_url(self):
|
||||||
"""Validating template passing url to it."""
|
"""Validating template passing url to it."""
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.validate_template_url,
|
self.client.validate_template_url,
|
||||||
template_url=self.invalid_template_url,
|
template_url=self.invalid_template_url,
|
||||||
parameters=self.parameters)
|
parameters=self.parameters)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.volume import base
|
from tempest.api.volume import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
# Should not update volume type extra specs with no body
|
# Should not update volume type extra specs with no body
|
||||||
extra_spec = {"spec1": "val2"}
|
extra_spec = {"spec1": "val2"}
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.update_volume_type_extra_specs,
|
self.volume_types_client.update_volume_type_extra_specs,
|
||||||
self.volume_type['id'], extra_spec.keys()[0], None)
|
self.volume_type['id'], extra_spec.keys()[0], None)
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
# Should not update volume type extra specs with nonexistent id.
|
# Should not update volume type extra specs with nonexistent id.
|
||||||
extra_spec = {"spec1": "val2"}
|
extra_spec = {"spec1": "val2"}
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.update_volume_type_extra_specs,
|
self.volume_types_client.update_volume_type_extra_specs,
|
||||||
self.volume_type['id'], str(uuid.uuid4()),
|
self.volume_type['id'], str(uuid.uuid4()),
|
||||||
extra_spec)
|
extra_spec)
|
||||||
@@ -63,7 +62,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
# Should not update volume type extra specs with none id.
|
# Should not update volume type extra specs with none id.
|
||||||
extra_spec = {"spec1": "val2"}
|
extra_spec = {"spec1": "val2"}
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.update_volume_type_extra_specs,
|
self.volume_types_client.update_volume_type_extra_specs,
|
||||||
self.volume_type['id'], None, extra_spec)
|
self.volume_type['id'], None, extra_spec)
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
# body.
|
# body.
|
||||||
extra_spec = {"spec1": "val2", 'spec2': 'val1'}
|
extra_spec = {"spec1": "val2", 'spec2': 'val1'}
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.update_volume_type_extra_specs,
|
self.volume_types_client.update_volume_type_extra_specs,
|
||||||
self.volume_type['id'], extra_spec.keys()[0],
|
self.volume_type['id'], extra_spec.keys()[0],
|
||||||
extra_spec)
|
extra_spec)
|
||||||
@@ -92,7 +91,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
def test_create_none_body(self):
|
def test_create_none_body(self):
|
||||||
# Should not create volume type extra spec for none POST body.
|
# Should not create volume type extra spec for none POST body.
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.create_volume_type_extra_specs,
|
self.volume_types_client.create_volume_type_extra_specs,
|
||||||
self.volume_type['id'], None)
|
self.volume_type['id'], None)
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
def test_create_invalid_body(self):
|
def test_create_invalid_body(self):
|
||||||
# Should not create volume type extra spec for invalid POST body.
|
# Should not create volume type extra spec for invalid POST body.
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.BadRequest,
|
lib_exc.BadRequest,
|
||||||
self.volume_types_client.create_volume_type_extra_specs,
|
self.volume_types_client.create_volume_type_extra_specs,
|
||||||
self.volume_type['id'], ['invalid'])
|
self.volume_type['id'], ['invalid'])
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import uuid
|
|||||||
from tempest_lib import exceptions as lib_exc
|
from tempest_lib import exceptions as lib_exc
|
||||||
|
|
||||||
from tempest.api.volume import base
|
from tempest.api.volume import base
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +36,7 @@ class VolumeTypesNegativeV2Test(base.BaseVolumeAdminTest):
|
|||||||
@test.attr(type='gate')
|
@test.attr(type='gate')
|
||||||
def test_create_with_empty_name(self):
|
def test_create_with_empty_name(self):
|
||||||
# Should not be able to create volume type with an empty name.
|
# Should not be able to create volume type with an empty name.
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.volume_types_client.create_volume_type, '')
|
self.volume_types_client.create_volume_type, '')
|
||||||
|
|
||||||
@test.attr(type='gate')
|
@test.attr(type='gate')
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tempest_lib import exceptions as lib_exc
|
|||||||
|
|
||||||
from tempest.api.volume import base
|
from tempest.api.volume import base
|
||||||
from tempest.common.utils import data_utils
|
from tempest.common.utils import data_utils
|
||||||
from tempest import exceptions
|
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
|
||||||
@@ -54,7 +53,7 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
# in request
|
# in request
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='#$%', display_name=v_name, metadata=metadata)
|
size='#$%', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -63,7 +62,7 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
# in request
|
# in request
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='', display_name=v_name, metadata=metadata)
|
size='', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -71,7 +70,7 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
# Should not be able to create volume with size zero
|
# Should not be able to create volume with size zero
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='0', display_name=v_name, metadata=metadata)
|
size='0', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -79,7 +78,7 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
# Should not be able to create volume with size negative
|
# Should not be able to create volume with size negative
|
||||||
v_name = data_utils.rand_name('Volume-')
|
v_name = data_utils.rand_name('Volume-')
|
||||||
metadata = {'Type': 'work'}
|
metadata = {'Type': 'work'}
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.create_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
|
||||||
size='-1', display_name=v_name, metadata=metadata)
|
size='-1', display_name=v_name, metadata=metadata)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -180,21 +179,21 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
def test_volume_extend_with_size_smaller_than_original_size(self):
|
def test_volume_extend_with_size_smaller_than_original_size(self):
|
||||||
# Extend volume with smaller size than original size.
|
# Extend volume with smaller size than original size.
|
||||||
extend_size = 0
|
extend_size = 0
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.extend_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.extend_volume,
|
||||||
self.volume['id'], extend_size)
|
self.volume['id'], extend_size)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_volume_extend_with_non_number_size(self):
|
def test_volume_extend_with_non_number_size(self):
|
||||||
# Extend volume when size is non number.
|
# Extend volume when size is non number.
|
||||||
extend_size = 'abc'
|
extend_size = 'abc'
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.extend_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.extend_volume,
|
||||||
self.volume['id'], extend_size)
|
self.volume['id'], extend_size)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_volume_extend_with_None_size(self):
|
def test_volume_extend_with_None_size(self):
|
||||||
# Extend volume with None size.
|
# Extend volume with None size.
|
||||||
extend_size = None
|
extend_size = None
|
||||||
self.assertRaises(exceptions.BadRequest, self.client.extend_volume,
|
self.assertRaises(lib_exc.BadRequest, self.client.extend_volume,
|
||||||
self.volume['id'], extend_size)
|
self.volume['id'], extend_size)
|
||||||
|
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
@@ -228,7 +227,7 @@ class VolumesV2NegativeTest(base.BaseVolumeTest):
|
|||||||
# Mark volume as reserved.
|
# Mark volume as reserved.
|
||||||
self.client.reserve_volume(self.volume['id'])
|
self.client.reserve_volume(self.volume['id'])
|
||||||
# Mark volume which is marked as reserved before
|
# Mark volume which is marked as reserved before
|
||||||
self.assertRaises(exceptions.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.client.reserve_volume,
|
self.client.reserve_volume,
|
||||||
self.volume['id'])
|
self.volume['id'])
|
||||||
# Unmark volume as reserved.
|
# Unmark volume as reserved.
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ import yaml
|
|||||||
|
|
||||||
import tempest.auth
|
import tempest.auth
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
from tempest.openstack.common import log as logging
|
from tempest.openstack.common import log as logging
|
||||||
from tempest.openstack.common import timeutils
|
from tempest.openstack.common import timeutils
|
||||||
from tempest.services.compute.json import flavors_client
|
from tempest.services.compute.json import flavors_client
|
||||||
@@ -708,7 +707,7 @@ def create_subnets(subnets):
|
|||||||
cidr=subnet['range'],
|
cidr=subnet['range'],
|
||||||
name=subnet['name'],
|
name=subnet['name'],
|
||||||
ip_version=ip_version)
|
ip_version=ip_version)
|
||||||
except exceptions.BadRequest as e:
|
except lib_exc.BadRequest as e:
|
||||||
is_overlapping_cidr = 'overlaps with another subnet' in str(e)
|
is_overlapping_cidr = 'overlaps with another subnet' in str(e)
|
||||||
if not is_overlapping_cidr:
|
if not is_overlapping_cidr:
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
|||||||
tenant_id=tenant_id,
|
tenant_id=tenant_id,
|
||||||
ip_version=4)
|
ip_version=4)
|
||||||
break
|
break
|
||||||
except exceptions.BadRequest as e:
|
except lib_exc.BadRequest as e:
|
||||||
if 'overlaps with another subnet' not in str(e):
|
if 'overlaps with another subnet' not in str(e):
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ from tempest_lib.common import rest_client
|
|||||||
from tempest_lib import exceptions as lib_exceptions
|
from tempest_lib import exceptions as lib_exceptions
|
||||||
|
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest import exceptions
|
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
|
||||||
@@ -59,8 +58,6 @@ class ServiceClient(rest_client.RestClient):
|
|||||||
method, url,
|
method, url,
|
||||||
extra_headers=extra_headers,
|
extra_headers=extra_headers,
|
||||||
headers=headers, body=body)
|
headers=headers, body=body)
|
||||||
except lib_exceptions.BadRequest as ex:
|
|
||||||
raise exceptions.BadRequest(ex)
|
|
||||||
# TODO(oomichi): This is just a workaround for failing gate tests
|
# TODO(oomichi): This is just a workaround for failing gate tests
|
||||||
# when separating Forbidden from Unauthorized in tempest-lib.
|
# when separating Forbidden from Unauthorized in tempest-lib.
|
||||||
# We will need to remove this translation and replace negative tests
|
# We will need to remove this translation and replace negative tests
|
||||||
|
|||||||
Reference in New Issue
Block a user