From b274f015e00b385e8f33a6c8aafa21a3a0fce337 Mon Sep 17 00:00:00 2001 From: Matt Stephenson Date: Tue, 3 Apr 2012 14:38:09 -0700 Subject: [PATCH] Get unit tests functional in OS X * Add detection for directio to ensure the python runtime is built with O_DIRECT * Extend stubbing in test_libvirt to also stub out _supports_direct_io Change-Id: Id793d4039311396f0b3c3a52d2a1d951ec3c5e48 --- nova/tests/test_libvirt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 4eea7b0b..b16f1060 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -882,6 +882,12 @@ class LibvirtConnTestCase(test.TestCase): self.stubs.Set(os, 'open', os_open_stub) + def connection_supports_direct_io_stub(*args, **kwargs): + return directio_supported + + self.stubs.Set(connection.LibvirtConnection, + '_supports_direct_io', connection_supports_direct_io_stub) + user_context = context.RequestContext(self.user_id, self.project_id) instance_ref = db.instance_create(user_context, self.test_instance) network_info = _fake_network_info(self.stubs, 1)