Fake Drivers

Todo

document general info about fakes

When the real thing isn’t available and you have some development to do these fake implementations of various drivers let you get on with your day.

The nova.virt.fake Module

The nova.auth.fakeldap Module

Fake LDAP server for test harness.

This class does very little error checking, and knows nothing about ldap class definitions. It implements the minimum emulation of the python ldap library to work with nova.

class FakeLDAP

Bases: object

Fake LDAP connection.

FakeLDAP.add_s(dn, attr)

Add an object with the specified attributes at dn.

FakeLDAP.delete_s(dn)

Remove the ldap object at specified dn.

FakeLDAP.modify_s(dn, attrs)

Modify the object at dn using the attribute list.

Parameters:
  • dn – a dn
  • attrs

    a list of tuples in the following form:

    ([MOD_ADD | MOD_DELETE | MOD_REPACE], attribute, value)
    
FakeLDAP.modrdn_s(dn, newrdn)
FakeLDAP.search_s(dn, scope, query=None, fields=None)

Search for all matching objects under dn using the query.

Args: dn – dn to search under scope – only SCOPE_BASE and SCOPE_SUBTREE are supported query – query to filter objects by fields – fields to return. Returns all fields if not specified

FakeLDAP.simple_bind_s(dn, password)

This method is ignored, but provided for compatibility.

FakeLDAP.unbind_s()

This method is ignored, but provided for compatibility.

exception NO_SUCH_OBJECT

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

exception OBJECT_CLASS_VIOLATION

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

exception SERVER_DOWN

Bases: exceptions.Exception

Duplicate exception class from real LDAP module.

class Store

Bases: object

classmethod Store.instance()
initialize(_uri)

Opens a fake connection with an LDAP server.

The nova.volume.driver.FakeAOEDriver Class

The nova.tests.service_unittest.FakeManager Class

The nova.tests.api.openstack.fakes Module