Francesco Romani has uploaded a new change for review.
Change subject: tests: move more fakes into vmfakelib ......................................................................
tests: move more fakes into vmfakelib
This patch move more Fakes into the common library, to avoid duplication and to give them better spotlight.
Beside renames (e.g. FakeSuperVdsm -> fake.SuperVdsm) there are no code changes.
Change-Id: Ib2f844a6586eca567fede25b193a762318badd9f Signed-off-by: Francesco Romani fromani@redhat.com --- M tests/numaUtilsTests.py M tests/vmfakelib.py 2 files changed, 30 insertions(+), 30 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/32821/1
diff --git a/tests/numaUtilsTests.py b/tests/numaUtilsTests.py index fa74116..82caf57 100644 --- a/tests/numaUtilsTests.py +++ b/tests/numaUtilsTests.py @@ -43,34 +43,6 @@ </domstatus>"""
-class FakeSuperVdsm: - def __init__(self): - pass - - def getProxy(self): - return self - - def getVcpuNumaMemoryMapping(self, vmName): - return {0: [0, 1], 1: [0, 1], 2: [0, 1], 3: [0, 1]} - - -class FakeAdvancedStatsFunction: - def __init__(self): - pass - - def getStats(self): - return [], [(0, 1, 19590000000L, 1), - (1, 1, 10710000000L, 1), - (2, 1, 19590000000L, 0), - (3, 1, 19590000000L, 2)], 15 - - -class FakeVmStatsThread: - def __init__(self, vm): - self._vm = vm - self.sampleVcpuPinning = FakeAdvancedStatsFunction() - - class TestNumaUtils(TestCaseBase):
@MonkeyPatch(minidom, 'parse', @@ -83,7 +55,7 @@ 3: '12269'} self.assertEqual(vcpuPids, expectedVcpuPids)
- @MonkeyPatch(numaUtils, 'supervdsm', FakeSuperVdsm()) + @MonkeyPatch(numaUtils, 'supervdsm', fake.SuperVdsm()) @MonkeyPatch(caps, 'getNumaTopology', lambda: {'0': {'cpus': [0, 1, 2, 3], @@ -98,7 +70,7 @@ 'memory': '1024', 'nodeIndex': 1}]} with fake.VM(VM_PARAMS) as testvm: - testvm._vmStats = FakeVmStatsThread(testvm) + testvm._vmStats = fake.VmStatsThread(testvm) expectedResult = {'0': [0, 1], '1': [0, 1]} vmNumaNodeRuntimeMap = numaUtils.getVmNumaNodeRuntimeInfo(testvm) self.assertEqual(expectedResult, vmNumaNodeRuntimeMap) diff --git a/tests/vmfakelib.py b/tests/vmfakelib.py index 4b4bbd9..200a2ab 100644 --- a/tests/vmfakelib.py +++ b/tests/vmfakelib.py @@ -139,3 +139,31 @@ if status is not None: fake._lastStatus = status yield fake + + +class SuperVdsm: + def __init__(self): + pass + + def getProxy(self): + return self + + def getVcpuNumaMemoryMapping(self, vmName): + return {0: [0, 1], 1: [0, 1], 2: [0, 1], 3: [0, 1]} + + +class AdvancedStatsFunction: + def __init__(self): + pass + + def getStats(self): + return [], [(0, 1, 19590000000L, 1), + (1, 1, 10710000000L, 1), + (2, 1, 19590000000L, 0), + (3, 1, 19590000000L, 2)], 15 + + +class VmStatsThread: + def __init__(self, vm): + self._vm = vm + self.sampleVcpuPinning = AdvancedStatsFunction()
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11468/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12412/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12257/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11565/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12509/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12354/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 2: Verified+1
since this patch just moves code around, verified by (succesfully) running 'make check' and 'make rpm'.
Vitor de Lima has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 2: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 2: Code-Review+2
Dan Kenigsberg has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 2: Code-Review-1
please rebase
Francesco Romani has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 3: Verified+1
rebased re-verified re-running the tests without issues.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 3:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13235/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13075/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12285/ : FAILURE
Francesco Romani has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 3:
reason of failure:
---------------------------------------------------------------------- Ran 690 tests in 66.090s
OK (SKIP=52) make[3]: Leaving directory `/home/jenkins/workspace/vdsm_master_unit_tests_gerrit_el/vdsm/tests' make[2]: Leaving directory `/home/jenkins/workspace/vdsm_master_unit_tests_gerrit_el/vdsm/tests' make[1]: Leaving directory `/home/jenkins/workspace/vdsm_master_unit_tests_gerrit_el/vdsm/tests' make[1]: Entering directory `/home/jenkins/workspace/vdsm_master_unit_tests_gerrit_el/vdsm' make[1]: Nothing to be done for `check-am'. make[1]: Leaving directory `/home/jenkins/workspace/vdsm_master_unit_tests_gerrit_el/vdsm' Recording test results No test report files were found. Configuration error? Build step 'Publish JUnit test result report' changed build result to FAILURE Started calculate disk usage of build Finished Calculation of disk usage of build in 0 seconds Started calculate disk usage of workspace Finished Calculation of disk usage of workspace in 0 seconds Finished: FAILURE
Dan Kenigsberg has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 3: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: move more fakes into vmfakelib ......................................................................
tests: move more fakes into vmfakelib
This patch move more Fakes into the common library, to avoid duplication and to give them better spotlight.
Beside renames (e.g. FakeSuperVdsm -> fake.SuperVdsm) there are no code changes.
Change-Id: Ib2f844a6586eca567fede25b193a762318badd9f Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: http://gerrit.ovirt.org/32821 Reviewed-by: Dan Kenigsberg danken@redhat.com --- M tests/numaUtilsTests.py M tests/vmfakelib.py 2 files changed, 33 insertions(+), 34 deletions(-)
Approvals: Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: move more fakes into vmfakelib ......................................................................
Patch Set 4:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/4142/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc21-x86_64_merged/134/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el6-x86_64_merged/157/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_create-rpms_merged_test_debug/350/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5982/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el7-x86_64_merged/155/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc20-x86_64_merged/150/ : SUCCESS
vdsm-patches@lists.fedorahosted.org