Fixes zuul issues
Some issues were not caught during the initial mock autospec patch which was added to compute_hyperv, and now they're causing some unit tests to fail. This patch fixes those issues. Secondly, the docs job relies on tools/tox_install.sh to install nova, but it is not passing the required arguments, causing it to fail. This patch updates the script so it can properly execute. Change-Id: I91cbadb2a05ee4880c3fa761696818ec95c40df2
This commit is contained in:
parent
aadc23122c
commit
48bb0d6b41
|
@ -18,6 +18,7 @@ import mock
|
|||
from nova.compute import power_state
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
from nova.network.neutronv2 import api as network_api
|
||||
from nova import objects
|
||||
from os_win import exceptions as os_win_exc
|
||||
|
||||
|
@ -35,7 +36,7 @@ class ClusterOpsTestCase(test_base.HyperVBaseTestCase):
|
|||
|
||||
_autospec_classes = [
|
||||
clusterops.hostops.HostOps,
|
||||
clusterops.network.API,
|
||||
network_api.API,
|
||||
clusterops.vmops.VMOps,
|
||||
clusterops.serialconsoleops.SerialConsoleOps,
|
||||
]
|
||||
|
|
|
@ -22,6 +22,7 @@ import sys
|
|||
|
||||
import mock
|
||||
from nova import exception
|
||||
from nova.image import api
|
||||
from nova import safe_utils
|
||||
from nova.tests.unit import fake_instance
|
||||
from nova.virt import driver as base_driver
|
||||
|
@ -43,8 +44,8 @@ class HyperVDriverTestCase(test_base.HyperVBaseTestCase):
|
|||
driver.rdpconsoleops.RDPConsoleOps,
|
||||
driver.serialconsoleops.SerialConsoleOps,
|
||||
driver.imagecache.ImageCache,
|
||||
driver.image.API,
|
||||
driver.pathutils.PathUtils,
|
||||
api.API,
|
||||
]
|
||||
|
||||
FAKE_WIN_2008R2_VERSION = '6.0.0'
|
||||
|
|
|
@ -525,7 +525,7 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
|||
mock.call(root_device_path, mock_vhd_info,
|
||||
mock_instance.flavor.root_gb * units.Gi))
|
||||
else:
|
||||
self.assertFalse(self._pathutils.lookup_root_vhd.called)
|
||||
self.assertFalse(self._pathutils.lookup_root_vhd_path.called)
|
||||
|
||||
mock_check_resize_vhd.assert_has_calls(expected_check_resize)
|
||||
self._vhdutils.get_vhd_info.assert_has_calls(
|
||||
|
|
|
@ -32,9 +32,9 @@ class SerialConsoleHandlerTestCase(test_base.HyperVBaseTestCase):
|
|||
def setUp(self):
|
||||
super(SerialConsoleHandlerTestCase, self).setUp()
|
||||
|
||||
pathutils.PathUtils.return_value.mock_get_log_paths.return_value = [
|
||||
mock.sentinel.log_path]
|
||||
|
||||
mock_get_vm_console_logs = (
|
||||
pathutils.PathUtils.return_value.get_vm_console_log_paths)
|
||||
mock_get_vm_console_logs.return_value = [mock.sentinel.log_path]
|
||||
self._consolehandler = serialconsolehandler.SerialConsoleHandler(
|
||||
mock.sentinel.instance_name)
|
||||
self._consolehandler._log_path = mock.sentinel.log_path
|
||||
|
|
|
@ -55,7 +55,7 @@ class SnapshotOpsTestCase(test_base.HyperVBaseTestCase):
|
|||
mock.sentinel.PATH, 'rb')
|
||||
glance_image_service.update.assert_called_once_with(
|
||||
self.context, mock.sentinel.IMAGE_ID, image_metadata,
|
||||
self._snapshotops._pathutils.open().__enter__(),
|
||||
self._snapshotops._pathutils.open.return_value.__enter__(),
|
||||
purge_props=False)
|
||||
|
||||
@mock.patch('compute_hyperv.nova.snapshotops.SnapshotOps'
|
||||
|
|
|
@ -52,5 +52,5 @@ shift
|
|||
|
||||
install_project nova
|
||||
|
||||
$install_cmd -U $*
|
||||
$install_cmd -U .
|
||||
exit $?
|
||||
|
|
Loading…
Reference in New Issue