mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Remove duplicate tests for stopped_vm
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
65fc2ec345
commit
16c1de84e0
@ -1324,148 +1324,6 @@ class TestDeployVMBasicZone(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.debug("Warning! Exception in tearDown: %s" % e)
|
self.debug("Warning! Exception in tearDown: %s" % e)
|
||||||
|
|
||||||
@attr(tags = ["eip", "basic", "sg"])
|
|
||||||
def test_01_deploy_vm_startvm_true(self):
|
|
||||||
"""Test Deploy Virtual Machine with startVM=true parameter
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Validate the following:
|
|
||||||
# 1. deploy Vm with the startvm=true
|
|
||||||
# 2. Should be able to login to the VM.
|
|
||||||
# 3. listVM command should return the deployed VM.State of this VM
|
|
||||||
# should be "Running".
|
|
||||||
|
|
||||||
self.debug("Checking the network type of the zone: %s" %
|
|
||||||
self.zone.networktype)
|
|
||||||
self.assertEqual(
|
|
||||||
self.zone.networktype,
|
|
||||||
'Basic',
|
|
||||||
"Zone must be configured in basic networking mode"
|
|
||||||
)
|
|
||||||
self.debug("Deploying instance in the account: %s" %
|
|
||||||
self.account.name)
|
|
||||||
self.virtual_machine = VirtualMachine.create(
|
|
||||||
self.apiclient,
|
|
||||||
self.services["virtual_machine"],
|
|
||||||
accountid=self.account.name,
|
|
||||||
domainid=self.account.domainid,
|
|
||||||
serviceofferingid=self.service_offering.id,
|
|
||||||
startvm=True,
|
|
||||||
diskofferingid=self.disk_offering.id,
|
|
||||||
mode=self.zone.networktype
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug("Deployed instance ion account: %s" %
|
|
||||||
self.account.name)
|
|
||||||
list_vm_response = list_virtual_machines(
|
|
||||||
self.apiclient,
|
|
||||||
id=self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug(
|
|
||||||
"Verify listVirtualMachines response for virtual machine: %s" \
|
|
||||||
% self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(list_vm_response, list),
|
|
||||||
True,
|
|
||||||
"Check list response returns a valid list"
|
|
||||||
)
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
|
|
||||||
vm_response.state,
|
|
||||||
"Running",
|
|
||||||
"VM should be in Running state after deployment"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
@attr(tags = ["eip", "basic", "sg"])
|
|
||||||
def test_02_deploy_vm_startvm_false(self):
|
|
||||||
"""Test Deploy Virtual Machine with startVM=true parameter
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Validate the following:
|
|
||||||
# 1. deploy Vm with the startvm=true
|
|
||||||
# 2. Should be able to login to the VM.
|
|
||||||
# 3. listVM command should return the deployed VM.State of this VM
|
|
||||||
# should be "Running".
|
|
||||||
|
|
||||||
self.debug("Checking the network type of the zone: %s" %
|
|
||||||
self.zone.networktype)
|
|
||||||
self.assertEqual(
|
|
||||||
self.zone.networktype,
|
|
||||||
'Basic',
|
|
||||||
"Zone must be configured in basic networking mode"
|
|
||||||
)
|
|
||||||
self.debug("Deploying instance in the account: %s" %
|
|
||||||
self.account.name)
|
|
||||||
self.virtual_machine = VirtualMachine.create(
|
|
||||||
self.apiclient,
|
|
||||||
self.services["virtual_machine"],
|
|
||||||
accountid=self.account.name,
|
|
||||||
domainid=self.account.domainid,
|
|
||||||
serviceofferingid=self.service_offering.id,
|
|
||||||
startvm=False,
|
|
||||||
mode=self.zone.networktype
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug("Deployed instance in account: %s" %
|
|
||||||
self.account.name)
|
|
||||||
list_vm_response = list_virtual_machines(
|
|
||||||
self.apiclient,
|
|
||||||
id=self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug(
|
|
||||||
"Verify listVirtualMachines response for virtual machine: %s" \
|
|
||||||
% self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(list_vm_response, list),
|
|
||||||
True,
|
|
||||||
"Check list response returns a valid list"
|
|
||||||
)
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
|
|
||||||
vm_response.state,
|
|
||||||
"Stopped",
|
|
||||||
"VM should be in stopped state after deployment"
|
|
||||||
)
|
|
||||||
self.debug("Starting the instance: %s" % self.virtual_machine.name)
|
|
||||||
self.virtual_machine.start(self.apiclient)
|
|
||||||
self.debug("Started the instance: %s" % self.virtual_machine.name)
|
|
||||||
|
|
||||||
list_vm_response = list_virtual_machines(
|
|
||||||
self.apiclient,
|
|
||||||
id=self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.debug(
|
|
||||||
"Verify listVirtualMachines response for virtual machine: %s" \
|
|
||||||
% self.virtual_machine.id
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
isinstance(list_vm_response, list),
|
|
||||||
True,
|
|
||||||
"Check list response returns a valid list"
|
|
||||||
)
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
|
|
||||||
vm_response.state,
|
|
||||||
"Running",
|
|
||||||
"VM should be in running state after deployment"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
class TestDeployVMFromTemplate(cloudstackTestCase):
|
class TestDeployVMFromTemplate(cloudstackTestCase):
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user