Nova Fakes

The fakevirt Module

A fake (in-memory) hypervisor+api. Allows nova testing w/o KVM and libvirt.

class nova.fakevirt.FakeVirtConnection

Bases: object

createXML(xml, flags)
classmethod instance()
listDomainsID()
listNetworks()
lookupByID(i)
lookupByName(instance_id)
networkCreateXML(xml)
class nova.fakevirt.FakeVirtInstance(conn, index, name, xml)

Bases: object

XMLDesc(flags)
blockStats(disk)
destroy()
info()
interfaceStats(iface)
name()

The fakeldap Module

Fake LDAP server for test harnesses.

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 nova.auth.fakeldap.FakeLDAP

Bases: object

add_s(dn, attr)
Add an object with the specified attributes at dn.
delete_s(dn)
Remove the ldap object at specified dn.
modify_s(dn, attrs)

Modify the object at dn using the attribute list.

Args: dn – a dn attrs – a list of tuples in the following form:

([MOD_ADD | MOD_DELETE], attribute, value)
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_SUBTREE is supported query – query to filter objects by fields – fields to return. Returns all fields if not specified

simple_bind_s(dn, password)
This method is ignored, but provided for compatibility.
unbind_s()
This method is ignored, but provided for compatibility.
exception nova.auth.fakeldap.NO_SUCH_OBJECT
Bases: exceptions.Exception
exception nova.auth.fakeldap.OBJECT_CLASS_VIOLATION
Bases: exceptions.Exception
nova.auth.fakeldap.initialize(uri)

The fakerabbit Module

Based a bit on the carrot.backeds.queue backend... but a lot better

class nova.fakerabbit.Backend(*args, **kwargs)

Bases: object

Singleton backend for testing

class nova.fakerabbit.Exchange(name, exchange_type)

Bases: object

bind(callback, routing_key)
publish(message, routing_key=None)
class nova.fakerabbit.Message(backend, **kwargs)
Bases: carrot.backends.base.BaseMessage
class nova.fakerabbit.Queue(name)

Bases: object

pop()
push(message, routing_key=None)
size()
nova.fakerabbit.reset_all()

Table Of Contents

Previous topic

Endpoint Documentation

Next topic

NOVA Libraries

This Page