Francesco Romani has uploaded a new change for review.
Change subject: tests: virt: move powerdown related tests away ......................................................................
tests: virt: move powerdown related tests away
Bootstrap vmPowerdownTests.py, moving powerdown-related tests from vmTests.py.
Change-Id: Ibe9e10e8791d0db850a7bdc365327f35b27896e6 Only-Move: yes Signed-off-by: Francesco Romani fromani@redhat.com --- M tests/Makefile.am A tests/vmPowerdownTests.py M tests/vmTests.py 3 files changed, 50 insertions(+), 20 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/45064/1
diff --git a/tests/Makefile.am b/tests/Makefile.am index c522538..025f2a6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -113,6 +113,7 @@ vmApiTests.py \ vmfakelibTests.py \ vmMigrationTests.py \ + vmPowerdownTests.py \ vmSecretTests.py \ vmStatsTests.py \ vmStorageTests.py \ diff --git a/tests/vmPowerdownTests.py b/tests/vmPowerdownTests.py new file mode 100644 index 0000000..453c935 --- /dev/null +++ b/tests/vmPowerdownTests.py @@ -0,0 +1,49 @@ +# +# Copyright 2015 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from vdsm import response + +from virt import vm + +from testlib import VdsmTestCase as TestCaseBase +import vmfakelib as fake + + +class TestVmOperations(TestCaseBase): + + def testAcpiShutdownDisconnected(self): + with fake.VM() as testvm: + testvm._dom = vm.DisconnectedVirDomain(vmid='testvm') + self.assertTrue(response.is_error(testvm.acpiShutdown())) + + def testAcpiShutdownConnected(self): + with fake.VM() as testvm: + testvm._dom = fake.Domain(vmId='testvm') + self.assertFalse(response.is_error(testvm.acpiShutdown())) + + def testAcpiRebootDisconnected(self): + with fake.VM() as testvm: + testvm._dom = vm.DisconnectedVirDomain(vmid='testvm') + self.assertTrue(response.is_error(testvm.acpiReboot())) + + def testAcpiRebootConnected(self): + with fake.VM() as testvm: + testvm._dom = fake.Domain(vmId='testvm') + self.assertFalse(response.is_error(testvm.acpiReboot())) diff --git a/tests/vmTests.py b/tests/vmTests.py index 14a1872..76bca98 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -1200,26 +1200,6 @@ self.assertEqual(res, response.error('ticketErr', message))
- def testAcpiShutdownDisconnected(self): - with fake.VM() as testvm: - testvm._dom = vm.DisconnectedVirDomain(vmid='testvm') - self.assertTrue(response.is_error(testvm.acpiShutdown())) - - def testAcpiShutdownConnected(self): - with fake.VM() as testvm: - testvm._dom = fake.Domain(vmId='testvm') - self.assertFalse(response.is_error(testvm.acpiShutdown())) - - def testAcpiRebootDisconnected(self): - with fake.VM() as testvm: - testvm._dom = vm.DisconnectedVirDomain(vmid='testvm') - self.assertTrue(response.is_error(testvm.acpiReboot())) - - def testAcpiRebootConnected(self): - with fake.VM() as testvm: - testvm._dom = fake.Domain(vmId='testvm') - self.assertFalse(response.is_error(testvm.acpiReboot())) -
class ChangingSchedulerDomain(object):
automation@ovirt.org has posted comments on this change.
Change subject: tests: virt: move powerdown related tests away ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: tests: virt: move powerdown related tests away ......................................................................
Patch Set 1: Verified+1
verified running 'make check'
Martin Betak has posted comments on this change.
Change subject: tests: virt: move powerdown related tests away ......................................................................
Patch Set 1: Code-Review+1
Martin Polednik has posted comments on this change.
Change subject: tests: virt: move powerdown related tests away ......................................................................
Patch Set 1: Code-Review-1
I'm not sure I like that granular test for the operations. More specifically, the module is named vmPowerdownTests, but the test class is named TestVmOperations.
If we made just vmOperationTests module, how large would it be? If it's reasonable, this is one case where I'm not sure splitting makes sense. If it does make sense (the module could become too large) then please name the class to reflect that only powerdown operations are tested.
Francesco Romani has posted comments on this change.
Change subject: tests: virt: move powerdown related tests away ......................................................................
Patch Set 1:
Splitting out vmOperationTests seems even better, I'll go that way. Thanks Martin!
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 2: Verified+1
verified running - old tests (vmTests) - new tests (vmOperationsTests) - all tests (make check)
Francesco Romani has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/45064/2//COMMIT_MSG Commit Message:
Line 3: AuthorDate: 2015-08-21 14:13:04 +0200 Line 4: Commit: Francesco Romani fromani@redhat.com Line 5: CommitDate: 2015-08-21 14:45:32 +0200 Line 6: Line 7: tests: split vm operation tests. trailing dot Line 8: Line 9: vmTests.py is going down the same route as vm.py. Line 10: Luckly, here it is easier to split the module, so let's Line 11: start extracting so-called 'vm operation' tests.
Martin Polednik has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 2: Code-Review+1
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 4: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests. ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests ......................................................................
Patch Set 6:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: tests: split vm operation tests ......................................................................
Patch Set 6: Verified+1
verified again with make check.
Dan Kenigsberg has posted comments on this change.
Change subject: tests: split vm operation tests ......................................................................
Patch Set 6: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests ......................................................................
Patch Set 7:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: split vm operation tests ......................................................................
tests: split vm operation tests
vmTests.py is going down the same route as vm.py. Luckly, here it is easier to split the module, so let's start extracting so-called 'vm operation' tests.
Only-Move: yes Change-Id: Ibe9e10e8791d0db850a7bdc365327f35b27896e6 Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: https://gerrit.ovirt.org/45064 Reviewed-by: Dan Kenigsberg danken@redhat.com Continuous-Integration: Jenkins CI --- M tests/Makefile.am A tests/vmOperationsTests.py M tests/vmTests.py 3 files changed, 358 insertions(+), 295 deletions(-)
Approvals: Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified
automation@ovirt.org has posted comments on this change.
Change subject: tests: split vm operation tests ......................................................................
Patch Set 8:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org