@@ -2180,8 +2180,8 @@ def setUp(self):
21802180
21812181 self .useFixture (
21822182 fixtures .MockPatch ('nova.virt.libvirt.utils.get_fs_info' ))
2183- self .useFixture (
2184- fixtures .MockPatch ('nova.compute.utils.get_machine_ips' ))
2183+ self .mock_get_machine_ips = self . useFixture (
2184+ fixtures .MockPatch ('nova.compute.utils.get_machine_ips' )). mock
21852185
21862186 # libvirt driver needs to call out to the filesystem to get the
21872187 # parent_ifname for the SRIOV VFs.
@@ -2191,20 +2191,25 @@ def setUp(self):
21912191
21922192 self .useFixture (fixtures .MockPatch (
21932193 'nova.pci.utils.get_mac_by_pci_address' ,
2194- new = self .fake_get_mac_by_pci_address ))
2194+ side_effect = self .fake_get_mac_by_pci_address ))
21952195
21962196 # libvirt calls out to sysfs to get the vfs ID during macvtap plug
2197- self .useFixture (fixtures .MockPatch (
2198- 'nova.pci.utils.get_vf_num_by_pci_address' , return_value = 1 ))
2197+ self .mock_get_vf_num_by_pci_address = self .useFixture (
2198+ fixtures .MockPatch (
2199+ 'nova.pci.utils.get_vf_num_by_pci_address' , return_value = 1
2200+ )
2201+ ).mock
21992202
22002203 # libvirt calls out to privsep to set the mac and vlan of a macvtap
2201- self .useFixture (fixtures .MockPatch (
2202- 'nova.privsep.linux_net.set_device_macaddr_and_vlan' ))
2204+ self .mock_set_device_macaddr_and_vlan = self .useFixture (
2205+ fixtures .MockPatch (
2206+ 'nova.privsep.linux_net.set_device_macaddr_and_vlan' )).mock
22032207
22042208 # libvirt calls out to privsep to set the port state during macvtap
22052209 # plug
2206- self .useFixture (fixtures .MockPatch (
2207- 'nova.privsep.linux_net.set_device_macaddr' ))
2210+ self .mock_set_device_macaddr = self .useFixture (
2211+ fixtures .MockPatch (
2212+ 'nova.privsep.linux_net.set_device_macaddr' )).mock
22082213
22092214 # Don't assume that the system running tests has a valid machine-id
22102215 self .useFixture (fixtures .MockPatch (
@@ -2219,8 +2224,8 @@ def setUp(self):
22192224 # Ensure tests perform the same on all host architectures
22202225 fake_uname = os_uname (
22212226 'Linux' , '' , '5.4.0-0-generic' , '' , obj_fields .Architecture .X86_64 )
2222- self .useFixture (
2223- fixtures .MockPatch ('os.uname' , return_value = fake_uname ))
2227+ self .mock_uname = self . useFixture (
2228+ fixtures .MockPatch ('os.uname' , return_value = fake_uname )). mock
22242229
22252230 # ...and on all machine types
22262231 fake_loaders = [
0 commit comments