Adressed review comment for automating bugs 9277 9276 9275 9274 9273 9179 9178 9177

This commit is contained in:
shweta 2017-02-17 15:33:45 +05:30
parent bdc50338b5
commit 5bbf498faf
5 changed files with 27 additions and 28 deletions

View File

@ -26,16 +26,13 @@ from marvin.lib.base import (Account,
Volume, Volume,
DiskOffering, DiskOffering,
Template, Template,
listConfigurations,Configurations) Configurations)
from marvin.lib.common import (get_domain,list_isos, from marvin.lib.common import (get_domain,
get_zone, get_zone,
get_template) get_template)
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from ast import literal_eval
from marvin.codes import PASS from marvin.codes import PASS
from marvin.cloudstackException import CloudstackAPIException
from marvin.sshClient import SshClient from marvin.sshClient import SshClient
from marvin.cloudstackException import CloudstackAPIException
import time import time
class TestInstance(cloudstackTestCase): class TestInstance(cloudstackTestCase):
@ -134,7 +131,7 @@ class TestInstance(cloudstackTestCase):
@attr(tags=["advanced"], required_hardware="true") @attr(tags=["advanced"], required_hardware="true")
def test1_attach_volume(self): def test1_attach_volume(self):
""" """
@desc: Unable to attach 7th Disk to windows server 2012R2 instance @desc: Unable to attach 7th Disk to windows server 2012R2 instance. Add a valid windows server 2012 URL to execute this test case
Step1: Set global config vmware.root.disk.controller to 'osdefault' Step1: Set global config vmware.root.disk.controller to 'osdefault'
Step2: Deploy a Windows 2012 R2 instance. Step2: Deploy a Windows 2012 R2 instance.
Step3: Attach 6 disks to the VM. Step3: Attach 6 disks to the VM.
@ -146,7 +143,7 @@ class TestInstance(cloudstackTestCase):
self.skipTest("This test can be run only on vmware") self.skipTest("This test can be run only on vmware")
self.updateConfigurAndRestart("vmware.root.disk.controller","osdefault") self.updateConfigurAndRestart("vmware.root.disk.controller","osdefault")
self.services["Windows Server 2012"]["url"]="http://10.147.28.7/templates/Windows2012/WindowsServer2012R2.ova.gz",
template = Template.register( template = Template.register(
self.userapiclient, self.userapiclient,
self.services["Windows Server 2012"], self.services["Windows Server 2012"],
@ -234,7 +231,7 @@ class TestInstance(cloudstackTestCase):
self.assertIsNotNone(template,"Failed to register CentOS 7 template") self.assertIsNotNone(template,"Failed to register CentOS 7 template")
self.debug( self.debug(
"Registered a template with format {} and id {}".format( "Registered a template with format {} and id {}".format(
self.services["Windows Server 2012"]["format"],template.id) self.services["CentOS7template"]["format"],template.id)
) )
template.download(self.userapiclient) template.download(self.userapiclient)
self.cleanup.append(template) self.cleanup.append(template)

View File

@ -2113,16 +2113,6 @@ class TestListInstances(cloudstackTestCase):
len(list_keypairs_after), len(list_keypairs_after),
"List count is not matching" "List count is not matching"
) )
try:
# Registering second key pair using same public key
new_keypair2 = SSHKeyPair.register(
self.userapiclient,
name="keypair2",
publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2")
self.fail("SSH Key creation passed using same public key ")
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)
# Deploying a VM with keypair 1 # Deploying a VM with keypair 1
first_vm_created = VirtualMachine.create( first_vm_created = VirtualMachine.create(
@ -2155,6 +2145,17 @@ class TestListInstances(cloudstackTestCase):
"VM state should be running after deployment") "VM state should be running after deployment")
self.assertEqual(vm.keypair , new_keypair1.name , "VM keypair name is not keypair1") self.assertEqual(vm.keypair , new_keypair1.name , "VM keypair name is not keypair1")
try:
# Registering second key pair using same public key
new_keypair2 = SSHKeyPair.register(
self.userapiclient,
name="keypair2",
publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2")
self.fail("SSH Key creation passed using same public key ")
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)
return return

View File

@ -270,7 +270,7 @@ class TestVMware(cloudstackTestCase):
@attr(tags=["advanced", "basic"], required_hardware="true") @attr(tags=["advanced", "basic"], required_hardware="true")
def test3_attach_ISO_in_RHEL7OSVM(self): def test3_attach_ISO_in_RHEL7OSVM(self):
""" """
@desc:Incorrect guest os mapping in vmware for Rhel7 @desc:Incorrect guest os mapping in vmware for Rhel7. Add a valid RHEL7 URL to execute this test case
Step1 :Register an RHEL 7 template Step1 :Register an RHEL 7 template
Step2 :Launch a VM Step2 :Launch a VM
Step3: Try to attach VMware Tools ISO Step3: Try to attach VMware Tools ISO
@ -279,6 +279,7 @@ class TestVMware(cloudstackTestCase):
self.hypervisor = str(get_hypervisor_type(self.api_client)).lower() self.hypervisor = str(get_hypervisor_type(self.api_client)).lower()
if self.hypervisor != "vmware": if self.hypervisor != "vmware":
self.skipTest("This test can be run only on vmware") self.skipTest("This test can be run only on vmware")
self.services["Rhel7template"]["url"]="http://10.147.28.7/templates/rhel71.ova",
template = Template.register( template = Template.register(
self.userapiclient, self.userapiclient,
self.services["Rhel7template"], self.services["Rhel7template"],

View File

@ -221,8 +221,11 @@ class TestVmUsage(cloudstackTestCase):
projectlist=Project.list(self.apiclient,account=self.account.name, projectlist=Project.list(self.apiclient,account=self.account.name,
domainid=self.account.domainid,id=self.project.id) domainid=self.account.domainid,id=self.project.id)
self.assertEqual(hasattr(projectlist[0],"vmrunning"), True ,
"vmrunningattribute is not returned in list project api ")
self.assertEqual(projectlist[0].vmrunning,0,"vmrunning value is not returned") self.assertEqual(projectlist[0].vmrunning,0,"vmrunning value is not returned")
self.assertEqual(hasattr(projectlist[0], "vmrunning"), True,
"vmrunningattribute is not returned in list project api ")
self.assertEqual(projectlist[0].vmstopped,0,"vmstopped value is not returned") self.assertEqual(projectlist[0].vmstopped,0,"vmstopped value is not returned")
self.virtual_machine = VirtualMachine.create( self.virtual_machine = VirtualMachine.create(
@ -1931,8 +1934,8 @@ class TestVMSnapshotUsage(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e) raise Exception("Warning: Exception during cleanup : %s" % e)
return return
@attr(speed = "slow")
@attr(tags=["advanced", "basic", "sg", "eip", "advancedns", "simulator"], required_hardware="false") @attr(tags=["advanced", "basic"])
def test_01_vmsnapshot_usage(self): def test_01_vmsnapshot_usage(self):
"""Test Create/Delete a manual snap shot and verify """Test Create/Delete a manual snap shot and verify
correct usage is recorded correct usage is recorded

View File

@ -835,9 +835,8 @@ test_data = {
}, },
"coreos_volume": { "coreos_volume": {
"diskname": "Volume_core", "diskname": "Volume_core",
"urlvmware":"http://10.147.28.7/templates/coreos/coreos_production_vmware.ova", "urlvmware":"http://dl.openvm.eu/cloudstack/coreos/x86_64/coreos_production_cloudstack_image-vmware.ova",
"urlxen":"http://10.147.28.7/templates/coreos/" \ "urlxen":"http://dl.openvm.eu/cloudstack/coreos/x86_64/coreos_production_cloudstack_image-xen.vhd.bz2",
"coreos_production_cloudstack_image-xen.vhd.bz2",
"urlkvm": "http://dl.openvm.eu/cloudstack/coreos/x86_64/" \ "urlkvm": "http://dl.openvm.eu/cloudstack/coreos/x86_64/" \
"coreos_production_cloudstack_image-kvm.qcow2.bz2", "coreos_production_cloudstack_image-kvm.qcow2.bz2",
"urlhyperv":"http://dl.openvm.eu/cloudstack/coreos/x86_64/coreos_production_cloudstack_image-hyperv.vhd.zip" "urlhyperv":"http://dl.openvm.eu/cloudstack/coreos/x86_64/coreos_production_cloudstack_image-hyperv.vhd.zip"
@ -857,7 +856,7 @@ test_data = {
"passwordenabled": False, "passwordenabled": False,
"isdynamicallyscalable":True, "isdynamicallyscalable":True,
"ostype": "CentOS 7", "ostype": "CentOS 7",
"url": "http://10.147.28.7/templates/cenots7/Centos7.vhd", "url": "http://dl.openvm.eu/cloudstack/centos/vanilla/7/x86_64/CentOS-7-x86_64-vanilla-xen.vhd.bz2",
"format": "VHD", "format": "VHD",
"ispublic": "true", "ispublic": "true",
"hypervisor":"Xenserver" "hypervisor":"Xenserver"
@ -867,7 +866,6 @@ test_data = {
"name": "Rhel", "name": "Rhel",
"passwordenabled": False, "passwordenabled": False,
"ostype": "Red Hat Enterprise Linux 7", "ostype": "Red Hat Enterprise Linux 7",
"url": "http://10.147.28.7/templates/rhel71.ova",
"format": "OVA", "format": "OVA",
"ispublic": "true" "ispublic": "true"
}, },
@ -895,7 +893,6 @@ test_data = {
"displaytext": "Windows Server 2012", "displaytext": "Windows Server 2012",
"name": "Windows Server 2012", "name": "Windows Server 2012",
"passwordenabled": False, "passwordenabled": False,
"url": "http://10.147.28.7/templates/Windows2012/WindowsServer2012R2.ova.gz",
"format": "OVA", "format": "OVA",
"ostype": "Windows Server 2012 (64-bit)", "ostype": "Windows Server 2012 (64-bit)",
"ispublic": "true", "ispublic": "true",