Change in vdsm[master]: tests: ignore numa topology in vlan tests
fromani at redhat.com
fromani at redhat.com
Thu Feb 12 14:00:26 UTC 2015
Francesco Romani has uploaded a new change for review.
Change subject: tests: ignore numa topology in vlan tests
......................................................................
tests: ignore numa topology in vlan tests
memoization in caps.py leads to inconsistent
data being stored in the process' global state.
One annoying example is the numa topology.
To test getNumaTopology(), caps.py is fed
with fake data, but as side effect the result
constructed on the fake data is memoized.
This is a source of troubles with later tests
run in the same process, if they access, most
often implicitely, this data.
That's the case for a couple of sampling tests.
But these tests are about vlan, and they don't
care about NUMA.
As band-aid fix, this patch disables numa gathering
in their path.
Change-Id: Ibd986403a76268995b83c9e6ac400e942ed24cb6
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M tests/samplingTests.py
1 file changed, 13 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/37748/1
diff --git a/tests/samplingTests.py b/tests/samplingTests.py
index 1d0dd4d..e52688e 100644
--- a/tests/samplingTests.py
+++ b/tests/samplingTests.py
@@ -29,6 +29,8 @@
from vdsm import ipwrapper
import virt.sampling as sampling
+import caps
+
from testValidation import brokentest, ValidateRunningAsRoot
from testlib import permutations, expandPermutations
from testlib import VdsmTestCase as TestCaseBase
@@ -147,14 +149,16 @@
@ValidateRunningAsRoot
def testHostSampleReportsNewInterface(self):
- hs_before = sampling.HostSample(os.getpid())
- interfaces_before = set(hs_before.interfaces.iterkeys())
+ with MonkeyPatchScope([(caps, 'getNumaTopology',
+ lambda: {})]):
+ hs_before = sampling.HostSample(os.getpid())
+ interfaces_before = set(hs_before.interfaces.iterkeys())
- with dummy_if() as dummy_name:
- hs_after = sampling.HostSample(os.getpid())
- interfaces_after = set(hs_after.interfaces.iterkeys())
- interfaces_diff = interfaces_after - interfaces_before
- self.assertEqual(interfaces_diff, set([dummy_name]))
+ with dummy_if() as dummy_name:
+ hs_after = sampling.HostSample(os.getpid())
+ interfaces_after = set(hs_after.interfaces.iterkeys())
+ interfaces_diff = interfaces_after - interfaces_before
+ self.assertEqual(interfaces_diff, set([dummy_name]))
@ValidateRunningAsRoot
def testHostSampleHandlesDisappearingVlanInterfaces(self):
@@ -166,7 +170,8 @@
return iter(all_links)
with MonkeyPatchScope(
- [(ipwrapper, 'getLinks', faultyGetLinks)]):
+ [(ipwrapper, 'getLinks', faultyGetLinks),
+ (caps, 'getNumaTopology', lambda: {})]):
with dummy_if() as dummy_name:
with vlan(self.NEW_VLAN, dummy_name, 999):
hs = sampling.HostSample(os.getpid())
--
To view, visit http://gerrit.ovirt.org/37748
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd986403a76268995b83c9e6ac400e942ed24cb6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
More information about the vdsm-patches
mailing list