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 Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Compute+Offering+FS
""" """
from marvin.cloudstackTestCase import cloudstackTestCase from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import (cleanup_resources, from marvin.lib.utils import *
validateList) from marvin.lib.base import *
from marvin.integration.lib.base import (ServiceOffering, from marvin.lib.common import *
VirtualMachine,
Account)
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
verifyComputeOfferingCreation)
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT
from ddt import ddt, data 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 Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+-+IP+Range+Reservation+within+a+Network
""" """
from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.integration.lib.utils import (cleanup_resources,
validateList,
from marvin.cloudstackException import CloudstackAPIException from marvin.cloudstackException import CloudstackAPIException
from marvin.lib.utils import * from marvin.lib.utils import *
from marvin.lib.base 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 Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Multiple+IP+address+per+NIC
""" """
from marvin.cloudstackTestCase import cloudstackTestCase from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import (cleanup_resources, from marvin.lib.utils import *
validateList, from marvin.lib.base import *
random_gen) from marvin.lib.common import *
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 nose.plugins.attrib import attr from nose.plugins.attrib import attr
from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL

View File

@ -47,7 +47,7 @@ class Services():
def __init__(self): def __init__(self):
self.services = { self.services = {
"vlan": { "vlan_nc": {
"partial_range": ["",""], "partial_range": ["",""],
"full_range": "", "full_range": "",
}, },
@ -125,7 +125,7 @@ class TestNonContiguousVLANRanges(cloudstackTestCase):
def setUp(self): def setUp(self):
self.apiclient = self.testClient.getApiClient() self.apiclient = self.testClient.getApiClient()
self.vlan = self.services["vlan"] self.vlan = self.services["vlan_new"]
self.apiClient = self.testClient.getApiClient() self.apiClient = self.testClient.getApiClient()
self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiclient, self.zone.id) 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 # KIND, either express or implied. See the License for the
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # 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.cloudstackException import CloudstackAPIException
from marvin.lib.utils import * from marvin.lib.utils import *
from marvin.lib.base import * from marvin.lib.base import *
from marvin.lib.common import * from marvin.lib.common import *
import netaddr import netaddr
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from marvin.codes import PASS, FAIL from marvin.codes import PASS, FAIL
from marvin.sshClient import SshClient from marvin.sshClient import SshClient
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from ddt import ddt, data from ddt import ddt, data
import time import time
@ddt @ddt
class TestPersistentNetworks(cloudstackTestCase): class TestPersistentNetworks(cloudstackTestCase):
"""Test Persistent Networks without running VMs '''
""" Test Persistent Networks without running VMs
'''
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
cls.testClient = super(TestPersistentNetworks, cls).getClsTestClient() cls.testClient = super(TestPersistentNetworks, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient() cls.api_client = cls.testClient.getApiClient()
# Fill services from the external config file # Fill services from the external config file
cls.services = cloudstackTestClient.getConfigParser().parsedDict cls.services = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates # Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client) 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 Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/portable+public+IP
""" """
from marvin.cloudstackTestCase import cloudstackTestCase from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.integration.lib.utils import cleanup_resources
from marvin.cloudstackException import CloudstackAPIException from marvin.cloudstackException import CloudstackAPIException
from marvin.lib.utils import * from marvin.lib.utils import *
from marvin.lib.base import * from marvin.lib.base import *

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase
#Import Integration Libraries #Import Integration Libraries
#base - contains all resources as entities and defines create, delete, list operations on them #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 #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 #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 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 from nose.plugins.attrib import attr
#data reqd for virtual machine creation
"virtual_machine2" : {
"name" : "testvm2",
"displayname" : "Test VM2",
},
class TestDeployVM(cloudstackTestCase): class TestDeployVM(cloudstackTestCase):
"""Test deploy a VM into a user account """Test deploy a VM into a user account
""" """

View File

@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase
#Import Integration Libraries #Import Integration Libraries
#base - contains all resources as entities and defines create, delete, list operations on them #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 #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 #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 from nose.plugins.attrib import attr
@ -71,6 +71,7 @@ class TestDeployVM(cloudstackTestCase):
def setUp(self): def setUp(self):
self.testdata = TestData().testdata self.testdata = TestData().testdata
self.apiclient = self.testClient.getApiClient() self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
# Get Zone, Domain and Default Built-in template # Get Zone, Domain and Default Built-in template
self.domain = get_domain(self.apiclient, self.testdata) self.domain = get_domain(self.apiclient, self.testdata)
@ -107,7 +108,7 @@ class TestDeployVM(cloudstackTestCase):
# 2. root disk has new size per listVolumes # 2. root disk has new size per listVolumes
# 3. Rejects non-supported hypervisor types # 3. Rejects non-supported hypervisor types
""" """
if(self.apiclient.hypervisor == 'kvm'): if(self.hypervisor == 'kvm'):
newrootsize = (self.template.size >> 30) + 2 newrootsize = (self.template.size >> 30) + 2
self.virtual_machine = VirtualMachine.create( self.virtual_machine = VirtualMachine.create(
self.apiclient, self.apiclient,
@ -174,7 +175,7 @@ class TestDeployVM(cloudstackTestCase):
"Check if the root volume resized appropriately" "Check if the root volume resized appropriately"
) )
else: 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 newrootsize = (self.template.size >> 30) + 2
success = False success = False
@ -195,13 +196,13 @@ class TestDeployVM(cloudstackTestCase):
else: else:
self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex)); 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']) @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
def test_01_deploy_vm_root_resize(self): def test_01_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize of 0 """Test proper failure to deploy virtual machine with rootdisksize of 0
""" """
if (self.apiclient.hypervisor == 'kvm'): if (self.hypervisor == 'kvm'):
newrootsize = 0 newrootsize = 0
success = False success = False
try: try:
@ -223,13 +224,13 @@ class TestDeployVM(cloudstackTestCase):
self.assertEqual(success, True, "Check if passing 0 as rootdisksize fails appropriately") self.assertEqual(success, True, "Check if passing 0 as rootdisksize fails appropriately")
else: 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']) @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
def test_02_deploy_vm_root_resize(self): def test_02_deploy_vm_root_resize(self):
"""Test proper failure to deploy virtual machine with rootdisksize less than template size """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 newrootsize = (self.template.size >> 30) - 1
self.assertEqual(newrootsize > 0, True, "Provided template is less than 1G in size, cannot run test") 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") self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately")
else: 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): def tearDown(self):
try: try:

View File

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

View File

@ -76,12 +76,8 @@ class TestPVLAN(cloudstackTestCase):
createNetworkCmd.ip6cidr="fc00:1234::/64" createNetworkCmd.ip6cidr="fc00:1234::/64"
createNetworkCmd.startipv6="fc00:1234::10" createNetworkCmd.startipv6="fc00:1234::10"
createNetworkCmd.endipv6="fc00:1234::20" createNetworkCmd.endipv6="fc00:1234::20"
err = 0; err = 0
try: createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd) #FIXME: add assert for proper response
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");

View File

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

View File

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

View File

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

View File

@ -278,7 +278,16 @@ class MarvinPlugin(Plugin):
src = self.__logFolderPath src = self.__logFolderPath
log_cfg = self.__parsedConfig.logger log_cfg = self.__parsedConfig.logger
tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs" 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 cmd = "mv " + src + " " + dst
os.system(cmd) os.system(cmd)
print "===Final Results: %s===" % str(dst) print "===Final Results: %s===" % str(dst)