You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/07/28 17:44:28 UTC

[01/24] git commit: updated refs/heads/4.4 to e33d4a5

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 798a6aa2e -> e33d4a573


Fixes for BVT and Regression run failures against 4.4 CS

(cherry picked from commit db153062dbe356021924d9b3441b9d2561d06283)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5efb6359
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5efb6359
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5efb6359

Branch: refs/heads/4.4
Commit: 5efb635980e3458ddaaf98e08cbcba919a0ab309
Parents: 04cac3f
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Wed Apr 30 11:03:40 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:13 2014 +0200

----------------------------------------------------------------------
 .../component/test_advancedsg_networks.py       |  8 +++----
 .../component/test_dynamic_compute_offering.py  | 22 ++++++++++----------
 .../component/test_multiple_ips_per_nic.py      |  8 +++----
 tools/marvin/marvin/config/test_data.py         | 20 ++++++++++++++++++
 4 files changed, 39 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5efb6359/test/integration/component/test_advancedsg_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_advancedsg_networks.py b/test/integration/component/test_advancedsg_networks.py
index f9155ed..2794f96 100644
--- a/test/integration/component/test_advancedsg_networks.py
+++ b/test/integration/component/test_advancedsg_networks.py
@@ -1307,11 +1307,11 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase):
                                                   zoneid=self.zone.id)
 
         # Creaint user API client of account 1
-        api_client_account_1 = self.testClient.createUserApiClient(UserName=account_1.name,
+        api_client_account_1 = self.testClient.getUserApiClient(UserName=account_1.name,
                                                          DomainName=account_1.domain)
 
         # Creaint user API client of account 2
-        api_client_account_2 = self.testClient.createUserApiClient(UserName=account_2.name,
+        api_client_account_2 = self.testClient.getUserApiClient(UserName=account_2.name,
                                                          DomainName=account_2.domain)
 
         self.debug("Creating virtual machine in account %s with account specific shared network %s" %
@@ -1419,11 +1419,11 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase):
         self.cleanup_networks.append(shared_network_domain_2)
 
         # Creaint user API client of account 1
-        api_client_domain_1 = self.testClient.createUserApiClient(UserName=account_1.name,
+        api_client_domain_1 = self.testClient.getUserApiClient(UserName=account_1.name,
                                                          DomainName=account_1.domain)
 
         # Creaint user API client of account 2
-        api_client_domain_2 = self.testClient.createUserApiClient(UserName=account_2.name,
+        api_client_domain_2 = self.testClient.getUserApiClient(UserName=account_2.name,
                                                          DomainName=account_2.domain)
 
         self.debug("Creating virtual machine in domain %s with domain wide shared network %s" %

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5efb6359/test/integration/component/test_dynamic_compute_offering.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_dynamic_compute_offering.py b/test/integration/component/test_dynamic_compute_offering.py
index e6d0dbc..8cb6eb1 100644
--- a/test/integration/component/test_dynamic_compute_offering.py
+++ b/test/integration/component/test_dynamic_compute_offering.py
@@ -225,7 +225,7 @@ class TestDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -287,7 +287,7 @@ class TestDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account and its api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -354,7 +354,7 @@ class TestDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -502,7 +502,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -567,7 +567,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -651,7 +651,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -719,7 +719,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -795,7 +795,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create Account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -855,7 +855,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Crate account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -930,7 +930,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)
@@ -995,7 +995,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
 
         # Create account and api client
         self.account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id, admin=isadmin)
-        apiclient = self.testClient.createUserApiClient(
+        apiclient = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
         self.cleanup.append(self.account)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5efb6359/test/integration/component/test_multiple_ips_per_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py
index 2739637..03ebb83 100644
--- a/test/integration/component/test_multiple_ips_per_nic.py
+++ b/test/integration/component/test_multiple_ips_per_nic.py
@@ -149,7 +149,7 @@ class TestBasicOperations(cloudstackTestCase):
         cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client,
                                                                       cls.services["shared_network_offering"])
         cls._cleanup.append(cls.shared_network_offering)
-
+        cls.mode = cls.zone.networktype
         if cls.mode == "advanced":
             cls.isolated_network_offering = CreateEnabledNetworkOffering(cls.api_client,
                                                                       cls.services["isolated_network_offering"])
@@ -426,7 +426,7 @@ class TestBasicOperations(cloudstackTestCase):
         self.cleanup.append(self.account)
         self.cleanup.append(child_domain)
 
-        apiclient = self.testClient.createUserApiClient(UserName=self.account.name, DomainName=self.account.domain)
+        apiclient = self.testClient.getUserApiClient(UserName=self.account.name, DomainName=self.account.domain)
 
         if(shouldTestBeSkipped(networkType=value, zoneType=self.mode)):
             self.skipTest("Skipping test as %s network is not supported in basic zone" % value)
@@ -499,7 +499,7 @@ class TestNetworkRules(cloudstackTestCase):
 
         cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"])
         cls._cleanup.append(cls.shared_network_offering)
-
+        cls.mode = cls.zone.networktype
         if cls.mode == "advanced":
             cls.isolated_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["isolated_network_offering"])
             cls._cleanup.append(cls.isolated_network_offering)
@@ -873,7 +873,7 @@ class TestVmNetworkOperations(cloudstackTestCase):
 
         cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"])
         cls._cleanup.append(cls.shared_network_offering)
-
+        cls.mode = cls.zone.networktype
         if cls.mode == "advanced":
             cls.isolated_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["isolated_network_offering"])
             cls._cleanup.append(cls.isolated_network_offering)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5efb6359/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index 8829f13..b862205 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -149,6 +149,26 @@ test_data = {
             "PortForwarding": 'VirtualRouter',
         },
     },
+    "nw_off_isolated_netscaler": {
+        "name": "Network offering-ns services",
+        "displaytext": "Network offering-ns services",
+        "guestiptype": "Isolated",
+        "supportedservices":
+        "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
+        "traffictype": "GUEST",
+        "availability": "Optional'",
+        "serviceProviderList": {
+            "Dhcp": "VirtualRouter",
+            "Dns": "VirtualRouter",
+            "SourceNat": "VirtualRouter",
+            "PortForwarding": "VirtualRouter",
+            "Vpn": "VirtualRouter",
+            "Firewall": "VirtualRouter",
+            "Lb": "NetScaler",
+            "UserData": "VirtualRouter",
+            "StaticNat": "VirtualRouter"
+        }
+    },
     "nw_off_isolated_persistent": {
         "name": 'Test Nw off isolated persistent',
         "displaytext": 'Test Nw off isolated persistent',


[18/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-5342: Fix for failure in adding network to VM

(cherry picked from commit 24ef79aef82b69015c6e552258c4829d5a15a9d8)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/79eae73a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/79eae73a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/79eae73a

Branch: refs/heads/4.4
Commit: 79eae73add39a795c4e1202483ebce4609b6dc31
Parents: 51442f3
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue May 27 14:44:59 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:27 2014 +0200

----------------------------------------------------------------------
 .../component/test_add_remove_network.py        | 55 ++++++++++++++++----
 tools/marvin/marvin/lib/base.py                 |  4 ++
 2 files changed, 50 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79eae73a/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index 2aadb5b..a4e8254 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -292,7 +292,14 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
         self.debug("virtual machine nics: %s" % vm_list[0].nic)
         nics = [x for x in vm_list[0].nic if x.networkid == network.id]
         self.debug("Filtered nics list: %s:" % nics)
-        self.addednics.append(nics[-1])
+
+        # Only the nics added to self.virtual_machine should be added to this list
+        # Nics added to his list are removed before execution of next test case because we are using
+        # same virtual machine in all test cases, so it is important that the common
+        # virtual machine should contain only the default nic whenever new test case
+        # execution starts
+        if vm.id == self.virtual_machine.id:
+            self.addednics.append(nics[-1])
 
         self.assertTrue(len(nics) == 1, "nics list should contain the nic of added isolated network,\
                         the number of nics for the network should be 1, instead they are %s" %
@@ -392,12 +399,23 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
         if network is None:
             self.skipTest("Network should not be none. Case not handled for Network of type %s" % value)
 
+        try:
+            virtual_machine = VirtualMachine.create(
+                self.api_client, self.services["virtual_machine"],
+                accountid=self.account.name, domainid=self.account.domainid,
+                serviceofferingid=self.service_offering.id,
+                mode=self.zone.networktype,
+                networkids=[self.defaultNetworkId])
+            self.cleanup.append(virtual_machine)
+        except Exception as e:
+            self.fail("Failed to deply virtual machine: %s" % e)
+
         # Adding network to vm for the first time
-        self.addNetworkToVm(network, self.virtual_machine)
+        self.addNetworkToVm(network, virtual_machine)
 
         # Trying to add same network to vm for the second time
         with self.assertRaises(Exception) as e:
-            self.addNetworkToVm(network, self.virtual_machine)
+            self.addNetworkToVm(network, virtual_machine)
             self.debug("Adding same network again failed with exception: %s" % e.exception)
 
         return
@@ -415,8 +433,19 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
         # Validate the following:
         # 1. Adding VPC to vm should fail
 
+        try:
+            virtual_machine = VirtualMachine.create(
+                self.api_client, self.services["virtual_machine"],
+                accountid=self.account.name, domainid=self.account.domainid,
+                serviceofferingid=self.service_offering.id,
+                mode=self.zone.networktype,
+                networkids=[self.defaultNetworkId])
+            self.cleanup.append(virtual_machine)
+        except Exception as e:
+            self.fail("Failed to deply virtual machine: %s" % e)
+
         network = self.isolated_network
-        self.addNetworkToVm(network, self.virtual_machine)
+        self.addNetworkToVm(network, virtual_machine)
 
         self.debug("Creating VPC offering")
         vpc_off = VpcOffering.create(self.api_client,self.services["vpc_offering"])
@@ -432,11 +461,10 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
         self.debug("Trying to add VPC to vm belonging to isolated network, this should fail")
         with self.assertRaises(Exception):
-            self.virtual_machine.add_nic(self.apiclient, vpc.id)
+            virtual_machine.add_nic(self.apiclient, vpc.id)
 
         self.debug("Disabling vpc offering: %s" % vpc_off.id)
         vpc_off.update(self.apiclient, state='Disabled')
-
         return
 
     @attr(tags = ["advanced"])
@@ -499,10 +527,20 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
         # 2. The newly added nic has the ip address same as
         #    that passed while adding the network
 
+        try:
+            virtual_machine = VirtualMachine.create(
+                self.api_client, self.services["virtual_machine"],
+                accountid=self.account.name, domainid=self.account.domainid,
+                serviceofferingid=self.service_offering.id,
+                mode=self.zone.networktype,
+                networkids=[self.defaultNetworkId])
+            self.cleanup.append(virtual_machine)
+        except Exception as e:
+            self.fail("Failed to deply virtual machine: %s" % e)
+
         ipaddress = self.shared_nw_endip
         self.debug("Adding network to vm with ip address %s: " % ipaddress)
-        self.addNetworkToVm(self.shared_network, self.virtual_machine,ipaddress = ipaddress)
-
+        self.addNetworkToVm(self.shared_network, virtual_machine,ipaddress = ipaddress)
         return
 
     @attr(tags = ["advanced"])
@@ -1077,7 +1115,6 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase):
                 serviceofferingid=self.service_offering.id,mode=self.zone.networktype)
         time.sleep(self.services["sleep"])
         self.debug("Deployed virtual machine: %s" % virtual_machine.id)
-     
         foreignNicId = virtual_machine.nic[0].id
 
         self.debug("Trying to set nic of new virtual machine as default nic of existing virtual machine, This \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79eae73a/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index c7b7083..2cd7009 100644
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -475,6 +475,10 @@ class VirtualMachine:
         cmd = startVirtualMachine.startVirtualMachineCmd()
         cmd.id = self.id
         apiclient.startVirtualMachine(cmd)
+        response = self.getState(apiclient, VirtualMachine.RUNNING)
+        if response[0] == FAIL:
+            raise Exception(response[1])
+        return
 
     def stop(self, apiclient, forced=None):
         """Stop the instance"""


[19/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6776: Removed hard coded vlan ids from BVT test_non_contiguous_vlan.py

(cherry picked from commit 81bf37f33853d95e7c4137d57a60e719963913c4)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7f44f4a7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7f44f4a7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7f44f4a7

Branch: refs/heads/4.4
Commit: 7f44f4a782fda1581bbcdc46075baf6f5e0e1cdb
Parents: 79eae73
Author: Bharat Kumar <bh...@citrix.com>
Authored: Thu Jun 5 11:11:38 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:29 2014 +0200

----------------------------------------------------------------------
 .../smoke/test_non_contigiousvlan.py            | 33 +++++++++-----------
 1 file changed, 15 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f44f4a7/test/integration/smoke/test_non_contigiousvlan.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py
index 90235ec..50b48d0 100644
--- a/test/integration/smoke/test_non_contigiousvlan.py
+++ b/test/integration/smoke/test_non_contigiousvlan.py
@@ -15,31 +15,28 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from marvin import cloudstackTestCase
-from marvin.cloudstackAPI import *
+#from marvin.cloudstackAPI import *
 from marvin.cloudstackTestCase import cloudstackTestCase
-from marvin.lib.base import Account
 from marvin.lib.base import PhysicalNetwork
+from marvin.lib.common import setNonContiguousVlanIds, get_zone
 from nose.plugins.attrib import attr
 
-class Services():
-    def __init__(self):
-        self.services = {
-            "vlan": {
-                "part": ["4090-4091", "4092-4095"],
-                "full": "4090-4095",
-            }
-        }
-
-
 @attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776")
 class TestUpdatePhysicalNetwork(cloudstackTestCase):
     """
     Test to extend physical network vlan range
     """
     def setUp(self):
-        self.vlan = Services().services["vlan"]
         self.apiClient = self.testClient.getApiClient()
+        self.zone = get_zone(self.apiClient, self.testClient.getZoneForTests())
+        self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiClient, self.zone.id)
+
+        self.physicalnetworkid = self.physicalnetwork.id
+        self.existing_vlan = self.physicalnetwork.vlan
+
+        if self.vlan is None:
+            raise Exception("Failed to set non contiguous vlan ids to test. Free some ids from \
+                        from existing physical networks at ends")
 
 
     def test_extendPhysicalNetworkVlan(self):
@@ -53,13 +50,13 @@ class TestUpdatePhysicalNetwork(cloudstackTestCase):
         self.network = phy_networks[0]
         self.networkid = phy_networks[0].id
         self.existing_vlan = phy_networks[0].vlan
-        vlan1 = self.existing_vlan+","+self.vlan["part"][0]
+        vlan1 = self.existing_vlan+","+self.vlan["partial_range"][0]
         updatePhysicalNetworkResponse = self.network.update(self.apiClient, id = self.networkid, vlan = vlan1)
         self.assert_(updatePhysicalNetworkResponse is not None,
             msg="couldn't extend the physical network with vlan %s"%vlan1)
         self.assert_(isinstance(self.network, PhysicalNetwork))
 
-        vlan2 = vlan1+","+self.vlan["part"][1]
+        vlan2 = vlan1+","+self.vlan["partial_range"][1]
         updatePhysicalNetworkResponse2 = self.network.update(self.apiClient, id = self.networkid, vlan = vlan2)
         self.assert_(updatePhysicalNetworkResponse2 is not None,
             msg="couldn't extend the physical network with vlan %s"%vlan2)
@@ -68,7 +65,7 @@ class TestUpdatePhysicalNetwork(cloudstackTestCase):
         vlanranges= updatePhysicalNetworkResponse2.vlan
         self.assert_(vlanranges is not None,
             "No VLAN ranges found on the deployment")
-        self.assert_(vlanranges.find(self.vlan["full"]) > 0, "vlan ranges are not extended")
+        self.assert_(str(vlanranges) == vlan2, "vlan ranges are not extended")
 
 
     def tearDown(self):
@@ -82,6 +79,6 @@ class TestUpdatePhysicalNetwork(cloudstackTestCase):
         self.network = phy_networks[0]
         self.networkid = phy_networks[0].id
         updateResponse = self.network.update(self.apiClient, id = self.networkid, vlan=self.existing_vlan)
-        self.assert_(updateResponse.vlan.find(self.vlan["full"]) < 0,
+        self.assert_(updateResponse.vlan.find(self.vlan["full_range"]) < 0,
             "VLAN was not removed successfully")
 


[17/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6726: Fixing BVT test case test_network.py

(cherry picked from commit 3125ae5c6a7a286a4891755e0d8d57bfc6e7ce97)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/51442f35
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/51442f35
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/51442f35

Branch: refs/heads/4.4
Commit: 51442f355c0195cdd3b1b89f63e1e1e52d917327
Parents: 84ba19d
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue May 27 14:37:07 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:26 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_network.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51442f35/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index 838f4a3..bf460da 100644
--- a/test/integration/smoke/test_network.py
+++ b/test/integration/smoke/test_network.py
@@ -383,12 +383,13 @@ class TestPortForwarding(cloudstackTestCase):
 
         try:
             nat_rule.delete(self.apiclient)
-            list_nat_rule_response = list_nat_rules(
-                                                self.apiclient,
-                                                id=nat_rule.id
-                                                )
-        except CloudstackAPIException:
-            self.fail("Nat Rule Deletion or Listing Failed")
+        except Exception as e:
+            self.fail("NAT Rule Deletion Failed: %s" % e)
+
+        # NAT rule listing should fail as the nat rule does not exist
+        with self.assertRaises(Exception):
+            list_nat_rules(self.apiclient,
+                           id=nat_rule.id)
 
         # Check if the Public SSH port is inaccessible
         with self.assertRaises(Exception):


[13/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Removing tests related to sparse and fat volume provisioning from 4.4-forward. This feature is not part of 4.4 release.

(cherry picked from commit f278c537d527aa0a9cf0e20cf80dd48e1d85ec82)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b0f446c7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b0f446c7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b0f446c7

Branch: refs/heads/4.4
Commit: b0f446c7294b1804da2b2b88c34e3445eedc3a7a
Parents: 247377c
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Mon May 19 21:48:17 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:22 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_disk_offerings.py | 81 ----------------------
 test/integration/smoke/test_volumes.py        | 16 -----
 2 files changed, 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0f446c7/test/integration/smoke/test_disk_offerings.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py
index 780c154..45f438f 100644
--- a/test/integration/smoke/test_disk_offerings.py
+++ b/test/integration/smoke/test_disk_offerings.py
@@ -89,87 +89,6 @@ class TestCreateDiskOffering(cloudstackTestCase):
                         )
         return
 
-    @attr(hypervisor="kvm")
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"])
-    def test_02_create_sparse_type_disk_offering(self):
-        """Test to create  a sparse type disk offering"""
-
-        # Validate the following:
-        # 1. createDiskOfferings should return valid info for new offering
-        # 2. The Cloud Database contains the valid information
-
-        disk_offering = DiskOffering.create(
-                                        self.apiclient,
-                                        self.services["sparse"]
-                                        )
-        self.cleanup.append(disk_offering)
-
-        self.debug("Created Disk offering with ID: %s" % disk_offering.id)
-
-        list_disk_response = list_disk_offering(
-                                                self.apiclient,
-                                                id=disk_offering.id
-                                                )
-        self.assertEqual(
-                            isinstance(list_disk_response, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertNotEqual(
-                            len(list_disk_response),
-                            0,
-                            "Check Disk offering is created"
-                        )
-        disk_response = list_disk_response[0]
-
-        self.assertEqual(
-                            disk_response.provisioningtype,
-                            self.services["sparse"]["provisioningtype"],
-                            "Check provisionig type in createServiceOffering"
-                        )
-        return
-
-
-    @attr(hypervisor="kvm")
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"])
-    def test_04_create_fat_type_disk_offering(self):
-        """Test to create  a sparse type disk offering"""
-
-        # Validate the following:
-        # 1. createDiskOfferings should return valid info for new offering
-        # 2. The Cloud Database contains the valid information
-
-        disk_offering = DiskOffering.create(
-                                        self.apiclient,
-                                        self.services["fat"]
-                                        )
-        self.cleanup.append(disk_offering)
-
-        self.debug("Created Disk offering with ID: %s" % disk_offering.id)
-
-        list_disk_response = list_disk_offering(
-                                                self.apiclient,
-                                                id=disk_offering.id
-                                                )
-        self.assertEqual(
-                            isinstance(list_disk_response, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertNotEqual(
-                            len(list_disk_response),
-                            0,
-                            "Check Disk offering is created"
-                        )
-        disk_response = list_disk_response[0]
-
-        self.assertEqual(
-                            disk_response.provisioningtype,
-                            self.services["fat"]["provisioningtype"],
-                            "Check provisionig type in createServiceOffering"
-                        )
-        return
-
 class TestDiskOfferings(cloudstackTestCase):
 
     def setUp(self):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0f446c7/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index f3115af..de6af77 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -50,10 +50,6 @@ class TestCreateVolume(cloudstackTestCase):
                                     cls.apiclient,
                                     cls.services["disk_offering"]
                                     )
-        cls.sparse_disk_offering = DiskOffering.create(
-                                    cls.apiclient,
-                                    cls.services["sparse_disk_offering"]
-                                    )
         cls.custom_disk_offering = DiskOffering.create(
                                     cls.apiclient,
                                     cls.services["disk_offering"],
@@ -125,18 +121,6 @@ class TestCreateVolume(cloudstackTestCase):
             self.debug("Created a volume with ID: %s" % volume.id)
             self.volumes.append(volume)
 
-        if self.virtual_machine.hypervisor == "KVM":
-            sparse_volume = Volume.create(
-                                        self.apiClient,
-                                        self.services,
-                                        zoneid=self.zone.id,
-                                        account=self.account.name,
-                                        domainid=self.account.domainid,
-                                        diskofferingid=self.sparse_disk_offering.id
-                                        )
-            self.debug("Created a sparse volume: %s" % sparse_volume.id)
-            self.volumes.append(sparse_volume)
-
         volume = Volume.create_custom_disk(
                                     self.apiClient,
                                     self.services,


[10/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixing few issues in Multiple IPs test cases

(cherry picked from commit 4466ed1ce18fd5391b2b96fa551c171ae7e09723)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/38ef939e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/38ef939e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/38ef939e

Branch: refs/heads/4.4
Commit: 38ef939efd4a97346b0a4ef176b335266617ac40
Parents: acf70da
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Sat May 10 00:26:46 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:19 2014 +0200

----------------------------------------------------------------------
 .../component/test_multiple_ips_per_nic.py      | 22 +++++++++++---------
 tools/marvin/marvin/config/test_data.py         | 21 +++++++++++++++++++
 2 files changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38ef939e/test/integration/component/test_multiple_ips_per_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py
index 03ebb83..abe9474 100644
--- a/test/integration/component/test_multiple_ips_per_nic.py
+++ b/test/integration/component/test_multiple_ips_per_nic.py
@@ -143,11 +143,11 @@ class TestBasicOperations(cloudstackTestCase):
                                             cls.services["service_offering"]
                                             )
         cls._cleanup = [cls.service_offering]
-        cls.services["shared_network_offering"]["specifyVlan"] = "True"
-        cls.services["shared_network_offering"]["specifyIpRanges"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True"
 
         cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client,
-                                                                      cls.services["shared_network_offering"])
+                                                                      cls.services["shared_network_offering_all_services"])
         cls._cleanup.append(cls.shared_network_offering)
         cls.mode = cls.zone.networktype
         if cls.mode == "advanced":
@@ -443,7 +443,7 @@ class TestBasicOperations(cloudstackTestCase):
         try:
             ipaddress_1 = NIC.addIp(apiclient, id=virtual_machine.nic[0].id)
         except Exception as e:
-            self.fail("Failed while adding secondary IP to NIC of vm %s" % virtual_machine.id)
+            self.fail("Failed while adding secondary IP to NIC of vm %s: %s" % (virtual_machine.id, e))
 
         try:
             NIC.list(apiclient, virtualmachineid=virtual_machine.id)
@@ -494,10 +494,11 @@ class TestNetworkRules(cloudstackTestCase):
                                             cls.services["service_offering"]
                                             )
         cls._cleanup = [cls.service_offering]
-        cls.services["shared_network_offering"]["specifyVlan"] = "True"
-        cls.services["shared_network_offering"]["specifyIpRanges"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True"
 
-        cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"])
+        cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client,
+                                        cls.services["shared_network_offering_all_services"])
         cls._cleanup.append(cls.shared_network_offering)
         cls.mode = cls.zone.networktype
         if cls.mode == "advanced":
@@ -868,10 +869,11 @@ class TestVmNetworkOperations(cloudstackTestCase):
                                             cls.services["service_offering"]
                                             )
         cls._cleanup = [cls.service_offering]
-        cls.services["shared_network_offering"]["specifyVlan"] = "True"
-        cls.services["shared_network_offering"]["specifyIpRanges"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True"
+        cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True"
 
-        cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"])
+        cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client,
+                                        cls.services["shared_network_offering_all_services"])
         cls._cleanup.append(cls.shared_network_offering)
         cls.mode = cls.zone.networktype
         if cls.mode == "advanced":

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38ef939e/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index b862205..e682cf7 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -264,6 +264,27 @@ test_data = {
             "UserData": "VirtualRouter"
             }
     },
+    "shared_network_offering_all_services": {
+            "name":"shaared network offering with services enabled",
+            "displaytext": "Shard network offering",
+            "guestiptype": "Shared",
+            "supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
+            "specifyVlan" : "False",
+            "specifyIpRanges" : "False",
+            "traffictype": "GUEST",
+            "serviceProviderList" : {
+                "Dhcp": "VirtualRouter",
+                "Dns": "VirtualRouter",
+                "UserData": "VirtualRouter",
+                "SourceNat": "VirtualRouter",
+                "PortForwarding": "VirtualRouter",
+                "Vpn": "VirtualRouter",
+                "Firewall": "VirtualRouter",
+                "Lb": "VirtualRouter",
+                "UserData": "VirtualRouter",
+                "StaticNat": "VirtualRouter"
+            }
+    },
     "shared_network_offering_sg": {
         "name": "MySharedOffering-sg",
         "displaytext": "MySharedOffering-sg",


[15/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixed issues in regression suite project cpu limits

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit c3c809647667229c4e46096a85dbbf75eec4d005)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e51a9f13
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e51a9f13
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e51a9f13

Branch: refs/heads/4.4
Commit: e51a9f13205d64755003aa5f7ce782206a026586
Parents: 26f3995
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed May 21 03:56:42 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:25 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_cpu_project_limits.py | 3 ++-
 tools/marvin/marvin/lib/base.py                       | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e51a9f13/test/integration/component/test_cpu_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py
index b33b9f1..e795828 100644
--- a/test/integration/component/test_cpu_project_limits.py
+++ b/test/integration/component/test_cpu_project_limits.py
@@ -172,7 +172,8 @@ class TestProjectsCPULimits(cloudstackTestCase):
                         projectid=project.id,
                         networkids=networks,
                         serviceofferingid=service_off.id)
-            vms = VirtualMachine.list(api_client, id=self.vm.id, listall=True)
+            vms = VirtualMachine.list(api_client, projectid=project.id,
+			              id=self.vm.id, listall=True)
             self.assertIsInstance(vms,
                     list,
                     "List VMs should return a valid response")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e51a9f13/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index b70789f..c7b7083 100644
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -551,7 +551,11 @@ class VirtualMachine:
 
         while timeout>0:
             try:
-                vms = VirtualMachine.list(apiclient, id=self.id, listAll=True)
+                projectid = None
+                if hasattr(self, "projectid"):
+                    projectid = self.projectid
+                vms = VirtualMachine.list(apiclient, projectid=projectid,
+				          id=self.id, listAll=True)
                 validationresult = validateList(vms)
                 if validationresult[0] == FAIL:
                     raise Exception("VM list validation failed: %s" % validationresult[2])


[03/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
removed basic zone tag and added advanced zone tag

Conflicts:
	test/integration/smoke/test_nic.py

(cherry picked from commit 486ee69ef47fe675921ee255eea112675e20418c)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a2f3f21
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a2f3f21
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a2f3f21

Branch: refs/heads/4.4
Commit: 7a2f3f21a51785b7208627e438f3ba4a5a62e522
Parents: a606277
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Wed Apr 30 14:00:18 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:14 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_nic.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a2f3f21/test/integration/smoke/test_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index 3f91d70..592a839 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -119,7 +119,7 @@ class TestNic(cloudstackTestCase):
         except Exception as ex:
             self.debug("Exception during NIC test SETUP!: " + str(ex))
 
-    @attr(tags = ["devcloud",  "smoke", "advanced", "provisioning"])
+    @attr(tags = ["devcloud",  "smoke", "advanced", "advancedns", "provisioning"])
     def test_01_nic(self):
         #TODO: SIMENH: add validation
         """Test to add and update added nic to a virtual machine"""


[04/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fix few issues seen in run.

Signed-off-by: Santhosh Edukulla <Sa...@citrix.com>
(cherry picked from commit 80121f6be736283c5a485595bcb54c41b28787fa)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a606277e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a606277e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a606277e

Branch: refs/heads/4.4
Commit: a606277e2092b43e4674b3784e4a586a1382dc98
Parents: 5efb635
Author: Santhosh Edukulla <Sa...@citrix.com>
Authored: Wed Apr 30 17:45:14 2014 +1000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:14 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vm_root_resize.py | 2 +-
 tools/marvin/marvin/configGenerator.py               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a606277e/test/integration/smoke/test_deploy_vm_root_resize.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py
index e758ffd..8097d08 100644
--- a/test/integration/smoke/test_deploy_vm_root_resize.py
+++ b/test/integration/smoke/test_deploy_vm_root_resize.py
@@ -81,7 +81,7 @@ class TestDeployVM(cloudstackTestCase):
         self.testdata["mode"] = self.zone.networktype
         self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
         if self.template == FAILED:
-            assert False, "get_template() failed to return template with description %s" % self.services["ostype"]
+            assert False, "get_template() failed to return template "
 #       for testing with specific template
 #        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"], templatetype='USER', services = {"template":'31f52a4d-5681-43f7-8651-ad4aaf823618'})
         

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a606277e/tools/marvin/marvin/configGenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py
index 68ec24e..8b50d84 100644
--- a/tools/marvin/marvin/configGenerator.py
+++ b/tools/marvin/marvin/configGenerator.py
@@ -377,7 +377,7 @@ class ConfigManager(object):
                 config_dict = test_data
             else:
                 configLines = []
-                with open(file, 'r') as fp:
+                with open(self.__filePath, 'r') as fp:
                     for line in fp:
                         ws = line.strip()
                         if not ws.startswith("#"):


[20/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6873: Tagged tests based on the limitation described in the bug

(cherry picked from commit 89a03c7099fb5f0d6a3a892b036d064bfc2acb71)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75d2a331
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75d2a331
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75d2a331

Branch: refs/heads/4.4
Commit: 75d2a331ee5876c3c456c8a3c12258c3b8f07f00
Parents: 7f44f4a
Author: Koushik Das <ko...@apache.org>
Authored: Mon Jun 9 16:45:17 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:30 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vm.py | 4 ++--
 test/integration/smoke/test_vm_ha.py     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75d2a331/test/integration/smoke/test_deploy_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py
index e7e0dc4..c872558 100644
--- a/test/integration/smoke/test_deploy_vm.py
+++ b/test/integration/smoke/test_deploy_vm.py
@@ -205,7 +205,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
             self.mock_volume_failure
         ]
 
-    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708")
+    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873")
     def test_deploy_vm_volume_creation_failure(self):
         """Test Deploy Virtual Machine - volume creation failure and retry
 
@@ -316,7 +316,7 @@ class TestDeployVMStartFailure(cloudstackTestCase):
             self.mock_start_failure
         ]
 
-    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708")
+    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873")
     def test_deploy_vm_start_failure(self):
         """Test Deploy Virtual Machine - start operation failure and retry
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75d2a331/test/integration/smoke/test_vm_ha.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_ha.py b/test/integration/smoke/test_vm_ha.py
index f549243..e5d9666 100644
--- a/test/integration/smoke/test_vm_ha.py
+++ b/test/integration/smoke/test_vm_ha.py
@@ -178,7 +178,7 @@ class TestDeployVMHA(cloudstackTestCase):
         ]
         self.cleanup = self.cleanup + self.mock_checkonhost_list
 
-    @attr(tags = ['selfservice'])
+    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873")
     def test_vm_ha(self):
         """Test VM HA
 


[06/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixed Few cases running on invalid zone,domain Fixed creating client on user passed port Fixed other misc issues

Signed-off-by: jayapal <ja...@apache.org>
(cherry picked from commit 081ab7852505b46a6bb52b88dd89998f50ca54b6)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b8824d09
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b8824d09
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b8824d09

Branch: refs/heads/4.4
Commit: b8824d09cb497268701a034d73ce877f0bff3f35
Parents: 5e18332
Author: santhoshe <sa...@gmail.com>
Authored: Thu May 8 00:52:29 2014 +1000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:17 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vm.py    | 12 ++++++------
 tools/marvin/marvin/cloudstackTestClient.py | 14 +++++++-------
 tools/marvin/marvin/marvinPlugin.py         |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b8824d09/test/integration/smoke/test_deploy_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py
index ca4891d..5a2695d 100644
--- a/test/integration/smoke/test_deploy_vm.py
+++ b/test/integration/smoke/test_deploy_vm.py
@@ -169,8 +169,8 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
         self.apiclient = self.testClient.getApiClient()
 
         # Get Zone, Domain and Default Built-in template
-        self.domain = get_domain(self.apiclient, self.testdata)
-        self.zone = get_zone(self.apiclient, self.testdata)
+        self.domain = get_domain(self.apiclient)
+        self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
         self.testdata["mode"] = self.zone.networktype
         self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
 
@@ -183,7 +183,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
         #create a service offering
         self.service_offering = ServiceOffering.create(
             self.apiclient,
-            self.testdata["service_offering"]["small"]
+            self.testdata["service_offerings"]["small"]
         )
         #create first VM
         self.virtual_machine = VirtualMachine.create(
@@ -280,8 +280,8 @@ class TestDeployVMStartFailure(cloudstackTestCase):
         self.apiclient = self.testClient.getApiClient()
 
         # Get Zone, Domain and Default Built-in template
-        self.domain = get_domain(self.apiclient, self.testdata)
-        self.zone = get_zone(self.apiclient, self.testdata)
+        self.domain = get_domain(self.apiclient)
+        self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
         self.testdata["mode"] = self.zone.networktype
         self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
 
@@ -294,7 +294,7 @@ class TestDeployVMStartFailure(cloudstackTestCase):
         #create a service offering
         self.service_offering = ServiceOffering.create(
             self.apiclient,
-            self.testdata["service_offering"]["small"]
+            self.testdata["service_offerings"]["small"]
         )
         #create first VM
         self.virtual_machine = VirtualMachine.create(

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b8824d09/tools/marvin/marvin/cloudstackTestClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py
index 53d48ab..c7ad5c0 100644
--- a/tools/marvin/marvin/cloudstackTestClient.py
+++ b/tools/marvin/marvin/cloudstackTestClient.py
@@ -152,23 +152,23 @@ class CSTestClient(object):
                 if api_key is None:
                     ret = self.__getKeys(user_id)
                     if ret != FAILED:
-                        self.__mgmtDetails.port = 8080
-                        self.__mgmtDetails.apiKey = ret[0]
-                        self.__mgmtDetails.securityKey = ret[1]
+                        mgmt_details = self.__mgmtDetails
+                        mgmt_details.apiKey = ret[0]
+                        mgmt_details.securityKey = ret[1]
                     else:
                         self.__logger.error("__createApiClient: API Client "
                                             "Creation Failed while "
                                             "Registering User")
                         return FAILED
                 else:
-                    self.__mgmtDetails.port = 8080
-                    self.__mgmtDetails.apiKey = api_key
-                    self.__mgmtDetails.securityKey = security_key
+                    mgmt_details.port = 8080
+                    mgmt_details.apiKey = api_key
+                    mgmt_details.securityKey = security_key
                 '''
                 Now Create the Connection objects and Api Client using
                 new details
                 '''
-                self.__csConnection = CSConnection(self.__mgmtDetails,
+                self.__csConnection = CSConnection(mgmt_details,
                                                    self.__asyncTimeOut,
                                                    self.__logger)
                 self.__apiClient = CloudStackAPIClient(self.__csConnection)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b8824d09/tools/marvin/marvin/marvinPlugin.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py
index 4200a65..98bbb3f 100644
--- a/tools/marvin/marvin/marvinPlugin.py
+++ b/tools/marvin/marvin/marvinPlugin.py
@@ -179,7 +179,7 @@ class MarvinPlugin(Plugin):
         Dump Start Msg of TestCase to Log
         """
         if self.__tcRunLogger:
-            self.__tcRunLogger.debug("\n\n::::::::::::STARTED : TC: " +
+            self.__tcRunLogger.debug("::::::::::::STARTED : TC: " +
                                      str(self.__testName) + " :::::::::::")
         self.__startTime = time.time()
 


[16/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6760: skipping unsupported scale VM test on KVM

(cherry picked from commit 30bd9b8fe03a7162d67ec16b94846b0afb77fc2b)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/84ba19d0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/84ba19d0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/84ba19d0

Branch: refs/heads/4.4
Commit: 84ba19d0bcac2a8e8135fccd12e02a853f987f36
Parents: e51a9f1
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Mon May 26 19:23:41 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:25 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_scale_vm.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/84ba19d0/test/integration/smoke/test_scale_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py
index 03d2e87..261fe93 100644
--- a/test/integration/smoke/test_scale_vm.py
+++ b/test/integration/smoke/test_scale_vm.py
@@ -34,6 +34,9 @@ class TestScaleVm(cloudstackTestCase):
         testClient = super(TestScaleVm, cls).getClsTestClient()
         cls.apiclient = testClient.getApiClient()
         cls.services = testClient.getParsedTestDataConfig()
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        if cls.hypervisor.lower() == 'kvm':
+            raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test")
 
         # Get Zone, Domain and templates
         domain = get_domain(cls.apiclient)


[08/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6580: Adding listall parameter while listing Account in createUserApiClient

(cherry picked from commit c013813426874ae0cc1ac2b23238415652955901)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e8e8bed9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e8e8bed9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e8e8bed9

Branch: refs/heads/4.4
Commit: e8e8bed948e3caf4fadb0d012757c7a292131a44
Parents: b8824d0
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed May 7 21:08:14 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:18 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/cloudstackTestClient.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e8e8bed9/tools/marvin/marvin/cloudstackTestClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py
index c7ad5c0..0e4837e 100644
--- a/tools/marvin/marvin/cloudstackTestClient.py
+++ b/tools/marvin/marvin/cloudstackTestClient.py
@@ -325,6 +325,7 @@ class CSTestClient(object):
             cmd = listAccounts.listAccountsCmd()
             cmd.name = UserName
             cmd.domainid = domId
+            cmd.listall = True
             try:
                 accounts = self.__apiClient.listAccounts(cmd)
                 acctId = accounts[0].id


[11/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixed config issue related to Persistent Networks

(cherry picked from commit 149cd4b5646b37d1649c86a3428d4c89d03003a8)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d560391c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d560391c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d560391c

Branch: refs/heads/4.4
Commit: d560391c5090ce79765a72ccd6b8752793ac8f80
Parents: 1b99860
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed May 14 20:17:01 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:20 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/config/test_data.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d560391c/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index e682cf7..ecdf8f7 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -175,7 +175,7 @@ test_data = {
         "guestiptype": 'Isolated',
         "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
         "traffictype": 'GUEST',
-        "isPersistent": 'True',
+        "ispersistent": 'True',
         "availability": 'Optional',
         "serviceProviderList": {
                 "Dhcp": 'VirtualRouter',
@@ -387,7 +387,7 @@ test_data = {
         "supportedservices":
         'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Firewall,Lb,UserData,StaticNat',
         "traffictype": 'GUEST',
-        "isPersistent": 'True',
+        "ispersistent": 'True',
         "availability": 'Optional',
         "serviceProviderList": {
                 "Vpn": 'VirtualRouter',
@@ -417,7 +417,7 @@ test_data = {
         "supportedservices":
         'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat',
         "traffictype": 'GUEST',
-        "isPersistent": 'True',
+        "ispersistent": 'True',
         "availability": 'Optional',
         "serviceProviderList": {
             "Dhcp": 'VirtualRouter',
@@ -440,7 +440,7 @@ test_data = {
         'Vpn,Dhcp,Dns,SourceNat,PortForwarding,UserData,StaticNat,NetworkACL',
         "traffictype": 'GUEST',
         "availability": 'Optional',
-        "isPersistent": 'True',
+        "ispersistent": 'True',
         "useVpc": 'on',
         "serviceProviderList": {
                 "Vpn": 'VpcVirtualRouter',


[12/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6612: Resolved issue with sshClient.py

(cherry picked from commit f2ebfe019e1ead6172712ec804b241cf0dc5a800)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/247377c4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/247377c4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/247377c4

Branch: refs/heads/4.4
Commit: 247377c4cf2e6e0b0d6c04f0b0eba2e6811ac6de
Parents: d560391
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Sun May 18 21:25:29 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:21 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/config/test_data.py | 2 +-
 tools/marvin/marvin/sshClient.py        | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/247377c4/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index ecdf8f7..2b820d6 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -479,7 +479,7 @@ test_data = {
     },
     "natrule": {
         "privateport": 22,
-        "publicport": 2222,
+        "publicport": 22,
         "protocol": "TCP"
     },
     "lbrule": {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/247377c4/tools/marvin/marvin/sshClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/sshClient.py b/tools/marvin/marvin/sshClient.py
index 611c8b5..e1c62c0 100644
--- a/tools/marvin/marvin/sshClient.py
+++ b/tools/marvin/marvin/sshClient.py
@@ -15,7 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import paramiko
 from paramiko import (BadHostKeyException,
                       AuthenticationException,
                       SSHException,
@@ -32,9 +31,8 @@ from marvin.cloudstackException import (
 import contextlib
 import logging
 from marvin.codes import (
-    SUCCESS, FAILED, INVALID_INPUT, EXCEPTION_OCCURRED
+    SUCCESS, FAILED, INVALID_INPUT
 )
-from contextlib import closing
 
 
 class SshClient(object):
@@ -152,9 +150,9 @@ class SshClient(object):
                     self.logger.\
                         exception("SshClient: Exception under "
                                   "createConnection: %s" % except_msg)
-                self.retryCnt = self.retryCnt - 1
+                self.retryCnt -= 1
                 time.sleep(self.delay)
-                return ret
+        return ret
 
     def runCommand(self, command):
         '''


[05/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6257: Adding function to check the VM state

(cherry picked from commit 6598167bedb1f00e9d1efc12b82999f8e822d5d6)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5e183321
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5e183321
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5e183321

Branch: refs/heads/4.4
Commit: 5e183321183d55a0b5eb27bba174f0e7c2c099e8
Parents: 7a2f3f2
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri May 2 13:54:50 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:16 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/codes.py    |  5 ++++
 tools/marvin/marvin/lib/base.py | 45 +++++++++++++++++++++++++++++++++++-
 2 files changed, 49 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e183321/tools/marvin/marvin/codes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py
index 28e907c..98299fa 100644
--- a/tools/marvin/marvin/codes.py
+++ b/tools/marvin/marvin/codes.py
@@ -31,6 +31,11 @@
 """
 
 RUNNING = "Running"
+STOPPED = "Stopped"
+STOPPING = "Stopping"
+STARTING = "Starting"
+DESTROYED = "Destroyed"
+EXPUNGING = "Expunging"
 RECURRING = "RECURRING"
 ENABLED = "Enabled"
 NETWORK_OFFERING = "network_offering"

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e183321/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index ca7fdc6..b70789f 100644
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -22,7 +22,9 @@
 import marvin
 from utils import is_server_ssh_ready, random_gen
 from marvin.cloudstackAPI import *
-from marvin.codes import FAILED, PASS
+from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED,
+                          STARTING, DESTROYED, EXPUNGING,
+                          STOPPING)
 from marvin.cloudstackException import GetDetailExceptionInfo
 from marvin.lib.utils import validateList
 # Import System modules
@@ -222,6 +224,16 @@ class User:
 class VirtualMachine:
     """Manage virtual machine lifecycle"""
 
+    '''Class level variables'''
+    # Variables denoting VM state - start
+    STOPPED = STOPPED
+    RUNNING = RUNNING
+    DESTROYED = DESTROYED
+    EXPUNGING = EXPUNGING
+    STOPPING = STOPPING
+    STARTING = STARTING
+    # Varibles denoting VM state - end
+
     def __init__(self, items, services):
         self.__dict__.update(items)
         if "username" in services:
@@ -471,6 +483,10 @@ class VirtualMachine:
         if forced:
             cmd.forced = forced
         apiclient.stopVirtualMachine(cmd)
+        response = self.getState(apiclient, VirtualMachine.STOPPED)
+        if response[0] == FAIL:
+            raise Exception(response[1])
+        return
 
     def reboot(self, apiclient):
         """Reboot the instance"""
@@ -522,6 +538,33 @@ class VirtualMachine:
                                                 )
         return self.ssh_client
 
+    def getState(self, apiclient, state, timeout=600):
+        """List VM and check if its state is as expected
+        @returnValue - List[Result, Reason]
+                       1) Result - FAIL if there is any exception
+                       in the operation or VM state does not change
+                       to expected state in given time else PASS
+                       2) Reason - Reason for failure"""
+
+        returnValue = [FAIL, "VM state not trasited to %s,\
+                        operation timed out" % state]
+
+        while timeout>0:
+            try:
+                vms = VirtualMachine.list(apiclient, id=self.id, listAll=True)
+                validationresult = validateList(vms)
+                if validationresult[0] == FAIL:
+                    raise Exception("VM list validation failed: %s" % validationresult[2])
+                elif str(vms[0].state).lower() == str(state).lower():
+                    returnValue = [PASS, None]
+                    break
+            except Exception as e:
+                returnValue = [FAIL, e]
+                break
+            time.sleep(60)
+            timeout -= 60
+        return returnValue
+
     def resetSshKey(self, apiclient, **kwargs):
         """Resets SSH key"""
 


[23/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6909 - fix marvin's handling of SMB credentials for storage

Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit 477a812a6f7aaab74122c11488713f417dfe4d89)
(cherry picked from commit 2498f65683bd529b2b03bac9a6cfd2fdbf65aca2)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2fdf789a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2fdf789a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2fdf789a

Branch: refs/heads/4.4
Commit: 2fdf789a28ce01571eabd5ccb8edfea72624ea3c
Parents: b848c02
Author: John Dilley <jo...@citrix.com>
Authored: Mon Jun 23 15:45:08 2014 +0000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:39 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/configGenerator.py  | 1 +
 tools/marvin/marvin/deployDataCenter.py | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fdf789a/tools/marvin/marvin/configGenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py
index 8b50d84..bc77153 100644
--- a/tools/marvin/marvin/configGenerator.py
+++ b/tools/marvin/marvin/configGenerator.py
@@ -215,6 +215,7 @@ class primaryStorage(object):
     def __init__(self):
         self.name = None
         self.url = None
+        self.details = None
 
 
 class secondaryStorage(object):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fdf789a/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 31f663e..9cbb95d 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -233,7 +233,9 @@ class DeployDataCenters(object):
                 return
             for primary in primaryStorages:
                 primarycmd = createStoragePool.createStoragePoolCmd()
-                primarycmd.details = primary.details
+                if primary.details:
+                    for key, value in vars(primary.details).iteritems():
+                        primarycmd.details.append({ key: value})
                 primarycmd.name = primary.name
                 primarycmd.podid = podId
                 primarycmd.tags = primary.tags
@@ -330,14 +332,13 @@ class DeployDataCenters(object):
                 secondarycmd.provider = secondary.provider
                 secondarycmd.details = []
 
-                if secondarycmd.provider == 'S3' \
-                        or secondarycmd.provider == "Swift":
+                if secondarycmd.provider.lower() in ('s3', "swift", "smb"):
                     for key, value in vars(secondary.details).iteritems():
                         secondarycmd.details.append({
                                                     'key': key,
                                                     'value': value
                                                     })
-                if secondarycmd.provider == "NFS":
+                if secondarycmd.provider.lower() in ("nfs", "smb"):
                     secondarycmd.zoneid = zoneId
                 ret = self.__apiClient.addImageStore(secondarycmd)
                 if ret.id:


[07/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixed few issues for userapiclient and port issue

Signed-off-by: santhosh <sa...@gmail.com>
Signed-off-by: Koushik Das <ko...@apache.org>
(cherry picked from commit 7734ece8f1455c6ad39546b4f204257223036716)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/acf70dad
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/acf70dad
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/acf70dad

Branch: refs/heads/4.4
Commit: acf70dad968e993669624003b823dc37f3fa183a
Parents: e8e8bed
Author: santhosh <sa...@gmail.com>
Authored: Thu May 8 16:30:33 2014 +1000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:18 2014 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/cloudstackTestClient.py | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/acf70dad/tools/marvin/marvin/cloudstackTestClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py
index 0e4837e..13d920e 100644
--- a/tools/marvin/marvin/cloudstackTestClient.py
+++ b/tools/marvin/marvin/cloudstackTestClient.py
@@ -124,7 +124,8 @@ class CSTestClient(object):
             '''
             Step1 : Create a CS Connection Object
             '''
-            self.__csConnection = CSConnection(self.__mgmtDetails,
+            mgmt_details = self.__mgmtDetails
+            self.__csConnection = CSConnection(mgmt_details,
                                                self.__asyncTimeOut,
                                                self.__logger)
 
@@ -137,7 +138,7 @@ class CSTestClient(object):
             Step3:  If API Key is not provided as part of Management Details,
                     then verify and register
             '''
-            if self.__mgmtDetails.apiKey is None:
+            if mgmt_details.apiKey is None:
                 list_user = listUsers.listUsersCmd()
                 list_user.account = "admin"
                 list_user_res = self.__apiClient.listUsers(list_user)
@@ -152,7 +153,6 @@ class CSTestClient(object):
                 if api_key is None:
                     ret = self.__getKeys(user_id)
                     if ret != FAILED:
-                        mgmt_details = self.__mgmtDetails
                         mgmt_details.apiKey = ret[0]
                         mgmt_details.securityKey = ret[1]
                     else:
@@ -309,7 +309,7 @@ class CSTestClient(object):
         try:
             if not self.isAdminContext():
                 return self.__apiClient
-
+            mgmt_details = self.__mgmtDetails
             listDomain = listDomains.listDomainsCmd()
             listDomain.listall = True
             listDomain.name = DomainName
@@ -353,21 +353,20 @@ class CSTestClient(object):
             if apiKey is None:
                 ret = self.__getKeys(userId)
                 if ret != FAILED:
-                    mgtDetails = self.__mgmtDetails
-                    mgtDetails.apiKey = ret[0]
-                    mgtDetails.securityKey = ret[1]
+                    mgmt_details.apiKey = ret[0]
+                    mgmt_details.securityKey = ret[1]
                 else:
                     self.__logger.error("__createUserApiClient: "
                                         "User API Client Creation."
                                         " While Registering User Failed")
                     return FAILED
             else:
-                mgtDetails = self.__mgmtDetails
-                mgtDetails.apiKey = apiKey
-                mgtDetails.securityKey = securityKey
+                mgmt_details.port = 8080
+                mgmt_details.apiKey = apiKey
+                mgmt_details.securityKey = securityKey
 
             newUserConnection =\
-                CSConnection(mgtDetails,
+                CSConnection(mgmt_details,
                              self.__csConnection.asyncTimeout,
                              self.__csConnection.logger)
             self.__userApiClient = CloudStackAPIClient(newUserConnection)


[22/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6943: Skip VM snapshot tests on KVM

(cherry picked from commit 9563db7a6d9d89558abc09e4ff786accfc0a9513)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b848c02a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b848c02a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b848c02a

Branch: refs/heads/4.4
Commit: b848c02aa7a3bf4384e664c7db5f66b2482e4e7d
Parents: 8c37e46
Author: Girish Shilamkar <gi...@clogeny.com>
Authored: Fri Jun 20 14:39:52 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:36 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_vm_snapshots.py | 26 +++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b848c02a/test/integration/smoke/test_vm_snapshots.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py
index e884d42..c324afa 100644
--- a/test/integration/smoke/test_vm_snapshots.py
+++ b/test/integration/smoke/test_vm_snapshots.py
@@ -16,19 +16,31 @@
 # under the License.
 
 # Import Local Modules
-from marvin.codes import FAILED
+from marvin.codes import FAILED, KVM
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackAPI import startVirtualMachine
+from marvin.lib.utils import random_gen, cleanup_resources
+from marvin.lib.base import (Account,
+                             ServiceOffering,
+                             VirtualMachine,
+                             VmSnapshot)
+from marvin.lib.common import (get_zone,
+                               get_domain,
+                               get_template,
+                               list_virtual_machines)
+import time
 
 class TestVmSnapshot(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-	testClient = super(TestVmSnapshot, cls).getClsTestClient()
+        testClient = super(TestVmSnapshot, cls).getClsTestClient()
+
+        hypervisor = testClient.getHypervisorInfo()
+        if hypervisor.lower() == KVM.lower():
+            raise unittest.SkipTest("VM snapshot feature is not supported on KVM")
+
         cls.apiclient = testClient.getApiClient()
         cls.services = testClient.getParsedTestDataConfig()
         # Get Zone, Domain and templates


[02/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-5674:Fixes for BVT and Regression test failures.
Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>

(cherry picked from commit dcd3ce5ce03eeb0675776622e757e6e638cb433d)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/04cac3f9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/04cac3f9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/04cac3f9

Branch: refs/heads/4.4
Commit: 04cac3f9bd1645cce102c9871c46108f894145db
Parents: 798a6aa
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Tue Apr 29 12:34:23 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:13 2014 +0200

----------------------------------------------------------------------
 .../component/test_dynamic_compute_offering.py  | 26 ++++++++++----------
 test/integration/smoke/test_nic.py              |  2 +-
 test/integration/smoke/test_privategw_acl.py    | 25 ++-----------------
 tools/marvin/marvin/config/test_data.py         | 20 ++++++++++++++-
 4 files changed, 35 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04cac3f9/test/integration/component/test_dynamic_compute_offering.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_dynamic_compute_offering.py b/test/integration/component/test_dynamic_compute_offering.py
index da43fdf..e6d0dbc 100644
--- a/test/integration/component/test_dynamic_compute_offering.py
+++ b/test/integration/component/test_dynamic_compute_offering.py
@@ -40,20 +40,20 @@ class TestDynamicServiceOffering(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
         testClient = super(TestDynamicServiceOffering, cls).getClsTestClient()
-        cls.apiclient = testClient.getApiClient()
+        cls.api_client = cls.apiclient = testClient.getApiClient()
         cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        domain = get_domain(cls.apiclient)
+        cls.domain = get_domain(cls.apiclient)
         cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
 
-        template = get_template(
+        cls.template = get_template(
             cls.apiclient,
             cls.zone.id,
             cls.services["ostype"]
         )
-        if template == FAILED:
+        if cls.template == FAILED:
             assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = cls.template.id
@@ -414,11 +414,11 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase):
         cls.api_client = cloudstackTestClient.getApiClient()
 
         # Fill services from the external config file
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.services = cloudstackTestClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests())
         cls.mode = str(cls.zone.networktype).lower()
         cls.template = get_template(
                             cls.api_client,
@@ -1058,11 +1058,11 @@ class TestAccountLimits(cloudstackTestCase):
         cls.api_client = cloudstackTestClient.getApiClient()
 
         # Fill services from the external config file
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.services = cloudstackTestClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests())
         cls.mode = str(cls.zone.networktype).lower()
         cls.template = get_template(
                             cls.api_client,
@@ -1335,11 +1335,11 @@ class TestAffinityGroup(cloudstackTestCase):
         cls.api_client = cloudstackTestClient.getApiClient()
 
         # Fill services from the external config file
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.services = cloudstackTestClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests())
         cls.mode = str(cls.zone.networktype).lower()
         cls.template = get_template(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04cac3f9/test/integration/smoke/test_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index e12bb33..3f91d70 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -119,7 +119,7 @@ class TestNic(cloudstackTestCase):
         except Exception as ex:
             self.debug("Exception during NIC test SETUP!: " + str(ex))
 
-    @attr(tags = ["devcloud",  "smoke", "basic", "sg", "provisioning"])
+    @attr(tags = ["devcloud",  "smoke", "advanced", "provisioning"])
     def test_01_nic(self):
         #TODO: SIMENH: add validation
         """Test to add and update added nic to a virtual machine"""

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04cac3f9/test/integration/smoke/test_privategw_acl.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py
index 8d20770..c86beb1 100644
--- a/test/integration/smoke/test_privategw_acl.py
+++ b/test/integration/smoke/test_privategw_acl.py
@@ -105,25 +105,7 @@ class TestPrivateGwACL(cloudstackTestCase):
         self.assertIsNotNone(createNetworkResponse.id, "Network failed to create")
         self.networkId = createNetworkResponse.id
 
-    def deployVm(self):
-        deployVirtualMachineCmd = deployVirtualMachine.deployVirtualMachineCmd()
-        deployVirtualMachineCmd.networkids = self.networkId
-        deployVirtualMachineCmd.serviceofferingid = self.serviceOfferingId
-        deployVirtualMachineCmd.zoneid = self.zoneId
-        deployVirtualMachineCmd.templateid = self.templateId
-        deployVirtualMachineCmd.hypervisor = "XenServer"
-        deployVMResponse = self.apiClient.deployVirtualMachine(deployVirtualMachineCmd)
-
-    def deployVm(self):
-        deployVirtualMachineCmd = deployVirtualMachine.deployVirtualMachineCmd()
-        deployVirtualMachineCmd.networkids = TestNetworkACL.networkId
-        deployVirtualMachineCmd.serviceofferingid = TestNetworkACL.serviceOfferingId
-        deployVirtualMachineCmd.zoneid = TestNetworkACL.zoneId
-        deployVirtualMachineCmd.templateid = TestNetworkACL.templateId
-        deployVirtualMachineCmd.hypervisor = "XenServer"
-        deployVMResponse = self.apiClient.deployVirtualMachine(deployVirtualMachineCmd)
-        TestNetworkACL.vmId = deployVMResponse.id
-        self.vmId = deployVMResponse.id
+
 
     def createPvtGw(self):
         createPrivateGatewayCmd = createPrivateGateway.createPrivateGatewayCmd()
@@ -146,7 +128,4 @@ class TestPrivateGwACL(cloudstackTestCase):
 
     def tearDown(self):
         #destroy the vm
-        if self.vmId is not None:
-            destroyVirtualMachineCmd = destroyVirtualMachine.destroyVirtualMachineCmd()
-            destroyVirtualMachineCmd.id = self.vmId
-            destroyVirtualMachineResponse = self.apiClient.destroyVirtualMachine(destroyVirtualMachineCmd)
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04cac3f9/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index 1a29ed9..8829f13 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -230,6 +230,20 @@ test_data = {
         "acltype": "Domain",
         "scope": "all"
     },
+    "shared_network_offering": {
+        "name": "MySharedOffering-shared",
+        "displaytext": "MySharedOffering",
+        "guestiptype": "Shared",
+        "supportedservices": "Dhcp,Dns,UserData",
+        "specifyVlan": "False",
+        "specifyIpRanges": "False",
+        "traffictype": "GUEST",
+        "serviceProviderList": {
+                "Dhcp": "VirtualRouter",
+            "Dns": "VirtualRouter",
+            "UserData": "VirtualRouter"
+            }
+    },
     "shared_network_offering_sg": {
         "name": "MySharedOffering-sg",
         "displaytext": "MySharedOffering-sg",
@@ -625,5 +639,9 @@ test_data = {
         "name": "Sparse",
         "provisioningtype": "sparse",
         "disksize": 1
-    }
+    },
+    "host_anti_affinity": {
+                    "name": "hostantiaffinity",
+                    "type": "host anti-affinity",
+                },
 }


[24/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-7022: Fixed typo

(cherry picked from commit 967b82f16b93bf1df4473b7ce8dd314f015098e8)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e33d4a57
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e33d4a57
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e33d4a57

Branch: refs/heads/4.4
Commit: e33d4a5732e81f590489f37b7fbcc947d2929de6
Parents: 2fdf789
Author: Ashutosh K <as...@clogeny.com>
Authored: Thu Jul 17 00:11:02 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:43 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_usage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e33d4a57/test/integration/component/test_usage.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py
index fb8e39e..5a4ada2 100644
--- a/test/integration/component/test_usage.py
+++ b/test/integration/component/test_usage.py
@@ -1464,7 +1464,7 @@ class TestVpnUsage(cloudstackTestCase):
                                             cls.api_client,
                                             cls.services["service_offering"]
                                             )
-        cls._cleanup.append(cls.sevice_offering)
+        cls._cleanup.append(cls.service_offering)
         cls.virtual_machine = VirtualMachine.create(
                                 cls.api_client,
                                 cls.services["server"],


[21/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6887: Fixing account cleanup issue across multiple test cases

(cherry picked from commit b849b7ee3d9b4a141c2eb3fd689d197ed20c4581)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8c37e468
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8c37e468
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8c37e468

Branch: refs/heads/4.4
Commit: 8c37e46807b92ac32c63cd36d33ca5d68bb75f30
Parents: 75d2a33
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri Jun 13 00:17:32 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:32 2014 +0200

----------------------------------------------------------------------
 .../component/test_add_remove_network.py        |   7 +-
 .../component/test_persistent_networks.py       | 214 +++++++++++--------
 test/integration/component/test_projects.py     |   1 +
 test/integration/component/test_snapshot_gc.py  |  77 +++----
 .../component/test_snapshot_limits.py           |   2 -
 test/integration/component/test_usage.py        |   7 +-
 test/integration/component/test_volumes.py      |   2 +
 test/integration/smoke/test_affinity_groups.py  |  14 +-
 8 files changed, 176 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index a4e8254..d916ba7 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -936,22 +936,25 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase):
         # Create Accounts & networks
         cls.services["isolated_network"]["zoneid"] = cls.zone.id
         cls.services["shared_network"]["zoneid"] = cls.zone.id
+        cls._cleanup = []
 
         cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id)
+        cls._cleanup.append(cls.account)
 
         cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"])
+        cls._cleanup.append(cls.service_offering)
 
         cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"],
                                                     accountid=cls.account.name,domainid=cls.account.domainid,
                                                     serviceofferingid=cls.service_offering.id,
                                                     mode=cls.zone.networktype)
         # Create Shared Network Offering
-        cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"],)
+        cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"])
+        cls._cleanup.append(cls.isolated_network_offering)
         # Enable Isolated Network offering
         cls.isolated_network_offering.update(cls.api_client, state='Enabled')
         cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name,
                                               cls.account.domainid,networkofferingid=cls.isolated_network_offering.id)
-        cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,]
         return
 
     def setUp(self):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_persistent_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py
index 4c1798f..ad2faef 100644
--- a/test/integration/component/test_persistent_networks.py
+++ b/test/integration/component/test_persistent_networks.py
@@ -1832,59 +1832,88 @@ class TestVPCNetworkOperations(cloudstackTestCase):
         # 3. Restart/delete VPC network
 
         # Validations
-        # 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state
-        # 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released
+        # 1. In case of Restart operation, restart should be successful
+        #    and persistent networks should be back in persistent state
+        # 2. In case of Delete operation, VR servicing the VPC should
+        #    get destroyed and sourceNAT ip should get released
 
-        child_domain = Domain.create(self.apiclient,services=self.services["domain"],
+        child_domain = Domain.create(self.apiclient,
+                                     services=self.services["domain"],
                                      parentdomainid=self.domain.id)
 
-        account_1 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id)
-        account_2 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id)
+        try:
+            account_1 = Account.create(
+                            self.apiclient,self.services["account"],
+                            domainid=child_domain.id
+                            )
+            account_2 = Account.create(
+                            self.apiclient,self.services["account"],
+                            domainid=child_domain.id
+                            )
 
-        self.services["vpc"]["cidr"] = "10.1.1.1/16"
-        vpc_1 = VPC.create(self.apiclient, self.services["vpc"],
+            self.services["vpc"]["cidr"] = "10.1.1.1/16"
+            vpc_1 = VPC.create(self.apiclient, self.services["vpc"],
                          vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
                          account=account_1.name, domainid=account_1.domainid)
-        vpcs = VPC.list(self.apiclient, id=vpc_1.id)
-        self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
+            vpcs = VPC.list(self.apiclient, id=vpc_1.id)
+            self.assertEqual(validateList(vpcs)[0], PASS,\
+                    "VPC list validation failed, vpc list is %s" % vpcs)
 
-        vpc_2 = VPC.create(self.apiclient, self.services["vpc"],
+            vpc_2 = VPC.create(self.apiclient, self.services["vpc"],
                          vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
                          account=account_2.name, domainid=account_2.domainid)
-        vpcs = VPC.list(self.apiclient, id=vpc_2.id)
-        self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
-
-        persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
-                                              networkofferingid=self.persistent_network_offering_NoLB.id,
-                                              accountid=account_1.name,domainid=account_1.domainid,
-                                              zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1", netmask="255.255.255.0")
-        response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
-        exceptionOccured = response[0]
-        isNetworkInDesiredState = response[1]
-        exceptionMessage = response[2]
-
-        if (exceptionOccured or (not isNetworkInDesiredState)):
-                self.fail(exceptionMessage)
-        self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
+            vpcs = VPC.list(self.apiclient, id=vpc_2.id)
+            self.assertEqual(validateList(vpcs)[0], PASS,\
+                    "VPC list validation failed, vpc list is %s" % vpcs)
+
+            persistent_network_1 = Network.create(
+                self.api_client,self.services["isolated_network"],
+                networkofferingid=self.persistent_network_offering_NoLB.id,
+                accountid=account_1.name,domainid=account_1.domainid,
+                zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1",
+                netmask="255.255.255.0")
+
+            response = verifyNetworkState(self.apiclient,
+                                          persistent_network_1.id,
+                                          "implemented"
+                                          )
+            exceptionOccured = response[0]
+            isNetworkInDesiredState = response[1]
+            exceptionMessage = response[2]
 
-        persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
-                                              networkofferingid=self.persistent_network_offering_NoLB.id,
-                                              accountid=account_2.name,domainid=account_2.domainid,
-                                              zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1", netmask="255.255.255.0")
-        response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
-        exceptionOccured = response[0]
-        isNetworkInDesiredState = response[1]
-        exceptionMessage = response[2]
+            if (exceptionOccured or (not isNetworkInDesiredState)):
+                raise Exception(exceptionMessage)
+            self.assertIsNotNone(
+                    persistent_network_1.vlan,\
+                    "vlan must not be null for persistent network %s" %\
+                    persistent_network_1.id)
+
+            persistent_network_2 = Network.create(
+                self.api_client,self.services["isolated_network"],
+                networkofferingid=self.persistent_network_offering_NoLB.id,
+                accountid=account_2.name,domainid=account_2.domainid,
+                zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1",
+                netmask="255.255.255.0")
+            response = verifyNetworkState(self.apiclient, persistent_network_2.id,
+                                          "implemented")
+            exceptionOccured = response[0]
+            isNetworkInDesiredState = response[1]
+            exceptionMessage = response[2]
 
-        if (exceptionOccured or (not isNetworkInDesiredState)):
-                self.fail(exceptionMessage)
-        self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
+            if (exceptionOccured or (not isNetworkInDesiredState)):
+                raise Exception(exceptionMessage)
+            self.assertIsNotNone(persistent_network_2.vlan,\
+                    "vlan must not be null for persistent network: %s" %\
+                    persistent_network_2.id)
 
-        # Force delete domain
-        try:
+            # Force delete domain
             child_domain.delete(self.apiclient, cleanup=True)
+
         except Exception as e:
-            self.fail("Failed to delete domain: %s" % e)
+            self.cleanup.append(account_1)
+            self.cleanup.append(account_2)
+            self.cleanup.append(child_domain)
+            self.fail(e)
 
         self.debug("Waiting for account.cleanup.interval" +
                 " to cleanup any remaining resouces")
@@ -1892,11 +1921,17 @@ class TestVPCNetworkOperations(cloudstackTestCase):
         wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3)
         self.VerifyDomainCleanup(child_domain.id)
 
-        with self.assertRaises(Exception) as e:
-            Account.list(self.apiclient,name=account_1.name, domainid=account_1.domainid,listall=True)
+        with self.assertRaises(Exception):
+            Account.list(
+                    self.apiclient,name=account_1.name,
+                    domainid=account_1.domainid,listall=True
+                    )
 
-        with self.assertRaises(Exception) as e:
-            Account.list(self.apiclient,name=account_2.name, domainid=account_2.domainid,listall=True)
+        with self.assertRaises(Exception):
+            Account.list(
+                    self.apiclient,name=account_2.name,
+                    domainid=account_2.domainid,listall=True
+                    )
 
         self.VerifyVpcCleanup(vpc_1.id)
         self.VerifyVpcCleanup(vpc_2.id)
@@ -1915,46 +1950,46 @@ class TestVPCNetworkOperations(cloudstackTestCase):
         # 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state
         # 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released
 
-        # Create Account
-        account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id)
+        try:
+            # Create Account
+            account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id)
 
-        # Create VPC
-        self.services["vpc"]["cidr"] = "10.1.1.1/16"
-        vpc = VPC.create(self.apiclient, self.services["vpc"],
+            # Create VPC
+            self.services["vpc"]["cidr"] = "10.1.1.1/16"
+            vpc = VPC.create(self.apiclient, self.services["vpc"],
                          vpcofferingid=self.vpc_off.id, zoneid=self.zone.id,
                          account=account.name, domainid=account.domainid)
-        vpcs = VPC.list(self.apiclient, id=vpc.id)
-        self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
+            vpcs = VPC.list(self.apiclient, id=vpc.id)
+            self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs)
 
-        # Create Persistent Networks as tiers of VPC
-        persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
+            # Create Persistent Networks as tiers of VPC
+            persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"],
                                               networkofferingid=self.persistent_network_offering_NoLB.id,
                                               accountid=account.name,domainid=account.domainid,
                                               zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0")
-        response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
-        exceptionOccured = response[0]
-        isNetworkInDesiredState = response[1]
-        exceptionMessage = response[2]
+            response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented")
+            exceptionOccured = response[0]
+            isNetworkInDesiredState = response[1]
+            exceptionMessage = response[2]
 
-        if (exceptionOccured or (not isNetworkInDesiredState)):
-                self.fail(exceptionMessage)
-        self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
+            if (exceptionOccured or (not isNetworkInDesiredState)):
+                raise Exception(exceptionMessage)
+            self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id)
 
-        persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
+            persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"],
                                               networkofferingid=self.persistent_network_offering_LB.id,
                                               accountid=account.name,domainid=account.domainid,
                                               zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0")
-        response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
-        exceptionOccured = response[0]
-        isNetworkInDesiredState = response[1]
-        exceptionMessage = response[2]
+            response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented")
+            exceptionOccured = response[0]
+            isNetworkInDesiredState = response[1]
+            exceptionMessage = response[2]
 
-        if (exceptionOccured or (not isNetworkInDesiredState)):
-                self.fail(exceptionMessage)
-        self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
+            if (exceptionOccured or (not isNetworkInDesiredState)):
+                raise Exception(exceptionMessage)
+            self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id)
 
-        # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2)
-        try:
+            # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2)
             virtual_machine_1 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"],
                                                     networkids=[persistent_network_1.id],serviceofferingid=self.service_offering.id,
                                                     accountid=account.name,domainid=self.domain.id)
@@ -1970,38 +2005,39 @@ class TestVPCNetworkOperations(cloudstackTestCase):
             virtual_machine_4 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"],
                                                     networkids=[persistent_network_2.id],serviceofferingid=self.service_offering.id,
                                                     accountid=account.name,domainid=self.domain.id)
-        except Exception as e:
-            self.fail("vm creation failed: %s" % e)
 
-        # Associate IP addresses to persistent networks
-        ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
-        ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
-        ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account)
+            # Associate IP addresses to persistent networks
+            ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
+            ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account)
+            ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account)
 
-        # Create NAT rule for VM 1
-        NATRule.create(self.api_client, virtual_machine_1,
+            # Create NAT rule for VM 1
+            NATRule.create(self.api_client, virtual_machine_1,
                        self.services["natrule"],ipaddressid=ipaddress_1.ipaddress.id,
                        networkid=persistent_network_1.id)
 
-        # Create Static NAT rule for VM 2
-        StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id,
+            # Create Static NAT rule for VM 2
+            StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id,
                               virtualmachineid=virtual_machine_2.id,
                               networkid=persistent_network_1.id)
 
-        # Create load balancer rule for ipaddress3 and assign to VM3 and VM4
-        lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"],
+            # Create load balancer rule for ipaddress3 and assign to VM3 and VM4
+            lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"],
                                           ipaddressid=ipaddress_3.ipaddress.id, accountid=account.name,
                                           networkid=persistent_network_2.id, domainid=account.domainid)
-        lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4])
+            lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4])
 
-        # Create network ACL for both ther persistent networks (tiers of VPC)
-        ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id)
-        ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id)
+            # Create network ACL for both ther persistent networks (tiers of VPC)
+            ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id)
+            ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id)
 
-        self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress)
-        self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress)
-        self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress)
-        self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress)
+            self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress)
+            self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress)
+            self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress)
+            self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress)
+        except Exception as e:
+            self.cleanup.append(account)
+            self.fail(e)
 
         # Delete account
         account.delete(self.apiclient)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index c593fb6..15c4d5e 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -1474,6 +1474,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
         cls._cleanup = [
                         cls.project,
                         cls.account,
+                        cls.user,
                         cls.disk_offering,
                         cls.service_offering
                         ]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_snapshot_gc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_snapshot_gc.py b/test/integration/component/test_snapshot_gc.py
index 42c361c..5c475af 100644
--- a/test/integration/component/test_snapshot_gc.py
+++ b/test/integration/component/test_snapshot_gc.py
@@ -16,13 +16,22 @@
 # under the License.
 
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from marvin.lib.utils import is_snapshot_on_nfs
-
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+#from marvin.cloudstackAPI import *
+from marvin.lib.utils import (
+                              is_snapshot_on_nfs,
+                              cleanup_resources)
+from marvin.lib.base import (Account,
+                             Snapshot,
+                             ServiceOffering,
+                             VirtualMachine)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template,
+                               list_volumes,
+                               list_accounts,
+                               list_snapshots,
+                               wait_for_cleanup)
 
 class Services:
     """Test Snapshots Services
@@ -177,7 +186,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
             volume = volumes[0]
 
             # Create a snapshot from the ROOTDISK
-            cls.snapshot = Snapshot.create(cls.api_client, volumes[0].id)
+            cls.snapshot = Snapshot.create(cls.api_client, volume.id)
         except Exception, e:
             cls.tearDownClass()
             unittest.SkipTest("setupClass fails for %s" % cls.__name__)
@@ -223,70 +232,50 @@ class TestAccountSnapshotClean(cloudstackTestCase):
         #    b) snapshot image($snapshot_id) should be deleted from the
         #       /secondary/snapshots/$accountid/$volumeid/
 
-        accounts = list_accounts(
+        try:
+            accounts = list_accounts(
                                  self.apiclient,
                                  id=self.account.id
                                  )
-        self.assertEqual(
+            self.assertEqual(
                             isinstance(accounts, list),
                             True,
                             "Check list response returns a valid list"
                         )
-        self.assertNotEqual(
+            self.assertNotEqual(
                              len(accounts),
                              0,
                              "Check list Accounts response"
                              )
 
-        # VM should be in 'Running' state
-        virtual_machines = list_virtual_machines(
-                                self.apiclient,
-                                id=self.virtual_machine.id
-                                )
-        self.assertEqual(
-                            isinstance(virtual_machines, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertNotEqual(
-                             len(virtual_machines),
-                             0,
-                             "Check list virtual machines response"
-                             )
-        for virtual_machine in virtual_machines:
-            self.debug("VM ID: %s, VM state: %s" % (
-                                            virtual_machine.id,
-                                            virtual_machine.state
-                                            ))
-            self.assertEqual(
-                        virtual_machine.state,
-                        'Running',
-                        "Check list VM response for Running state"
-                    )
-
-        # Verify the snapshot was created or not
-        snapshots = list_snapshots(
+            # Verify the snapshot was created or not
+            snapshots = list_snapshots(
                                    self.apiclient,
                                    id=self.snapshot.id
                                    )
-        self.assertEqual(
+            self.assertEqual(
                             isinstance(snapshots, list),
                             True,
                             "Check list response returns a valid list"
                         )
-        self.assertNotEqual(
+            self.assertNotEqual(
                             snapshots,
                             None,
                             "No such snapshot %s found" % self.snapshot.id
                             )
-        self.assertEqual(
+            self.assertEqual(
                             snapshots[0].id,
                             self.snapshot.id,
                             "Check snapshot id in list resources call"
                         )
 
-        self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id),
-            "Snapshot was not found on NFS")
+            self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id),
+                "Snapshot was not found on NFS")
+
+            raise Exception("self raised exception")
+        except Exception as e:
+            self._cleanup.append(self.account)
+            self.fail("Exception occured: %s" % e)
 
         self.debug("Deleting account: %s" % self.account.name)
         # Delete account

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_snapshot_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py
index 95c6432..a7da0db 100644
--- a/test/integration/component/test_snapshot_limits.py
+++ b/test/integration/component/test_snapshot_limits.py
@@ -173,8 +173,6 @@ class TestSnapshotLimit(cloudstackTestCase):
             cls.tearDownClass()
             unittest.SkipTest("setupClass fails for %s" % cls.__name__)
             raise e
-        else:
-            cls._cleanup.remove(cls.account)
         return
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_usage.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py
index eb92011..fb8e39e 100644
--- a/test/integration/component/test_usage.py
+++ b/test/integration/component/test_usage.py
@@ -1447,6 +1447,7 @@ class TestVpnUsage(cloudstackTestCase):
         cls.services["server"]["zoneid"] = cls.zone.id
 
         cls.services["template"] = template.id
+        cls._cleanup = []
 
         # Create Service offerings, VMs etc
         cls.account = Account.create(
@@ -1455,6 +1456,7 @@ class TestVpnUsage(cloudstackTestCase):
                             admin=True,
                             domainid=cls.domain.id
                             )
+        cls._cleanup.append(cls.account)
 
         cls.services["account"] = cls.account.name
 
@@ -1462,6 +1464,7 @@ class TestVpnUsage(cloudstackTestCase):
                                             cls.api_client,
                                             cls.services["service_offering"]
                                             )
+        cls._cleanup.append(cls.sevice_offering)
         cls.virtual_machine = VirtualMachine.create(
                                 cls.api_client,
                                 cls.services["server"],
@@ -1477,10 +1480,6 @@ class TestVpnUsage(cloudstackTestCase):
                                            domainid=cls.virtual_machine.domainid,
                                            services=cls.services["server"]
                                            )
-        cls._cleanup = [
-                        cls.service_offering,
-                        cls.account,
-                        ]
         return
 
     @classmethod

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index a310472..c3afb7a 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -1100,6 +1100,7 @@ class TestVolumes(cloudstackTestCase):
             name="NROOT",
             parentdomainid=self.domain.id
         )
+        self.cleanup.append(dom)
         self.assertTrue(dom is not None, msg="Domain creation failed")
 
         domuser = Account.create(
@@ -1108,6 +1109,7 @@ class TestVolumes(cloudstackTestCase):
             admin=False,
             domainid=dom.id
         )
+        self.cleanup.insert(-2, domuser)
         self.assertTrue(domuser is not None)
 
         domapiclient = self.testClient.getUserApiClient(UserName=domuser.name, DomainName=dom.name)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c37e468/test/integration/smoke/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py
index 4f3f9ec..bb0a524 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -152,10 +152,10 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
             msg="Both VMs of affinity group %s are on the same host" % self.ag.name)
 
 
-        @classmethod
-        def tearDownClass(cls):
-            try:
-                #Clean up, terminate the created templates
-                cleanup_resources(cls.apiclient, cls._cleanup)
-            except Exception as e:
-                raise Exception("Warning: Exception during cleanup : %s" % e)
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            #Clean up, terminate the created templates
+            cleanup_resources(cls.apiclient, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)


[09/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
CLOUDSTACK-6627 catch exception instead of checking response

Signed-off-by: santhosh <sa...@gmail.com>
Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit afd9d4e7567007604e15761a33ce9314149f7e21)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1b998602
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1b998602
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1b998602

Branch: refs/heads/4.4
Commit: 1b998602ece15279f04732e58d547e23c8b80e3e
Parents: 38ef939
Author: santhosh <sa...@gmail.com>
Authored: Mon May 12 20:57:52 2014 +1000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:19 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_pvlan.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1b998602/test/integration/smoke/test_pvlan.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py
index a1c146b..9178e62 100644
--- a/test/integration/smoke/test_pvlan.py
+++ b/test/integration/smoke/test_pvlan.py
@@ -81,5 +81,5 @@ class TestPVLAN(cloudstackTestCase):
         createNetworkCmd.startipv6="fc00:1234::10"
         createNetworkCmd.endipv6="fc00:1234::20"
         err = 0
-        createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
-        self.assertEqual(createNetworkResponse, FAILED, "Creating PVLAN with IPv6 should fail")
+        with self.assertRaises(Exception):
+            self.apiClient.createNetwork(createNetworkCmd)


[14/24] git commit: updated refs/heads/4.4 to e33d4a5

Posted by da...@apache.org.
Fixed Regression issues mentioned under CLOUDSTACK-6708

Signed-off-by: santhosh <sa...@gmail.com>
(cherry picked from commit c7f5077ab18031e5601eb04f1ff7010b214861fe)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/26f39952
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/26f39952
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/26f39952

Branch: refs/heads/4.4
Commit: 26f39952f3ff93075ad4bcdda0de52701feb215c
Parents: b0f446c
Author: santhosh <sa...@gmail.com>
Authored: Wed May 21 00:22:17 2014 +1000
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 17:43:23 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vm.py     |  5 +--
 test/integration/smoke/test_hosts.py         | 25 ++++++------
 test/integration/smoke/test_network.py       | 26 +++++--------
 test/integration/smoke/test_routers.py       | 46 +++++++++--------------
 test/integration/smoke/test_vm_life_cycle.py |  8 ++--
 5 files changed, 47 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26f39952/test/integration/smoke/test_deploy_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py
index 5a2695d..e7e0dc4 100644
--- a/test/integration/smoke/test_deploy_vm.py
+++ b/test/integration/smoke/test_deploy_vm.py
@@ -42,7 +42,6 @@ class TestDeployVM(cloudstackTestCase):
         self.apiclient = self.testClient.getApiClient()
 
         self.testdata = self.testClient.getParsedTestDataConfig()
-        
         # Get Zone, Domain and Default Built-in template
         self.domain = get_domain(self.apiclient)
         self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
@@ -116,7 +115,7 @@ class TestDeployVM(cloudstackTestCase):
         """Test Multiple Deploy Virtual Machine
 
         # Validate the following:
-        # 1. deploy 2 virtual machines 
+        # 1. deploy 2 virtual machines
         # 2. listVirtualMachines using 'ids' parameter returns accurate information
         """
         self.virtual_machine = VirtualMachine.create(
@@ -206,7 +205,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
             self.mock_volume_failure
         ]
 
-    @attr(tags = ['selfservice'])
+    @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708")
     def test_deploy_vm_volume_creation_failure(self):
         """Test Deploy Virtual Machine - volume creation failure and retry
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26f39952/test/integration/smoke/test_hosts.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py
index 52827aa..7798c8e 100644
--- a/test/integration/smoke/test_hosts.py
+++ b/test/integration/smoke/test_hosts.py
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,6 +23,7 @@ from marvin.cloudstackAPI import *
 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 System modules
@@ -66,21 +67,22 @@ class TestHosts(cloudstackTestCase):
         #Create clusters with Hypervisor type Simulator/XEN/KVM/VWare
         """
         for k, v in self.services["clusters"].items():
+            v["clustername"] = v["clustername"] + "-" + random_gen()
             cluster = Cluster.create(
                                      self.apiclient,
                                      v,
                                      zoneid=self.zone.id,
                                      podid=self.pod.id,
-                                     hypervisor=self.hypervisor
+                                     hypervisor=v["hypervisor"].lower()
                                      )
             self.debug(
                 "Created Cluster for hypervisor type %s & ID: %s" %(
                                                                     v["hypervisor"],
-                                                                    cluster.id     
+                                                                    cluster.id
                                                                     ))
             self.assertEqual(
-                    cluster.hypervisortype,
-                    v["hypervisor"],
+                    cluster.hypervisortype.lower(),
+                    v["hypervisor"].lower(),
                     "Check hypervisor type is " + v["hypervisor"] + " or not"
                     )
             self.assertEqual(
@@ -103,7 +105,7 @@ class TestHosts(cloudstackTestCase):
                                self.services["hosts"][hypervisor_type],
                                zoneid=self.zone.id,
                                podid=self.pod.id,
-                               hypervisor=self.hypervisor
+                               hypervisor=v["hypervisor"].lower()
                                )
                 if host == FAILED:
                     self.fail("Host Creation Failed")
@@ -112,9 +114,8 @@ class TestHosts(cloudstackTestCase):
                                                                 host.id,
                                                                 cluster.id
                                                                 ))
-
-            #Cleanup Host & Cluster
-            self.cleanup.append(host)
+                #Cleanup Host & Cluster
+                self.cleanup.append(host)
             self.cleanup.append(cluster)
 
             list_hosts_response = list_hosts(
@@ -162,8 +163,8 @@ class TestHosts(cloudstackTestCase):
                             "Check cluster ID with list clusters response"
                         )
             self.assertEqual(
-                cluster_response.hypervisortype,
-                cluster.hypervisortype,
+                cluster_response.hypervisortype.lower(),
+                cluster.hypervisortype.lower(),
                 "Check hypervisor type with is " + v["hypervisor"] + " or not"
                 )
         return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26f39952/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index a9e0c25..838f4a3 100644
--- a/test/integration/smoke/test_network.py
+++ b/test/integration/smoke/test_network.py
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -159,16 +159,10 @@ class TestPublicIP(cloudstackTestCase):
                                               self.apiclient,
                                               id=ip_address.ipaddress.id
                                               )
-        self.assertEqual(
-                            isinstance(list_pub_ip_addr_resp, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertEqual(
-                            len(list_pub_ip_addr_resp),
-                            0,
-                            "Check if the list public ip api response is not zero"
-                            )
+        if list_pub_ip_addr_resp is None:
+            return
+        if (list_pub_ip_addr_resp) and (isinstance(list_pub_ip_addr_resp, list)) and (len(list_pub_ip_addr_resp) > 0):
+            self.fail("list public ip response is not empty")
         return
 
     @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"])
@@ -327,7 +321,7 @@ class TestPortForwarding(cloudstackTestCase):
                             'Running',
                             "VM state should be Running before creating a NAT rule."
                         )
-        # Open up firewall port for SSH        
+        # Open up firewall port for SSH
         fw_rule = FireWallRule.create(
                             self.apiclient,
                             ipaddressid=src_nat_ip_addr.id,
@@ -380,7 +374,7 @@ class TestPortForwarding(cloudstackTestCase):
                                            )
             if vm_response[0].state != 'Running':
                 self.fail("State of VM : %s is not found to be Running" % str(self.virtual_machine.ipaddress))
- 
+
         except Exception as e:
             self.fail(
                       "SSH Access failed for %s: %s" % \
@@ -449,7 +443,7 @@ class TestPortForwarding(cloudstackTestCase):
                             'Running',
                             "VM state should be Running before creating a NAT rule."
                         )
-        # Open up firewall port for SSH        
+        # Open up firewall port for SSH
         fw_rule = FireWallRule.create(
                             self.apiclient,
                             ipaddressid=ip_address.ipaddress.id,
@@ -785,7 +779,7 @@ class TestReleaseIP(cloudstackTestCase):
 
         self.ip_address.delete(self.apiclient)
 
-        # Sleep to ensure that deleted state is reflected in other calls 
+        # Sleep to ensure that deleted state is reflected in other calls
         time.sleep(self.services["sleep"])
 
         # ListPublicIpAddresses should not list deleted Public IP address

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26f39952/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index 2aa83c3..1c8e747 100644
--- a/test/integration/smoke/test_routers.py
+++ b/test/integration/smoke/test_routers.py
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -183,9 +183,6 @@ class TestRouterServices(cloudstackTestCase):
         return
 
 
-
-
-
     @attr(tags = ["advanced", "smoke", "provisioning"])
     def test_02_router_internal_adv(self):
         """Test router internal advanced zone
@@ -206,7 +203,6 @@ class TestRouterServices(cloudstackTestCase):
                             True,
                             "Check list response returns a valid list"
                         )
-        
         router = list_router_response[0]
 
         hosts = list_hosts(
@@ -255,7 +251,6 @@ class TestRouterServices(cloudstackTestCase):
                 self.skipTest("Marvin configuration has no host credentials to check router services")
         res = str(result)
         self.debug("Dnsmasq process status: %s" % res)
-        
         self.assertEqual(
                             res.count("running"),
                             1,
@@ -464,7 +459,6 @@ class TestRouterServices(cloudstackTestCase):
                                 )
             except KeyError:
                 self.skipTest("Marvin configuration has no host credentials to check router services")
-        
         # res = 12:37:14 up 1 min,  0 users,  load average: 0.61, 0.22, 0.08
         # Split result to check the uptime
         result = res[0].split()
@@ -656,7 +650,6 @@ class TestRouterServices(cloudstackTestCase):
                             "Check list response returns a valid list"
                         )
         router = list_router_response[0]
-        
         self.debug("Stopping the router with ID: %s" % router.id)
         #Stop the router
         cmd = stopRouter.stopRouterCmd()
@@ -726,6 +719,13 @@ class TestRouterServices(cloudstackTestCase):
                         )
         return
 
+    def verifyRouterResponse(self,router_response,ip):
+            if (router_response) and (isinstance(router_response, list)) and \
+               (router_response[0].state == "Running") and \
+               (router_response[0].publicip == ip):
+               return True
+            return False
+
     @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"])
     def test_09_reboot_router(self):
         """Test reboot router
@@ -749,32 +749,22 @@ class TestRouterServices(cloudstackTestCase):
         public_ip = router.publicip
 
         self.debug("Rebooting the router with ID: %s" % router.id)
-        
         #Reboot the router
         cmd = rebootRouter.rebootRouterCmd()
         cmd.id = router.id
         self.apiclient.rebootRouter(cmd)
 
         #List routers to check state of router
-        router_response = list_routers(
+        retries_cnt = 6
+        while retries_cnt >= 0:
+            router_response = list_routers(
                                     self.apiclient,
                                     id=router.id
                                     )
-        self.assertEqual(
-                            isinstance(router_response, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        #List router should have router in running state and same public IP
-        self.assertEqual(
-                            router_response[0].state,
-                            'Running',
-                            "Check list router response for router state"
-                        )
-
-        self.assertEqual(
-                            router_response[0].publicip,
-                            public_ip,
-                            "Check list router response for router public IP"
-                        )
+            if self.verifyRouterResponse(router_response,public_ip):
+                self.debug("Router is running successfully after reboot")
+                return
+            time.sleep(10)
+            retries_cnt = retries_cnt - 1
+        self.fail("Router response after reboot is either is invalid or in stopped state")
         return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26f39952/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py
index f114ec9..2219d08 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -507,14 +507,14 @@ class TestVMLifeCycle(cloudstackTestCase):
         # For XenServer and VMware, migration is possible between hosts belonging to different clusters
         # with the help of XenMotion and Vmotion respectively.
 
-        if hypervisor == "kvm":
+        if hypervisor.lower() in ["kvm","simulator"]:
             #identify suitable host
             clusters = [h.clusterid for h in hosts]
             #find hosts withe same clusterid
             clusters = [cluster for index, cluster in enumerate(clusters) if clusters.count(cluster) > 1]
 
             if len(clusters) <= 1:
-                self.skipTest("In KVM, Live Migration needs two hosts within same cluster")
+                self.skipTest("In " + hypervisor.lower() + " Live Migration needs two hosts within same cluster")
 
             suitable_hosts = [host for host in hosts if host.clusterid == clusters[0]]
         else:
@@ -567,7 +567,7 @@ class TestVMLifeCycle(cloudstackTestCase):
 
     @attr(configuration = "expunge.interval")
     @attr(configuration = "expunge.delay")
-    @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"])
+    @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"],BugId="CLOUDSTACK-6708")
     def test_09_expunge_vm(self):
         """Test destroy(expunge) Virtual Machine
         """
@@ -595,7 +595,7 @@ class TestVMLifeCycle(cloudstackTestCase):
                                      name='expunge.interval'
                                      )
         expunge_cycle = int(config[0].value)
-        wait_time = expunge_cycle * 2
+        wait_time = expunge_cycle * 4
         while wait_time >= 0:
             list_vm_response = list_virtual_machines(
                                                 self.apiclient,