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):