diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index c8a7a234bc4..19f6914229f 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -19,7 +19,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 5da10b70b75..4155a41aa13 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -21,7 +21,7 @@ from integration.lib.common import * #Import Local Modules from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient class Services: """Test Services diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 751a595bd77..aa301dad3cb 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -18,7 +18,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * diff --git a/test/integration/component/test_high_availability.py b/test/integration/component/test_high_availability.py index 9d1ac019f4f..10281615cc3 100644 --- a/test/integration/component/test_high_availability.py +++ b/test/integration/component/test_high_availability.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -168,7 +168,7 @@ class TestHighAvailability(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return - @unittest.skip("skipped") + def test_01_host_maintenance_mode(self): """Test host maintenance mode """ diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 24e388c899e..50f17577871 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -1576,7 +1576,7 @@ class TestNetworkUpgrade(cloudstackTestCase): vpns = Vpn.list( self.apiclient, publicipid=src_nat.id, - listall=True, + listall=True, ) self.assertEqual( diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index d397d9d2a48..20e2f8af1ed 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 5ecaa83accd..bbf6205c3a2 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime class Services: diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index e2167326db6..fd195436905 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 7671e80f814..2b0ca7309e6 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -17,10 +17,10 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from marvin.remoteSSHClient import remoteSSHClient #Import System modules import time @@ -77,6 +77,7 @@ class Services: # Algorithm used for load balancing "privateport": 22, "publicport": 2222, + "protocol": 'TCP', }, "fw_rule":{ "startport": 1, diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 7e49d20446a..68074536f9e 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -18,10 +18,10 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from marvin.remoteSSHClient import remoteSSHClient #Import System modules import time diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 8ab7ff7281e..05585b5ae68 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient class Services: """Test Snapshots Services diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index ff41baecd77..1e37abda194 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient import datetime class Services: diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index a20770b2851..4caee7d170f 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient #Import System modules import os import urllib diff --git a/test/integration/lib/base.py b/test/integration/lib/base.py index 1f8a2f851c0..04adbc9a030 100644 --- a/test/integration/lib/base.py +++ b/test/integration/lib/base.py @@ -598,7 +598,9 @@ class Template: time.sleep(interval) elif 'Installing' not in template.status: - raise Exception("ErrorInDownload") + raise Exception( + "Error in downloading template: status - %s" % + template.status) elif timeout == 0: break @@ -690,10 +692,12 @@ class Iso: return elif 'Downloaded' not in response.status and \ 'Installing' not in response.status: - raise Exception("ErrorInDownload") + raise Exception( + "Error In Downloading ISO: ISO Status - %s" % + response.status) elif timeout == 0: - raise Exception("TimeoutException") + raise Exception("ISO download Timeout Exception") else: timeout = timeout - 1 return @@ -725,12 +729,12 @@ class PublicIPAddress: if zoneid: cmd.zoneid = zoneid elif "zoneid" in services: - services["zoneid"] + cmd.zoneid = services["zoneid"] if domainid: cmd.domainid = domainid elif "domainid" in services: - services["domainid"] + cmd.domainid = services["domainid"] if networkid: cmd.networkid = networkid @@ -1140,7 +1144,7 @@ class LoadBalancerRule: apiclient.removeFromLoadBalancerRule(cmd) return - def update(self, apiclient, algorithm=None, description=None, name=None): + def update(self, apiclient, algorithm=None, description=None, name=None, **kwargs): """Updates the load balancing rule""" cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd() cmd.id = self.id @@ -1151,8 +1155,40 @@ class LoadBalancerRule: if name: cmd.name = name + [setattr(cmd, k, v) for k, v in kwargs.items()] return apiclient.updateLoadBalancerRule(cmd) + def createSticky(self, apiclient, methodname, name, description=None, param=None): + """Creates a sticky policy for the LB rule""" + + cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd() + cmd.lbruleid = self.id + cmd.methodname = methodname + cmd.name = name + if description: + cmd.description = description + if param: + cmd.param = [] + for name, value in param.items(): + cmd.param.append({'name': name, 'value': value}) + return apiclient.createLBStickinessPolicy(cmd) + + def deleteSticky(self, apiclient, id): + """Deletes stickyness policy""" + + cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd() + cmd.id = id + return apiclient.deleteLBStickinessPolicy(cmd) + + @classmethod + def listStickyPolicies(cls, apiclient, lbruleid, **kwargs): + """Lists stickiness policies for load balancing rule""" + + cmd= listLBStickinessPolicies.listLBStickinessPoliciesCmd() + cmd.lbruleid = lbruleid + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listLBStickinessPolicies(cmd) + @classmethod def list(cls, apiclient, **kwargs): """List all Load balancing rules matching criteria""" @@ -1401,6 +1437,15 @@ class Network: [setattr(cmd, k, v) for k, v in kwargs.items()] return(apiclient.updateNetwork(cmd)) + def restart(self, apiclient, cleanup=None): + """Restarts the network""" + + cmd = restartNetwork.restartNetworkCmd() + cmd.id = self.id + if cleanup: + cmd.cleanup = cleanup + return(apiclient.restartNetwork(cmd)) + @classmethod def list(cls, apiclient, **kwargs): """List all Networks matching criteria""" diff --git a/test/integration/lib/common.py b/test/integration/lib/common.py index 7740a2873d3..5a644aaf16a 100644 --- a/test/integration/lib/common.py +++ b/test/integration/lib/common.py @@ -18,7 +18,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient from utils import * from base import * @@ -103,12 +103,12 @@ def download_systemplates_sec_storage(server, services): try: # Login to management server - ssh = remoteSSHClient.remoteSSHClient( + ssh = remoteSSHClient( server["ipaddress"], server["port"], server["username"], server["password"] - ) + ) except Exception: raise Exception("SSH access failted for server with IP address: %s" % server["ipaddess"]) diff --git a/test/integration/lib/utils.py b/test/integration/lib/utils.py index 15e63e285ad..b623f6b503d 100644 --- a/test/integration/lib/utils.py +++ b/test/integration/lib/utils.py @@ -16,7 +16,7 @@ import marvin import time -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.cloudstackAPI import * from marvin import cloudstackConnection #from cloudstackConnection import cloudConnection @@ -111,12 +111,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=50): loop_cnt = retries while True: try: - ssh = remoteSSHClient.remoteSSHClient( - ipaddress, - port, - username, - password - ) + ssh = remoteSSHClient(ipaddress, port, username, password) except Exception as e: if loop_cnt == 0: raise e @@ -158,12 +153,7 @@ def get_process_status(hostip, port, username, password, linklocalip, process): """Double hop and returns a process status""" #SSH to the machine - ssh = remoteSSHClient.remoteSSHClient( - hostip, - port, - username, - password - ) + ssh = remoteSSHClient(hostip, port, username, password) ssh_command = "ssh -i ~/.ssh/id_rsa.cloud -ostricthostkeychecking=no " ssh_command = ssh_command + \ "-oUserKnownHostsFile=/dev/null -p 3922 %s %s" % ( diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 5938094884f..d61bbe1d69b 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -31,7 +31,7 @@ class Services: def __init__(self): self.services = { - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '1a568aed-db2d-41ca-b644-416b0bdc067e', # Cent OS 5.3 (64 bit) "mode": 'advanced', # Networking mode: Basic or advanced @@ -457,7 +457,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient.remoteSSHClient( + remoteSSHClient( src_nat_ip_addr.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -573,7 +573,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient.remoteSSHClient( + remoteSSHClient( ip_address.ipaddress.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -778,7 +778,7 @@ class TestLoadBalancingRule(cloudstackTestCase): (self.vm_1.ipaddress, src_nat_ip_addr.ipaddress) ) - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( src_nat_ip_addr.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -803,7 +803,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.vm_2.id )) - ssh_2 = remoteSSHClient.remoteSSHClient( + ssh_2 = remoteSSHClient( src_nat_ip_addr.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -836,7 +836,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.vm_2.id )) - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( src_nat_ip_addr.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -859,7 +859,7 @@ class TestLoadBalancingRule(cloudstackTestCase): with self.assertRaises(Exception): self.debug("Removed all VMs, trying to SSH") - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( src_nat_ip_addr.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -969,7 +969,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.vm_1.id, self.vm_2.id )) - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -988,7 +988,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.vm_1.id, self.vm_2.id )) - ssh_2 = remoteSSHClient.remoteSSHClient( + ssh_2 = remoteSSHClient( self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -1016,7 +1016,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.non_src_nat_ip.ipaddress.ipaddress, self.vm_2.id )) - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -1042,7 +1042,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.non_src_nat_ip.ipaddress.ipaddress, self.vm_1.id )) - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, @@ -1195,7 +1195,7 @@ class TestRebootRouter(cloudstackTestCase): try: self.debug("SSH into VM (ID : %s ) after reboot" % self.vm_1.id) - remoteSSHClient.remoteSSHClient( + remoteSSHClient( self.nat_rule.ipaddress, self.services["natrule"]["publicport"], self.vm_1.username, @@ -1273,7 +1273,7 @@ class TestAssignRemoveLB(cloudstackTestCase): ] return - def test_assign_and_removal_elb(self): + def test_assign_and_removal_lb(self): """Test for assign & removing load balancing rule""" # Validate: @@ -1347,7 +1347,7 @@ class TestAssignRemoveLB(cloudstackTestCase): self.vm_2.id )) #Create SSH client for each VM - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress, self.services["lbrule"]["publicport"], self.vm_1.username, @@ -1364,7 +1364,7 @@ class TestAssignRemoveLB(cloudstackTestCase): self.vm_1.id, self.vm_2.id )) - ssh_2 = remoteSSHClient.remoteSSHClient( + ssh_2 = remoteSSHClient( self.non_src_nat_ip.ipaddress, self.services["lbrule"]["publicport"], self.vm_2.username, @@ -1406,7 +1406,7 @@ class TestAssignRemoveLB(cloudstackTestCase): self.vm_1.id, )) # Again make a SSH connection, as previous is not used after LB remove - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress, self.services["lbrule"]["publicport"], self.vm_1.username, @@ -1428,13 +1428,13 @@ class TestAssignRemoveLB(cloudstackTestCase): lb_rule.assign(self.apiclient, [self.vm_3]) try: - ssh_1 = remoteSSHClient.remoteSSHClient( + ssh_1 = remoteSSHClient( self.non_src_nat_ip.ipaddress, self.services["lbrule"]["publicport"], self.vm_1.username, self.vm_1.password ) - ssh_3 = remoteSSHClient.remoteSSHClient( + ssh_3 = remoteSSHClient( self.non_src_nat_ip.ipaddress, self.services["lbrule"]["publicport"], self.vm_3.username, @@ -1599,7 +1599,7 @@ class TestReleaseIP(cloudstackTestCase): # SSH Attempt though public IP should fail with self.assertRaises(Exception): - ssh_2 = remoteSSHClient.remoteSSHClient( + ssh_2 = remoteSSHClient( self.ip_addr.ipaddress, self.services["natrule"]["publicport"], self.virtual_machine.username, diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 603ca672571..8b60933cfe6 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -42,7 +42,7 @@ class Services: { "displayname": "Test VM", "username": "root", - "password": "fr3sca", + "password": "password", "ssh_port": 22, "hypervisor": 'XenServer', "privateport": 22, @@ -54,9 +54,9 @@ class Services: "firstname": "Test", "lastname": "User", "username": "testuser", - "password": "fr3sca", + "password": "password", }, - "ostypeid":'946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid":'1a568aed-db2d-41ca-b644-416b0bdc067e', "sleep": 60, "timeout": 10, "mode": 'advanced', #Networking mode: Basic, Advanced @@ -152,7 +152,7 @@ class TestRouterServices(cloudstackTestCase): zoneid=router.zoneid, type='Routing', state='Up', - virtualmachineid=self.vm_1.id + id=router.hostid ) self.assertEqual( isinstance(hosts, list), @@ -214,7 +214,7 @@ class TestRouterServices(cloudstackTestCase): zoneid=router.zoneid, type='Routing', state='Up', - virtualmachineid=self.vm_1.id + id=router.hostid ) self.assertEqual( isinstance(hosts, list), @@ -400,7 +400,7 @@ class TestRouterServices(cloudstackTestCase): zoneid=router.zoneid, type='Routing', state='Up', - virtualmachineid=self.vm_1.id + id=router.hostid ) self.assertEqual( isinstance(hosts, list), diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index 9f60593aa9b..120c4fa0a8f 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -39,14 +39,6 @@ class Services: "hypervisor": "XenServer", "templatefilter": "self", }, - 1: { - "hypervisor": "KVM", - "templatefilter": "self", - }, - 2: { - "hypervisor": "VMWare", - "templatefilter": "self", - }, }, "sleep": 60, "timeout": 5, @@ -89,6 +81,7 @@ class TestSecStorageServices(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @unittest.skip("do not add secondary storage") def test_01_add_sec_storage(self): """Test secondary storage """ @@ -377,4 +370,4 @@ class TestSecStorageServices(cloudstackTestCase): True, "Check whether state of template is ready or not" ) - return \ No newline at end of file + return diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 694e60e2b8f..91e65a41a0d 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -17,10 +17,10 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * +from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient class Services: diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index f67d918f91f..0e341d5a74a 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -34,7 +34,7 @@ class Services: self.services = { "host": { "username": 'root', # Credentials for SSH - "password": 'fr3sca', + "password": 'password', "publicport": 22, }, "sleep": 60, @@ -78,7 +78,6 @@ class TestSSVMs(cloudstackTestCase): self.apiclient, systemvmtype='secondarystoragevm', state='Running', - zoneid=self.zone.id ) self.assertEqual( isinstance(list_ssvm_response, list), @@ -196,7 +195,6 @@ class TestSSVMs(cloudstackTestCase): self.apiclient, systemvmtype='consoleproxy', state='Running', - zoneid=self.zone.id ) self.assertEqual( isinstance(list_cpvm_response, list), diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 40d17665900..b125aa5c768 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -17,7 +17,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * @@ -42,7 +42,7 @@ class Services: "username": "test", # Random characters are appended in create account to # ensure unique username generated each time - "password": "fr3sca", + "password": "password", }, "small": # Create a small virtual machine instance with disk offering @@ -84,7 +84,7 @@ class Services: "name": "Small Instance", "displaytext": "Small Instance", "cpunumber": 1, - "cpuspeed": 500, + "cpuspeed": 100, "memory": 256 }, "medium": @@ -94,17 +94,17 @@ class Services: "name": "Medium Instance", "displaytext": "Medium Instance", "cpunumber": 1, - "cpuspeed": 1000, - "memory": 1024 + "cpuspeed": 100, + "memory": 256 } }, "iso": # ISO settings for Attach/Detach ISO tests { "displaytext": "Test ISO", "name": "testISO", - "url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso", + "url": "http://nfs1.lab.vmops.com/isos_32bit/dsl-4.4.10.iso", # Source URL where ISO is located - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '1a568aed-db2d-41ca-b644-416b0bdc067e', "mode": 'HTTP_DOWNLOAD', # Downloading existing ISO }, "template": { @@ -118,7 +118,7 @@ class Services: "sleep": 60, "timeout": 10, #Migrate VM to hostid - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '1a568aed-db2d-41ca-b644-416b0bdc067e', # CentOS 5.3 (64-bit) "mode":'advanced', } @@ -751,18 +751,15 @@ class TestVMLifeCycle(cloudstackTestCase): True, "Check the number of hosts in the zone" ) - self.assertEqual( + self.assertGreaterEqual( len(hosts), 2, "Atleast 2 hosts should be present in a zone for VM migration" ) + # Remove the host of current VM from the hosts list + hosts[:] = [host for host in hosts if host.id != self.medium_virtual_machine.hostid] - # Find the host of VM and also the new host to migrate VM. - if self.medium_virtual_machine.hostid == hosts[0].id: - host = hosts[1] - else: - host = hosts[0] - + host = hosts[0] self.debug("Migrating VM-ID: %s to Host: %s" % ( self.medium_virtual_machine.id, host.id diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 7ea16837c26..f6b5e79db90 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -17,10 +17,10 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * +from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * -from marvin import remoteSSHClient #Import System modules import os import urllib