Fix tests broken by the new assignment api
This commit is contained in:
parent
827ca283f3
commit
b1b005964f
@ -24,6 +24,7 @@ import xml.parsers.expat
|
|||||||
import lxml.etree
|
import lxml.etree
|
||||||
|
|
||||||
import qubes
|
import qubes
|
||||||
|
import qubes.devices
|
||||||
import qubes.vm.appvm
|
import qubes.vm.appvm
|
||||||
import qubes.vm.standalonevm
|
import qubes.vm.standalonevm
|
||||||
import qubes.vm.templatevm
|
import qubes.vm.templatevm
|
||||||
@ -219,8 +220,9 @@ class Core2Qubes(qubes.Qubes):
|
|||||||
pcidevs = ast.literal_eval(pcidevs)
|
pcidevs = ast.literal_eval(pcidevs)
|
||||||
for pcidev in pcidevs:
|
for pcidev in pcidevs:
|
||||||
try:
|
try:
|
||||||
vm.devices["pci"].attach(
|
dev = self.domains[0].devices['pci'][pcidev]
|
||||||
self.domains[0].devices['pci'][pcidev])
|
assignment = qubes.devices.DeviceAssignment(backend_domain=dev.backend_domain, ident=dev.ident)
|
||||||
|
vm.devices["pci"].attach(assignment)
|
||||||
except qubes.exc.QubesException as e:
|
except qubes.exc.QubesException as e:
|
||||||
self.log.error("VM {}: {}".format(vm.name, str(e)))
|
self.log.error("VM {}: {}".format(vm.name, str(e)))
|
||||||
except (ValueError, LookupError) as err:
|
except (ValueError, LookupError) as err:
|
||||||
|
@ -108,7 +108,7 @@ class TC_10_BaseVM(qubes.tests.QubesTestCase):
|
|||||||
})
|
})
|
||||||
|
|
||||||
self.assertCountEqual(vm.devices.keys(), ('pci',))
|
self.assertCountEqual(vm.devices.keys(), ('pci',))
|
||||||
self.assertCountEqual(list(vm.devices['pci'].attached(persistent=True)),
|
self.assertCountEqual(list(vm.devices['pci'].persistent()),
|
||||||
[qubes.ext.pci.PCIDevice(vm, '00:11.22')])
|
[qubes.ext.pci.PCIDevice(vm, '00:11.22')])
|
||||||
|
|
||||||
self.assertXMLIsValid(vm.__xml__(), 'domain.rng')
|
self.assertXMLIsValid(vm.__xml__(), 'domain.rng')
|
||||||
|
Loading…
Reference in New Issue
Block a user