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,
DiskOffering,
Template,
listConfigurations,Configurations)
from marvin.lib.common import (get_domain,list_isos,
Configurations)
from marvin.lib.common import (get_domain,
get_zone,
get_template)
from nose.plugins.attrib import attr
from ast import literal_eval
from marvin.codes import PASS
from marvin.cloudstackException import CloudstackAPIException
from marvin.sshClient import SshClient
from marvin.cloudstackException import CloudstackAPIException
import time
class TestInstance(cloudstackTestCase):
@ -134,7 +131,7 @@ class TestInstance(cloudstackTestCase):
@attr(tags=["advanced"], required_hardware="true")
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'
Step2: Deploy a Windows 2012 R2 instance.
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.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(
self.userapiclient,
self.services["Windows Server 2012"],
@ -234,7 +231,7 @@ class TestInstance(cloudstackTestCase):
self.assertIsNotNone(template,"Failed to register CentOS 7 template")
self.debug(
"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)
self.cleanup.append(template)

View File

@ -2113,16 +2113,6 @@ class TestListInstances(cloudstackTestCase):
len(list_keypairs_after),
"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
first_vm_created = VirtualMachine.create(
@ -2155,6 +2145,17 @@ class TestListInstances(cloudstackTestCase):
"VM state should be running after deployment")
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

View File

@ -270,7 +270,7 @@ class TestVMware(cloudstackTestCase):
@attr(tags=["advanced", "basic"], required_hardware="true")
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
Step2 :Launch a VM
Step3: Try to attach VMware Tools ISO
@ -279,6 +279,7 @@ class TestVMware(cloudstackTestCase):
self.hypervisor = str(get_hypervisor_type(self.api_client)).lower()
if self.hypervisor != "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(
self.userapiclient,
self.services["Rhel7template"],

View File

@ -221,8 +221,11 @@ class TestVmUsage(cloudstackTestCase):
projectlist=Project.list(self.apiclient,account=self.account.name,
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(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.virtual_machine = VirtualMachine.create(
@ -1931,8 +1934,8 @@ class TestVMSnapshotUsage(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
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):
"""Test Create/Delete a manual snap shot and verify
correct usage is recorded

View File

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