From fc0dfb369eb8fd0e71839ed71da85acff81fa36f Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Fri, 1 Jul 2016 13:11:00 +0100 Subject: [PATCH] XenAPI: UT: Always mock logging configuration The call to configure logging sets up logging to syslog. Some environments, such as the Ubuntu package builder environment, do not permit this operation. Logging is made to syslog as the plugin runs in dom0 on XenServer, not with the rest of Nova, so the oslo logging capabilities can't be used. Mock out the call to configure logging to prevent attempts to use syslog Change-Id: Ie32691d980aff052498c6c5822828ba9703d412b Closes-Bug: 1597433 --- nova/tests/unit/virt/xenapi/plugins/test_partition_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nova/tests/unit/virt/xenapi/plugins/test_partition_utils.py b/nova/tests/unit/virt/xenapi/plugins/test_partition_utils.py index 3761588d5c..e1fceacfc7 100644 --- a/nova/tests/unit/virt/xenapi/plugins/test_partition_utils.py +++ b/nova/tests/unit/virt/xenapi/plugins/test_partition_utils.py @@ -22,6 +22,12 @@ from nova.tests.unit.virt.xenapi.plugins import plugin_test class PartitionUtils(plugin_test.PluginTestBase): def setUp(self): super(PartitionUtils, self).setUp() + self.pluginlib = self.load_plugin("pluginlib_nova.py") + + # Prevent any logging to syslog + self.mock_patch_object(self.pluginlib, + 'configure_logging') + self.partition_utils = self.load_plugin("partition_utils.py") def test_wait_for_dev_ok(self):