Giuseppe Scrivano wrote: > Roman Bogorodskiy <bogorodskiy@xxxxxxxxx> writes: > > > testCPUMap() tries to open /usr/share/libvirt/cpu_map.xml file > > and that fails if libvirt is not installed on the system > > or cpu_map.xml path is different. > > > > Force it to use tests/capabilities-xml/cpu_map.xml file instead. > > --- > > tests/capabilities.py | 2 ++ > > virtinst/capabilities.py | 5 +++-- > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/tests/capabilities.py b/tests/capabilities.py > > index db69c6f..8c18993 100644 > > --- a/tests/capabilities.py > > +++ b/tests/capabilities.py > > @@ -20,6 +20,7 @@ import unittest > > > > from tests import utils > > from virtinst import CapabilitiesParser as capabilities > > +from virtinst.capabilities import _CPUMapFileValues > > > > > > def build_host_feature_dict(feature_list): > > @@ -221,6 +222,7 @@ class TestCapabilities(unittest.TestCase): > > test_utils(new_caps_no_kvm, False, True, False, False, False) > > > > def testCPUMap(self): > > + _CPUMapFileValues._cpu_filename = "tests/capabilities-xml/cpu_map.xml" > > caps = self._buildCaps("libvirt-0.7.6-qemu-caps.xml") > > commit 81696a514441f2320ea10299e1852795f8cb1682 removed the cpu_filename > optional argument from the CPUValues constructor. Maybe we > should revert partly that commit and pass cpu_filename trough __init__ > again? That could be an option as well, but it seems we'll have to pass cpu_filename all the way down from capabilities.Capabilities as we don't instantiate _CPUMapFileValues directly from the test. Roman Bogorodskiy
Attachment:
pgp3akQADcoFC.pgp
Description: PGP signature
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list