CLOUDSTACK-6316: Fixed component and smoke test failures-second pass

This commit is contained in:
SrikanteswaraRao Talluri 2014-04-09 19:53:50 +05:30
parent d0b6e01da0
commit b83407fca3
21 changed files with 72 additions and 99 deletions

View File

@ -24,16 +24,9 @@
Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Compute+Offering+FS
"""
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import (cleanup_resources,
validateList)
from marvin.integration.lib.base import (ServiceOffering,
VirtualMachine,
Account)
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
verifyComputeOfferingCreation)
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT
from ddt import ddt, data

View File

@ -23,8 +23,6 @@
Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+-+IP+Range+Reservation+within+a+Network
"""
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.integration.lib.utils import (cleanup_resources,
validateList,
from marvin.cloudstackException import CloudstackAPIException
from marvin.lib.utils import *
from marvin.lib.base import *

View File

@ -23,30 +23,9 @@
Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Multiple+IP+address+per+NIC
"""
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import (cleanup_resources,
validateList,
random_gen)
from marvin.integration.lib.base import (Account,
ServiceOffering,
Network,
VirtualMachine,
VpcOffering,
VPC,
NIC,
Domain,
PublicIPAddress,
StaticNATRule,
FireWallRule,
NATRule,
Router)
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
get_free_vlan,
setSharedNetworkParams,
createEnabledNetworkOffering,
shouldTestBeSkipped,
wait_for_cleanup)
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL

View File

@ -47,7 +47,7 @@ class Services():
def __init__(self):
self.services = {
"vlan": {
"vlan_nc": {
"partial_range": ["",""],
"full_range": "",
},
@ -125,7 +125,7 @@ class TestNonContiguousVLANRanges(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.vlan = self.services["vlan"]
self.vlan = self.services["vlan_new"]
self.apiClient = self.testClient.getApiClient()
self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiclient, self.zone.id)

View File

@ -14,31 +14,31 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
""" Tests for Persistent Networks without running VMs feature
""" Tests for Persistent Networks without running VMs feature"""
from marvin.cloudstackException import CloudstackAPIException
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
import netaddr
from nose.plugins.attrib import attr
from marvin.codes import PASS, FAIL
from marvin.sshClient import SshClient
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from ddt import ddt, data
import time
@ddt
class TestPersistentNetworks(cloudstackTestCase):
"""Test Persistent Networks without running VMs
"""
'''
Test Persistent Networks without running VMs
'''
@classmethod
def setUpClass(cls):
cls.testClient = super(TestPersistentNetworks, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
# Fill services from the external config file
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.services = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)

View File

@ -21,7 +21,6 @@
Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/portable+public+IP
"""
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import cleanup_resources
from marvin.cloudstackException import CloudstackAPIException
from marvin.lib.utils import *
from marvin.lib.base import *

View File

@ -23,9 +23,9 @@ import marvin
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from marvin.sshClient import SshClient
import datetime

View File

@ -1264,8 +1264,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
"Check end port of firewall rule"
)
# For DNS and DHCP check 'dnsmasq' process status
if (self.apiclient.hypervisor.lower() == 'vmware'
or self.apiclient.hypervisor.lower() == 'hyperv'):
if (self.hypervisor.lower() == 'vmware'
or self.hypervisor.lower() == 'hyperv'):
result = get_process_status(
self.apiclient.connection.mgtSvr,
22,

View File

@ -231,6 +231,7 @@ class TestSnapshots(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
return
@ -960,6 +961,7 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
return
@ -1115,6 +1117,7 @@ class TestSnapshotEvents(cloudstackTestCase):
cls.testClient = super(TestSnapshotEvents, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.services = Services().services
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
@ -1169,6 +1172,7 @@ class TestSnapshotEvents(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
return

View File

@ -2222,7 +2222,7 @@ class TestVPC(cloudstackTestCase):
self.cleanup.append(domain_admin)
da_apiclient = self.testClient.getUserApiClient(
UserName=domain_admin.name,
DomaimName=self.services["domain"]["name"],
DomainName=self.services["domain"]["name"],
type=2)
user = Account.create(

View File

@ -23,9 +23,9 @@ import marvin
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from marvin.sshClient import SshClient
import datetime

View File

@ -20,9 +20,9 @@
import marvin
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
import time
@ -148,6 +148,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.hypervisor = self.testClient.getHypervisorInfo()
self.cleanup = []
def tearDown(self):
@ -202,7 +203,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
alertSubject = "Monitoring Service on VR " + router.name
if self.apiclient.hypervisor.lower() == 'vmware':
if self.hypervisor.lower() == 'vmware':
result = get_process_status(
self.apiclient.connection.mgtSvr,
22,
@ -210,7 +211,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase):
self.apiclient.connection.passwd,
router.linklocalip,
"service dnsmasq status",
hypervisor=self.apiclient.hypervisor
hypervisor=self.hypervisor
)
else:
try:

View File

@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase
#Import Integration Libraries
#base - contains all resources as entities and defines create, delete, list operations on them
from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering
from marvin.lib.base import Account, VirtualMachine, ServiceOffering
#utils - utility classes for common cleanup, external library wrappers etc
from marvin.integration.lib.utils import cleanup_resources
from marvin.lib.utils import cleanup_resources
#common - commonly used methods for all tests are listed here
from marvin.integration.lib.common import get_zone, get_domain, get_template
from marvin.lib.common import get_zone, get_domain, get_template
from nose.plugins.attrib import attr

View File

@ -34,11 +34,6 @@ from marvin.lib.common import get_zone, get_domain, get_template
from nose.plugins.attrib import attr
#data reqd for virtual machine creation
"virtual_machine2" : {
"name" : "testvm2",
"displayname" : "Test VM2",
},
class TestDeployVM(cloudstackTestCase):
"""Test deploy a VM into a user account
"""

View File

@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase
#Import Integration Libraries
#base - contains all resources as entities and defines create, delete, list operations on them
from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering
from marvin.lib.base import Account, VirtualMachine, ServiceOffering
#utils - utility classes for common cleanup, external library wrappers etc
from marvin.integration.lib.utils import cleanup_resources
from marvin.lib.utils import cleanup_resources
#common - commonly used methods for all tests are listed here
from marvin.integration.lib.common import get_zone, get_domain, get_template, list_volumes
from marvin.lib.common import get_zone, get_domain, get_template, list_volumes
from nose.plugins.attrib import attr
@ -71,6 +71,7 @@ class TestDeployVM(cloudstackTestCase):
def setUp(self):
self.testdata = TestData().testdata
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
# Get Zone, Domain and Default Built-in template
self.domain = get_domain(self.apiclient, self.testdata)
@ -107,7 +108,7 @@ class TestDeployVM(cloudstackTestCase):
# 2. root disk has new size per listVolumes
# 3. Rejects non-supported hypervisor types
"""
if(self.apiclient.hypervisor == 'kvm'):
if(self.hypervisor == 'kvm'):
newrootsize = (self.template.size >> 30) + 2
self.virtual_machine = VirtualMachine.create(
self.apiclient,
@ -174,7 +175,7 @@ class TestDeployVM(cloudstackTestCase):
"Check if the root volume resized appropriately"
)
else:
self.debug("hypervisor %s unsupported for test 00, verifying it errors properly" % self.apiclient.hypervisor)
self.debug("hypervisor %s unsupported for test 00, verifying it errors properly" % self.hypervisor)
newrootsize = (self.template.size >> 30) + 2
success = False
@ -195,13 +196,13 @@ class TestDeployVM(cloudstackTestCase):
else:
self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex));
self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.apiclient.hypervisor)
self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.hypervisor)
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
def test_01_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize of 0
"""
if (self.apiclient.hypervisor == 'kvm'):
if (self.hypervisor == 'kvm'):
newrootsize = 0
success = False
try:
@ -223,13 +224,13 @@ class TestDeployVM(cloudstackTestCase):
self.assertEqual(success, True, "Check if passing 0 as rootdisksize fails appropriately")
else:
self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor);
self.debug("test 01 does not support hypervisor type " + self.hypervisor);
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
def test_02_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize less than template size
"""
if (self.apiclient.hypervisor == 'kvm'):
if (self.hypervisor == 'kvm'):
newrootsize = (self.template.size >> 30) - 1
self.assertEqual(newrootsize > 0, True, "Provided template is less than 1G in size, cannot run test")
@ -254,7 +255,7 @@ class TestDeployVM(cloudstackTestCase):
self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately")
else:
self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor);
self.debug("test 01 does not support hypervisor type " + self.hypervisor);
def tearDown(self):
try:

View File

@ -19,9 +19,9 @@
#Import Local Modules
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
#Import System modules

View File

@ -76,12 +76,8 @@ class TestPVLAN(cloudstackTestCase):
createNetworkCmd.ip6cidr="fc00:1234::/64"
createNetworkCmd.startipv6="fc00:1234::10"
createNetworkCmd.endipv6="fc00:1234::20"
err = 0;
try:
createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
except Exception as e:
err = 1;
self.debug("Try alloc with ipv6, got:%s" % e)
self.assertEqual(err, 1, "Shouldn't allow create PVLAN network with IPv6");
err = 0
createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
#FIXME: add assert for proper response

View File

@ -261,14 +261,14 @@ class TestTemplates(cloudstackTestCase):
cls.services["template"]["ostypeid"] = template.ostypeid
cls.services["template_2"]["ostypeid"] = template.ostypeid
cls.services["ostypeid"] = template.ostypeid
print "Before:",cls.services
cls.account = Account.create(
cls.apiclient,
cls.services["account"],
admin=True,
domainid=cls.domain.id
)
print "After:",cls.services
cls.user = Account.create(
cls.apiclient,
cls.services["account"],
@ -382,7 +382,7 @@ class TestTemplates(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"])
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice", "test"])
def test_02_edit_template(self):
"""Test Edit template
"""

View File

@ -20,9 +20,9 @@
import marvin
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
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

View File

@ -378,12 +378,10 @@ test_data = {
},
"securitygroupenabled": "true"
},
"vlan": {
"part": ["4090-4091", "4092-4095"],
"full": "4090-4095",
},
"vlan_range": "4090-4091",
"vlan":"4444",
"nfs": {
"url": "nfs://10.147.28.7/export/home/talluri/testprimary",
"url": "nfs://nfs/export/automation/1/testprimary",
"name": "Primary XEN"
},
"iscsi": {

View File

@ -278,7 +278,16 @@ class MarvinPlugin(Plugin):
src = self.__logFolderPath
log_cfg = self.__parsedConfig.logger
tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs"
dst = tmp + "/" + self.__testName + "_" + random_gen()
mod_name = "test_suite"
if self.__testModName:
mod_name = self.__testModName.split(".")
if len(mod_name) > 2:
mod_name = mod_name[-2]
if mod_name:
dst = tmp + "/" + mod_name + "_" + random_gen()
else:
dst = tmp + "//" + random_gen()
cmd = "mv " + src + " " + dst
os.system(cmd)
print "===Final Results: %s===" % str(dst)