add mark.tags

This commit is contained in:
Edison Su 2014-09-15 18:29:30 -07:00
parent c15035874f
commit 9610685f45
41 changed files with 210 additions and 173 deletions

View File

@ -172,7 +172,7 @@
},
{
"name": "account.cleanup.interval",
"value": "600"
"value": "60"
},
{
"name": "guest.domain.suffix",

View File

@ -17,6 +17,6 @@
# under the License.
import pytest
@pytest.mark.attr(tags=["advanced"], required_hardware=True)
@pytest.mark.tags(tags=["advanced"], required_hardware="false")
def test_01_create_disk_offering(vm):
assert vm is not None

View File

@ -24,6 +24,7 @@ from marvin.lib.base import *
from marvin.lib.common import *
from marvin.sshClient import SshClient
from nose.plugins.attrib import attr
import pytest
class TestDeployVmWithAffinityGroup(cloudstackTestCase):
"""
@ -75,7 +76,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
]
return
@attr(tags=["basic", "advanced", "multihost"], required_hardware="false")
@pytest.mark.tags(tags=["basic", "advanced", "multihost"], required_hardware="false")
def test_DeployVmAntiAffinityGroup(self):
"""
test DeployVM in anti-affinity groups

View File

@ -35,8 +35,7 @@ from marvin.sshClient import SshClient
from marvin.codes import FAILED, XEN_SERVER
from nose.plugins.attrib import attr
import pytest
class TestDeployvGPUenabledVM(cloudstackTestCase):
"""
Test deploy a vGPU enabled VM into a user account
@ -119,7 +118,7 @@ class TestDeployvGPUenabledVM(cloudstackTestCase):
self.account
]
@attr(tags = ['advanced', 'basic', 'vgpu'], required_hardware="true")
@pytest.mark.tags(tags = ['advanced', 'basic', 'vgpu'], required_hardware="true")
def test_deploy_vgpu_enabled_vm(self):
"""Test Deploy Virtual Machine

View File

@ -33,8 +33,7 @@ from marvin.lib.common import get_zone, get_domain, get_template, list_volumes
from marvin.codes import FAILED
from nose.plugins.attrib import attr
import pytest
import re
class TestData(object):
@ -105,7 +104,7 @@ class TestDeployVM(cloudstackTestCase):
self.account
]
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
@pytest.mark.tags(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
def test_00_deploy_vm_root_resize(self):
"""Test deploy virtual machine with root resize
@ -204,7 +203,7 @@ class TestDeployVM(cloudstackTestCase):
self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.hypervisor)
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
@pytest.mark.tags(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
def test_01_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize of 0
"""
@ -232,7 +231,7 @@ class TestDeployVM(cloudstackTestCase):
else:
self.debug("test 01 does not support hypervisor type " + self.hypervisor);
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true", BugId="CLOUDSTACK-6984")
@pytest.mark.tags(tags = ['advanced', 'basic', 'sg'], required_hardware="true", BugId="CLOUDSTACK-6984")
def test_02_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize less than template size
"""

View File

@ -21,10 +21,11 @@ from marvin.lib.base import (ServiceOffering,
Account)
from marvin.lib.common import get_template, get_zone, list_virtual_machines
from marvin.lib.utils import cleanup_resources
from nose.plugins.attrib import attr
from marvin.codes import FAILED
import random
import string
import pytest
class TestDeployVmWithUserData(cloudstackTestCase):
"""Tests for UserData
@ -70,7 +71,7 @@ class TestDeployVmWithUserData(cloudstackTestCase):
def setup(self):
self.hypervisor = self.testClient.getHypervisorInfo()
@attr(tags=["devcloud", "basic", "advanced", "post"], required_hardware="true")
@pytest.mark.tags(tags=["devcloud", "basic", "advanced", "post"], required_hardware="true")
def test_deployvm_userdata_post(self):
"""Test userdata as POST, size > 2k
"""
@ -95,7 +96,7 @@ class TestDeployVmWithUserData(cloudstackTestCase):
self.assert_(vm.id == str(deployVmResponse.id), "Vm deployed is different from the test")
self.assert_(vm.state == "Running", "VM is not in Running state")
@attr(tags=["devcloud", "basic", "advanced"], required_hardware="true")
@pytest.mark.tags(tags=["devcloud", "basic", "advanced"], required_hardware="true")
def test_deployvm_userdata(self):
"""Test userdata as GET, size > 2k
"""

View File

@ -20,7 +20,7 @@ from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import Account, VirtualMachine, ServiceOffering, Host, Cluster
from marvin.lib.common import get_zone, get_domain, get_template
from marvin.lib.utils import cleanup_resources
from nose.plugins.attrib import attr
import pytest
class TestDeployVmWithVariedPlanners(cloudstackTestCase):
""" Test to create services offerings for deployment planners
@ -60,7 +60,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
cls.account
]
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic", "sg"], required_hardware="false")
def test_deployvm_firstfit(self):
"""Test to deploy vm with a first fit offering
"""
@ -104,7 +104,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
msg="VM is not in Running state"
)
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic", "sg"], required_hardware="false")
def test_deployvm_userdispersing(self):
"""Test deploy VMs using user dispersion planner
"""
@ -163,7 +163,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
self.debug("VMs (%s, %s) meant to be dispersed are deployed in the same cluster %s" % (
vm1.id, vm2.id, vm1clusterid))
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic", "sg"], required_hardware="false")
def test_deployvm_userconcentrated(self):
"""Test deploy VMs using user concentrated planner
"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
_multiprocess_shared_ = True
@ -45,7 +45,7 @@ class TestCreateDiskOffering(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
def test_01_create_disk_offering(self):
"""Test to create disk offering
@ -89,8 +89,7 @@ class TestCreateDiskOffering(cloudstackTestCase):
)
return
@attr(hypervisor="kvm")
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"])
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"], hypervisors=["kvm"])
def test_02_create_sparse_type_disk_offering(self):
"""Test to create a sparse type disk offering"""
@ -130,8 +129,8 @@ class TestCreateDiskOffering(cloudstackTestCase):
return
@attr(hypervisor="kvm")
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"])
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"], hypervisors=["kvm"])
def test_04_create_fat_type_disk_offering(self):
"""Test to create a sparse type disk offering"""
@ -213,7 +212,7 @@ class TestDiskOfferings(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
def test_02_edit_disk_offering(self):
"""Test to update existing disk offering
@ -265,7 +264,7 @@ class TestDiskOfferings(cloudstackTestCase):
)
return
@attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
def test_03_delete_disk_offering(self):
"""Test to delete disk offering

View File

@ -22,7 +22,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
class TestUpdateConfigWithScope(cloudstackTestCase):
@ -32,7 +32,7 @@ class TestUpdateConfigWithScope(cloudstackTestCase):
def setUp(self):
self.apiClient = self.testClient.getApiClient()
@attr(tags=["devcloud", "basic", "advanced"], required_hardware="false")
@pytest.mark.tags(tags=["devcloud", "basic", "advanced"], required_hardware="false")
def test_UpdateConfigParamWithScope(self):
"""
test update configuration setting at zone level scope

View File

@ -18,7 +18,7 @@
"""
#Import Local Modules
import marvin
from nose.plugins.attrib import attr
import pytest
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
@ -78,7 +78,7 @@ class TestDedicateGuestVlanRange(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["advanced", "guestvlanrange", "dedicate", "release"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "guestvlanrange", "dedicate", "release"], required_hardware="false")
def test_dedicateGuestVlanRange(self):
"""Test guest vlan range dedication
"""

View File

@ -24,7 +24,7 @@ from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from marvin.lib.utils import (random_gen)
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -53,7 +53,7 @@ class TestHosts(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
#@attr(tags=["selfservice"])
@pytest.mark.skipif(True,reason="you can't just write test case like this")
def test_01_clusters(self):
"""Test Add clusters & hosts - simulator

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
class TestInternalLb(cloudstackTestCase):
"""Test Internal LB
@ -56,7 +56,7 @@ class TestInternalLb(cloudstackTestCase):
cls.account.id))
cls.cleanup = [cls.account]
@attr(tags=["smoke", "advanced"], required_hardware="true")
@pytest.mark.tags(tags=["smoke", "advanced"], required_hardware="true")
def test_internallb(self):
"""Test create, delete, assign, remove of internal loadbalancer
"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
import urllib
from random import random
#Import System modules
@ -75,7 +75,7 @@ class TestCreateIso(cloudstackTestCase):
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="false")
def test_01_create_iso(self):
"""Test create public & private ISO
"""
@ -229,7 +229,7 @@ class TestISO(cloudstackTestCase):
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
def test_02_edit_iso(self):
"""Test Edit ISO
"""
@ -294,7 +294,7 @@ class TestISO(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="false")
def test_03_delete_iso(self):
"""Test delete ISO
"""
@ -322,7 +322,7 @@ class TestISO(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns"], required_hardware="true")
def test_04_extract_Iso(self):
"Test for extract ISO"
@ -373,7 +373,7 @@ class TestISO(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
def test_05_iso_permissions(self):
"""Update & Test for ISO permissions"""
@ -425,7 +425,7 @@ class TestISO(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"])
@pytest.mark.tags(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"])
def test_06_copy_iso(self):
"""Test for copy ISO from one zone to another"""
@ -482,7 +482,7 @@ class TestISO(cloudstackTestCase):
# Cleanup- Delete the copied ISO
timeout = self.services["timeout"]
while True:
time.sleep(self.services["sleep"])
time.sleep(5)
list_iso_response = list_isos(
self.apiclient,
id=self.iso_2.id,

View File

@ -22,7 +22,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -143,7 +143,7 @@ class TestLoadBalance(cloudstackTestCase):
time.sleep(10)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_01_create_lb_rule_src_nat(self):
"""Test to create Load balancing rule with source NAT"""
@ -303,7 +303,7 @@ class TestLoadBalance(cloudstackTestCase):
self.try_ssh(src_nat_ip_addr.ipaddress, hostnames)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_02_create_lb_rule_non_nat(self):
"""Test to create Load balancing rule with non source NAT"""
@ -421,7 +421,7 @@ class TestLoadBalance(cloudstackTestCase):
self.try_ssh(self.non_src_nat_ip.ipaddress.ipaddress, hostnames)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_assign_and_removal_lb(self):
"""Test for assign & removing load balancing rule"""

View File

@ -37,7 +37,7 @@ from marvin.cloudstackAPI.removeIpFromNic import removeIpFromNicCmd
from marvin.cloudstackAPI.listNics import listNicsCmd
from nose.plugins.attrib import attr
import pytest
class TestDeployVM(cloudstackTestCase):
"""Test deploy a VM into a user account
@ -122,7 +122,7 @@ class TestDeployVM(cloudstackTestCase):
msg="VM is not in Running state"
)
@attr(tags = ['advanced', 'basic'], required_hardware="false")
@pytest.mark.tags(tags = ['advanced', 'basic'], required_hardware="false")
def test_nic_secondaryip_add_remove(self):
#TODO: SIMENH: add verification
list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)

View File

@ -26,7 +26,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -116,7 +116,7 @@ class TestPublicIP(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_public_ip_admin_account(self):
"""Test for Associate/Disassociate public IP address for admin account"""
@ -152,7 +152,8 @@ class TestPublicIP(cloudstackTestCase):
)
ip_address.delete(self.apiclient)
time.sleep(30)
time.sleep(self.services["sleep"])
# Validate the following:
# 1.listPublicIpAddresses should no more return the released address
@ -166,7 +167,7 @@ class TestPublicIP(cloudstackTestCase):
self.fail("list public ip response is not empty")
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_public_ip_user_account(self):
"""Test for Associate/Disassociate public IP address for user account"""
@ -279,7 +280,7 @@ class TestPortForwarding(cloudstackTestCase):
cleanup_resources(self.apiclient, self.cleanup)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_01_port_fwd_on_src_nat(self):
"""Test for port forwarding on source NAT"""
@ -406,7 +407,7 @@ class TestPortForwarding(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_02_port_fwd_on_non_src_nat(self):
"""Test for port forwarding on non source NAT"""
@ -567,7 +568,8 @@ class TestRebootRouter(cloudstackTestCase):
)
# Wait for VM to come up
time.sleep(120)
time.sleep(self.services["sleep"])
src_nat_ip_addrs = list_publicIP(
self.apiclient,
@ -617,7 +619,7 @@ class TestRebootRouter(cloudstackTestCase):
]
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_reboot_router(self):
"""Test for reboot router"""
@ -773,7 +775,7 @@ class TestReleaseIP(cloudstackTestCase):
def tearDown(self):
cleanup_resources(self.apiclient, self.cleanup)
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_releaseIP(self):
"""Test for release public IP address"""
@ -792,7 +794,8 @@ class TestReleaseIP(cloudstackTestCase):
isIpAddressDisassociated = True
break
retriesCount -= 1
time.sleep(60)
time.sleep(self.services["sleep"])
# End while
self.assertTrue(isIpAddressDisassociated, "Failed to disassociate IP address")
@ -898,7 +901,7 @@ class TestDeleteAccount(cloudstackTestCase):
self.cleanup = []
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_delete_account(self):
"""Test for delete account"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
class TestNetworkACL(cloudstackTestCase):
@ -54,7 +54,7 @@ class TestNetworkACL(cloudstackTestCase):
cls.account.id))
cls.cleanup = [cls.account]
@attr(tags=["advanced"], required_hardware="true")
@pytest.mark.tags(tags=["advanced"], required_hardware="true")
def test_network_acl(self):
#TODO: SIMENH: add actual verification Logic for rules.
"""Test network ACL lists and items in VPC"""

View File

@ -23,7 +23,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
import signal
import sys
@ -123,7 +123,7 @@ class TestNic(cloudstackTestCase):
except Exception as ex:
self.debug("Exception during NIC test SETUP!: " + str(ex))
@attr(tags = ["devcloud", "smoke", "advanced", "advancedns"], required_hardware="true")
@pytest.mark.tags(tags = ["devcloud", "smoke", "advanced", "advancedns"], required_hardware="true")
def test_01_nic(self):
#TODO: SIMENH: add validation
"""Test to add and update added nic to a virtual machine"""

View File

@ -19,7 +19,7 @@
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import PhysicalNetwork
from marvin.lib.common import setNonContiguousVlanIds, get_zone
from nose.plugins.attrib import attr
import pytest
class TestUpdatePhysicalNetwork(cloudstackTestCase):
@ -38,7 +38,7 @@ class TestUpdatePhysicalNetwork(cloudstackTestCase):
raise Exception("Failed to set non contiguous vlan ids to test. Free some ids from \
from existing physical networks at ends")
@attr(tags = ["advanced"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced"], required_hardware="false")
def test_extendPhysicalNetworkVlan(self):
"""
Test to update a physical network and extend its vlan

View File

@ -22,7 +22,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
class TestUpdateOverProvision(cloudstackTestCase):
@ -32,7 +32,7 @@ class TestUpdateOverProvision(cloudstackTestCase):
def setUp(self):
self.apiClient = self.testClient.getApiClient()
@attr(tags=["devcloud", "basic", "advanced"], required_hardware="false")
@pytest.mark.tags(tags=["devcloud", "basic", "advanced"], required_hardware="false")
def test_UpdateStorageOverProvisioningFactor(self):
"""
test update configuration setting at storage scope

View File

@ -21,7 +21,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
class TestPortablePublicIPRange(cloudstackTestCase):
@ -75,7 +75,7 @@ class TestPortablePublicIPRange(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["basic", "advanced", "portablepublicip"], required_hardware="false")
@pytest.mark.tags(tags = ["basic", "advanced", "portablepublicip"], required_hardware="false")
def test_createPortablePublicIPRange(self):
""" Test to create a portable public ip range
"""
@ -161,7 +161,7 @@ class TestPortablePublicIPAcquire(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "portablepublicip"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "portablepublicip"], required_hardware="false")
def test_createPortablePublicIPAcquire(self):
""" Test to acquire a provisioned public ip range
"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -52,7 +52,7 @@ class TestPrimaryStorageServices(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_01_primary_storage_nfs(self):
"""Test primary storage pools - XEN, KVM, VMWare. Not Supported for hyperv
"""
@ -149,7 +149,7 @@ class TestPrimaryStorageServices(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_01_primary_storage_iscsi(self):
"""Test primary storage pools - XEN. Not Supported for kvm,hyperv,vmware
"""

View File

@ -22,7 +22,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
class TestPrivateGwACL(cloudstackTestCase):
@ -39,7 +39,7 @@ class TestPrivateGwACL(cloudstackTestCase):
self.privateGwId = None
@attr(tags=["advanced"], required_hardware="false")
@pytest.mark.tags(tags=["advanced"], required_hardware="false")
def test_privategw_acl(self):
#TODO: SIMENH: add a new test to verification of ACL rules

View File

@ -18,7 +18,7 @@
"""
#Import Local Modules
import marvin
from nose.plugins.attrib import attr
import pytest
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
@ -72,7 +72,7 @@ class TestDedicatePublicIPRange(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
def test_dedicatePublicIpRange(self):
"""Test public IP range dedication
"""

View File

@ -24,7 +24,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
import telnetlib
#Import System modules
@ -41,7 +41,7 @@ class TestPVLAN(cloudstackTestCase):
def setUp(self):
self.apiClient = self.testClient.getApiClient()
@attr(tags = ["advanced"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced"], required_hardware="false")
def test_create_pvlan_network(self):
self.debug("Test create pvlan network")
createNetworkCmd = createNetwork.createNetworkCmd()

View File

@ -20,7 +20,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
class TestRegions(cloudstackTestCase):
"""Test Regions - basic region creation
@ -35,7 +35,7 @@ class TestRegions(cloudstackTestCase):
cls.domain = get_domain(cls.apiclient)
cls.cleanup = []
@attr(tags=["basic", "advanced"], required_hardware="false")
@pytest.mark.tags(tags=["basic", "advanced"], required_hardware="false")
def test_createRegion(self):
""" Test for create region
"""

View File

@ -24,7 +24,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
_multiprocess_shared_ = True
@ -95,8 +95,8 @@ class TestResetVmOnReboot(cloudstackTestCase):
cleanup_resources(self.apiclient, self.cleanup)
return
@attr(hypervisor="xenserver")
@attr(tags=["advanced", "basic"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "basic"], required_hardware="false", hypervisors=["xenserver"])
def test_01_reset_vm_on_reboot(self):
#TODO: SIMENH: add new test to check volume contents
"""Test reset virtual machine on reboot

View File

@ -18,13 +18,13 @@
"""
#Import Local Modules
import marvin
import pytest
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
#Import System modules
import time
@ -34,6 +34,7 @@ class TestResourceDetail(cloudstackTestCase):
@classmethod
def setUpClass(cls):
testClient = super(TestResourceDetail, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
@ -89,7 +90,7 @@ class TestResourceDetail(cloudstackTestCase):
cleanup_resources(self.apiclient, self.cleanup)
return
@attr(tags = ["advanced", "xenserver"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "xenserver"], required_hardware="false")
def test_01_updatevolumedetail(self):
"""Test volume detail
"""

View File

@ -25,7 +25,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -98,7 +98,7 @@ class TestRouterServices(cloudstackTestCase):
self.hypervisor = self.testClient.getHypervisorInfo()
return
@attr(tags = ["advanced", "basic", "sg", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "basic", "sg", "smoke"], required_hardware="true")
def test_01_router_internal_basic(self):
"""Test router internal basic zone
"""
@ -184,7 +184,7 @@ class TestRouterServices(cloudstackTestCase):
@attr(tags = ["advanced", "advancedns"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns"], required_hardware="false")
def test_02_router_internal_adv(self):
"""Test router internal advanced zone
"""
@ -290,7 +290,7 @@ class TestRouterServices(cloudstackTestCase):
self.debug("Haproxy process status: %s" % res)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_03_restart_network_cleanup(self):
"""Test restart network
"""
@ -368,7 +368,7 @@ class TestRouterServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_04_restart_network_wo_cleanup(self):
"""Test restart network without cleanup
"""
@ -483,7 +483,7 @@ class TestRouterServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_05_router_basic(self):
"""Test router basic setup
"""
@ -549,7 +549,7 @@ class TestRouterServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_06_router_advanced(self):
"""Test router advanced setup
"""
@ -632,7 +632,7 @@ class TestRouterServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_07_stop_router(self):
"""Test stop router
"""
@ -675,7 +675,7 @@ class TestRouterServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_08_start_router(self):
"""Test start router
"""
@ -727,7 +727,7 @@ class TestRouterServices(cloudstackTestCase):
return True
return False
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_09_reboot_router(self):
"""Test reboot router
"""

View File

@ -24,7 +24,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
_multiprocess_shared_ = True
@ -102,8 +102,7 @@ class TestScaleVm(cloudstackTestCase):
cleanup_resources(self.apiclient, self.cleanup)
return
@attr(hypervisor="xenserver")
@attr(tags=["advanced", "basic"], required_hardware="true")
@pytest.mark.tags(tags=["advanced", "basic"], required_hardware="true", hypervisors=["xenserver"])
def test_01_scale_vm(self):
"""Test scale virtual machine
"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
#Import System modules
import time
@ -81,7 +81,7 @@ class TestSecStorageServices(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
def test_01_sys_vm_start(self):
"""Test system VM start
"""
@ -160,7 +160,7 @@ class TestSecStorageServices(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
def test_02_sys_template_ready(self):
"""Test system templates are ready
"""

View File

@ -31,7 +31,7 @@ from marvin.lib.common import (list_service_offering,
get_domain,
get_zone,
get_template)
from nose.plugins.attrib import attr
import pytest
_multiprocess_shared_ = True
@ -54,7 +54,7 @@ class TestCreateServiceOffering(cloudstackTestCase):
return
@attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
def test_01_create_service_offering(self):
"""Test to create service offering"""
@ -205,7 +205,7 @@ class TestServiceOfferings(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
def test_02_edit_service_offering(self):
"""Test to update existing service offering"""
@ -256,7 +256,7 @@ class TestServiceOfferings(cloudstackTestCase):
return
@attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false")
def test_03_delete_service_offering(self):
"""Test to delete service offering"""
@ -282,7 +282,7 @@ class TestServiceOfferings(cloudstackTestCase):
return
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
def test_04_change_offering_small(self):
"""Test to change service to a small capacity
"""

View File

@ -16,7 +16,7 @@
# under the License.
from marvin.codes import FAILED
from nose.plugins.attrib import attr
import pytest
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
@ -102,7 +102,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="true")
def test_01_snapshot_root_disk(self):
"""Test Snapshot Root Disk
"""

View File

@ -24,7 +24,7 @@ from marvin.sshClient import SshClient
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
import telnetlib
#Import System modules
@ -69,7 +69,7 @@ class TestSSVMs(cloudstackTestCase):
timeout = timeout - 1
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_01_list_sec_storage_vm(self):
"""Test List secondary storage VMs
"""
@ -187,7 +187,7 @@ class TestSSVMs(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_02_list_cpvm_vm(self):
"""Test List console proxy VMs
"""
@ -299,7 +299,7 @@ class TestSSVMs(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_03_ssvm_internals(self):
"""Test SSVM Internals"""
@ -412,7 +412,7 @@ class TestSSVMs(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_04_cpvm_internals(self):
"""Test CPVM Internals"""
@ -495,7 +495,7 @@ class TestSSVMs(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_05_stop_ssvm(self):
"""Test stop SSVM
"""
@ -571,7 +571,7 @@ class TestSSVMs(cloudstackTestCase):
self.test_03_ssvm_internals()
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_06_stop_cpvm(self):
"""Test stop CPVM
"""
@ -645,7 +645,7 @@ class TestSSVMs(cloudstackTestCase):
self.test_04_cpvm_internals()
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_07_reboot_ssvm(self):
"""Test reboot SSVM
"""
@ -732,7 +732,7 @@ class TestSSVMs(cloudstackTestCase):
self.test_03_ssvm_internals()
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_08_reboot_cpvm(self):
"""Test reboot CPVM
"""
@ -819,7 +819,7 @@ class TestSSVMs(cloudstackTestCase):
self.test_04_cpvm_internals()
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_09_destroy_ssvm(self):
"""Test destroy SSVM
"""
@ -901,7 +901,7 @@ class TestSSVMs(cloudstackTestCase):
self.test_03_ssvm_internals()
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_10_destroy_cpvm(self):
"""Test destroy CPVM
"""

View File

@ -35,7 +35,7 @@ from marvin.lib.base import (Account,
from marvin.lib.common import (get_domain,
get_zone,
get_template)
from nose.plugins.attrib import attr
import pytest
import urllib
#Import System modules
import time
@ -144,7 +144,7 @@ class TestCreateTemplate(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_01_create_template(self):
"""Test create public & private template
"""
@ -338,7 +338,7 @@ class TestTemplates(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_02_edit_template(self):
"""Test Edit template
"""
@ -421,7 +421,7 @@ class TestTemplates(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_03_delete_template(self):
"""Test delete template
"""
@ -450,7 +450,7 @@ class TestTemplates(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_04_extract_template(self):
"Test for extract template"
@ -501,7 +501,7 @@ class TestTemplates(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_05_template_permissions(self):
"""Update & Test for template permissions"""
@ -554,7 +554,7 @@ class TestTemplates(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multizone"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multizone"], required_hardware="true")
def test_06_copy_template(self):
"""Test for copy template from one zone to another"""
@ -645,7 +645,7 @@ class TestTemplates(cloudstackTestCase):
self.apiclient.deleteTemplate(cmd)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_07_list_public_templates(self):
"""Test only public templates are visible to normal user"""
@ -677,7 +677,7 @@ class TestTemplates(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_08_list_system_templates(self):
"""Test System templates are not visible to normal user"""

View File

@ -36,9 +36,9 @@ from marvin.lib.common import (get_domain,
get_zone,
get_template)
from marvin.codes import FAILED, PASS
from nose.plugins.attrib import attr
#Import System modules
import time
import pytest
_multiprocess_shared_ = True
class TestDeployVM(cloudstackTestCase):
@ -116,7 +116,7 @@ class TestDeployVM(cloudstackTestCase):
self.cleanup = []
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@pytest.mark.tags(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_deploy_vm(self):
"""Test Deploy Virtual Machine
"""
@ -162,7 +162,7 @@ class TestDeployVM(cloudstackTestCase):
return
@attr(tags = ["advanced"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced"], required_hardware="false")
def test_advZoneVirtualRouter(self):
#TODO: SIMENH: duplicate test, remove it
"""
@ -185,7 +185,7 @@ class TestDeployVM(cloudstackTestCase):
self.assertIsNotNone(router.guestipaddress, msg="Router has no guest ip")
@attr(mode = ["basic"], required_hardware="false")
@pytest.mark.tags(tags = ["basic"], required_hardware="false")
def test_basicZoneVirtualRouter(self):
#TODO: SIMENH: duplicate test, remove it
"""
@ -201,7 +201,7 @@ class TestDeployVM(cloudstackTestCase):
self.assertEqual(router.state, 'Running', msg="Router is not in running state")
self.assertEqual(router.account, self.account.name, msg="Router does not belong to the account")
@attr(tags = ['advanced','basic','sg'], required_hardware="false")
@pytest.mark.tags(tags = ['advanced','basic','sg'], required_hardware="false")
def test_deploy_vm_multiple(self):
"""Test Multiple Deploy Virtual Machine
@ -359,9 +359,17 @@ class TestVMLifeCycle(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@pytest.mark.tags(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false", BugId="CLOUDSTACK-6984")
def test_vm_life_cycle(self):
self.stop_vm()
self.start_vm()
self.reboot_vm()
self.destroy_vm()
self.restore_vm()
self.migrate_vm()
self.attachAndDetach_iso()
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false", BugId="CLOUDSTACK-6984")
def test_01_stop_vm(self):
def stop_vm(self):
"""Test Stop Virtual Machine
"""
@ -375,8 +383,7 @@ class TestVMLifeCycle(cloudstackTestCase):
self.fail("Failed to stop VM: %s" % e)
return
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_02_start_vm(self):
def start_vm(self):
"""Test Start Virtual Machine
"""
# Validate the following
@ -413,8 +420,7 @@ class TestVMLifeCycle(cloudstackTestCase):
)
return
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_03_reboot_vm(self):
def reboot_vm(self):
"""Test Reboot Virtual Machine
"""
@ -450,8 +456,7 @@ class TestVMLifeCycle(cloudstackTestCase):
return
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_06_destroy_vm(self):
def destroy_vm(self):
"""Test destroy Virtual Machine
"""
@ -486,8 +491,7 @@ class TestVMLifeCycle(cloudstackTestCase):
)
return
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_07_restore_vm(self):
def restore_vm(self):
#TODO: SIMENH: add another test the data on the restored VM.
"""Test recover Virtual Machine
"""
@ -527,8 +531,7 @@ class TestVMLifeCycle(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multihost"], required_hardware="false")
def test_08_migrate_vm(self):
def migrate_vm(self):
"""Test migrate VM
"""
# Validate the following
@ -602,9 +605,10 @@ class TestVMLifeCycle(cloudstackTestCase):
retries_cnt = retries_cnt - 1
return
@attr(configuration = "expunge.interval")
@attr(configuration = "expunge.delay")
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
'''
@pytest.mark.tags(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
'''
@pytest.mark.skipif(True, reason="expunge takes long time")
def test_09_expunge_vm(self):
"""Test destroy(expunge) Virtual Machine
"""
@ -649,8 +653,7 @@ class TestVMLifeCycle(cloudstackTestCase):
self.assertEqual(list_vm_response,None,"Check Expunged virtual machine is in listVirtualMachines response")
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true")
def test_10_attachAndDetach_iso(self):
def attachAndDetach_iso(self):
"""Test for attach and detach ISO to virtual machine"""
# Validate the following

View File

@ -17,7 +17,7 @@
# Import Local Modules
from marvin.codes import FAILED, KVM
from nose.plugins.attrib import attr
import pytest
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackAPI import startVirtualMachine
from marvin.lib.utils import random_gen, cleanup_resources
@ -112,7 +112,7 @@ class TestVmSnapshot(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
def test_01_create_vm_snapshots(self):
"""Test to create VM snapshots
"""
@ -156,7 +156,7 @@ class TestVmSnapshot(cloudstackTestCase):
)
return
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
def test_02_revert_vm_snapshots(self):
"""Test to revert VM snapshots
"""
@ -243,7 +243,7 @@ class TestVmSnapshot(cloudstackTestCase):
"Check the random data is equal with the ramdom file!"
)
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
@pytest.mark.tags(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
def test_03_delete_vm_snapshots(self):
"""Test to delete vm snapshots
"""

View File

@ -37,7 +37,7 @@ from marvin.lib.common import (get_domain,
get_template)
from marvin.lib.utils import checkVolumeSize
from marvin.codes import SUCCESS, FAILED, XEN_SERVER
from nose.plugins.attrib import attr
import pytest
#Import System modules
import os
import urllib
@ -114,7 +114,7 @@ class TestCreateVolume(cloudstackTestCase):
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
def test_01_create_volume(self):
"""Test Volume creation for all Disk Offerings (incl. custom)
"""
@ -344,7 +344,7 @@ class TestVolumes(cloudstackTestCase):
cleanup_resources(self.apiClient, self.cleanup)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
def test_02_attach_volume(self):
"""Attach a created Volume to a Running VM
"""
@ -390,7 +390,7 @@ class TestVolumes(cloudstackTestCase):
(self.virtual_machine.ipaddress, e))
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
def test_03_download_attached_volume(self):
"""Download a Volume attached to a VM
"""
@ -412,7 +412,7 @@ class TestVolumes(cloudstackTestCase):
with self.assertRaises(Exception):
self.apiClient.extractVolume(cmd)
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
def test_04_delete_attached_volume(self):
"""Delete a Volume attached to a VM
"""
@ -433,7 +433,7 @@ class TestVolumes(cloudstackTestCase):
with self.assertRaises(Exception):
self.apiClient.deleteVolume(cmd)
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false")
def test_05_detach_volume(self):
"""Detach a Volume attached to a VM
"""
@ -475,7 +475,7 @@ class TestVolumes(cloudstackTestCase):
)
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
def test_06_download_detached_volume(self):
"""Download a Volume unattached to an VM
"""
@ -512,7 +512,7 @@ class TestVolumes(cloudstackTestCase):
% (extract_vol.url, self.volume.id)
)
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
def test_07_resize_fail(self):
"""Test resize (negative) non-existent volume"""
# Verify the size is the new size is what we wanted it to be.
@ -600,7 +600,7 @@ class TestVolumes(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
def test_08_resize_volume(self):
"""Test resize a volume"""
# Verify the size is the new size is what we wanted it to be.
@ -718,7 +718,7 @@ class TestVolumes(cloudstackTestCase):
time.sleep(30)
return
@attr(tags = ["advanced", "advancedns", "smoke","basic"], required_hardware="false")
@pytest.mark.tags(tags = ["advanced", "advancedns", "smoke","basic"], required_hardware="false")
def test_09_delete_detached_volume(self):
"""Delete a Volume unattached to an VM
"""

View File

@ -23,7 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import pytest
import time
@ -53,7 +53,7 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase):
cls.cleanup = [cls.account]
@attr(tags=["advanced"], required_hardware="false")
@pytest.mark.tags(tags=["advanced"], required_hardware="false")
def test_vpc_remote_access_vpn(self):
"""Test VPN in VPC"""
@ -160,7 +160,7 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
cls.cleanup = [cls.account]
@attr(tags=["advanced"], required_hardware="false")
@pytest.mark.tags(tags=["advanced"], required_hardware="false")
def test_vpc_site2site_vpn(self):
"""Test VPN in VPC"""

View File

@ -788,7 +788,7 @@ test_data = {
"dpd": "false"
},
"ostype": "CentOS 5.6 (64-bit)",
"sleep": 90,
"sleep": 5,
"timeout": 10,
"page": 1,
"pagesize": 2,

View File

@ -15,24 +15,56 @@
# specific language governing permissions and limitations
# under the License.
import pytest
import os
import distutils
from marvin.utils import initTestClass,getMarvin
from .VM import (vm,tiny_service_offering,template,test_client,account,domain,zone)
def pytest_configure(config):
config.addinivalue_line("markers",
"attr(name): tag tests")
"tags(name): tag tests")
result = getMarvin()
if result is None:
pytest.fail("failed to init marvin plugin")
marvin_init_tags()
g_marvin_filter = {
"tags":[],
}
def tobool(str):
if str in ["True", "true"]:
return True
else:
return False
def marvin_init_tags():
tags = os.environ.get("MARVIN_TAGS", "advanced,required_hardware=false").split(",")
global g_marvin_filter
for t in tags:
if t.startswith("required_hardware"):
g_marvin_filter["required_hardware"] = t.split("=")[1]
else:
g_marvin_filter["tags"].append(t)
def pytest_runtest_setup(item):
attrmarker = item.get_marker("attr")
if attrmarker.kwargs["required_hardware"]:
pytest.skip("doesnt have hardware")
global g_marvin_filter
attrmarker = item.get_marker("tags")
if attrmarker is None:
return
if "required_hardware" in attrmarker.kwargs:
if attrmarker.kwargs["required_hardware"] != g_marvin_filter["required_hardware"]:
pytest.skip("doesnt match hardware")
elif "tags" in attrmarker.kwargs:
found = False
for t in attrmarker.kwargs["tags"]:
if t in g_marvin_filter["tags"]:
found = True
if found is not True:
pytest.skip("doesn't match tags")
@pytest.fixture(scope="class", autouse=True)
def marvin_inject_testclass(request):