The nova.tests.test_api Module

Unit tests for the API endpoint.

class ApiEc2TestCase(*args, **kwargs)

Bases: nova.test.TestCase

Unit test for the cloud controller on an EC2 API.

expect_http(host=None, is_secure=False, api_version=None)

Returns a new EC2 connection.

setUp()
test_authorize_revoke_security_group_cidr()

Test that we can add and remove CIDR based rules to a security group

test_authorize_revoke_security_group_cidr_v6()

Test that we can add and remove CIDR based rules to a security group for IPv6

test_authorize_revoke_security_group_foreign_group()

Test that we can grant and revoke another security group access to a security group

test_create_delete_security_group()
test_create_duplicate_key_pair()

Test that, after successfully generating a keypair, requesting a second keypair with the same name fails sanely

test_describe_instances()

Test that, after creating a user and a project, the describe instances call to the API works properly

test_get_all_key_pairs()

Test that, after creating a user and project and generating a key pair, that the API call to list key pairs works properly

test_get_all_security_groups()
test_group_name_valid_chars_security_group()

Test that we sanely handle invalid security group names. EC2 API Spec states we should only accept alphanumeric characters, spaces, dashes, and underscores. Amazon implementation accepts more characters - so, [:print:] is ok.

test_group_name_valid_length_security_group()

Test that we sanely handle invalid security group names. API Spec states that the length should not exceed 255 chars

test_return_valid_isoformat()

Ensure that the ec2 api returns datetime in xs:dateTime (which apparently isn’t datetime.isoformat()) NOTE(ken-pepple): https://bugs.launchpad.net/nova/+bug/721297

test_terminate_invalid_instance()
test_xmlns_version_matches_request_version()
class Ec2utilsTestCase(*args, **kwargs)

Bases: nova.test.TestCase

test_bad_ec2_id()
test_dict_from_dotted_str()
test_ec2_id_to_id()
test_id_to_ec2_id()
test_mapping_prepend_dev()
test_properties_root_defice_name()
class FakeHttplibConnection(app, host, is_secure=False)

Bases: object

A fake httplib.HTTPConnection for boto to use

requests made via this connection actually get translated and routed into our WSGI app, we then wait for the response and turn it back into the HTTPResponse that boto expects.

close()

Required for compatibility with boto/tornado.

getresponse()
getresponsebody()
request(method, path, data, headers)
class FakeHttplibSocket(response_string)

Bases: object

a fake socket implementation for httplib.HTTPResponse, trivial.

makefile(_mode, _other)

Returns the socket’s internal buffer.

class XmlConversionTestCase(*args, **kwargs)

Bases: nova.test.TestCase

Unit test api xml conversion.

test_number_conversion()

Previous topic

The nova.tests.servicegroup.test_zk_driver Module

Next topic

The nova.tests.test_availability_zones Module

This Page