Re: [virt-manager PATCH] tests: fix TestCapabilities.testCPUMap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux