OpenAcademy-OpenStack/nova-simulator — pull request #2 by alvaromorales (2014-04-16 05:25:16+00:00)
Title: Simulate errors and delays with an enhanced FakeDriver

Starting a new pull request because we still have an open bug in Deen's branch.

Created a new driver "SimulatorDriver". Currently it contains code from fake.FakeDriver, but we may want to modify it in the future.

Added a decorator, @simulate, which delays a request or raises an exception with configurable probabilities. For example, if simulator_error_probability is set to 0.5, the probability of raising an exception is 50%.

Tested with various probabilities. Any ideas on how to (unit) test this driver?

To test locally, specify the following options in the nova.conf file:

compute_driver = nova.virt.simulator.SimulatorDriver
simulator_error_probability = 0.0
simulator_delay_probability = 0.0
simulator_delay_ms = 0