cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [34/44] git commit: updated refs/heads/vpc-toolkit-hugo to 1ad1883
Date Mon, 14 Jul 2014 13:37:38 GMT
Fixed Regression issues mentioned under CLOUDSTACK-6708

Signed-off-by: santhosh <santhosh.edukulla@gmail.com>

Conflicts:

	test/integration/smoke/test_deploy_vm.py
	test/integration/smoke/test_network.py
	test/integration/smoke/test_routers.py
	test/integration/smoke/test_vm_life_cycle.py


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

Branch: refs/heads/vpc-toolkit-hugo
Commit: aab6e1222fc75a37f8015ba1d2c7bc923c1cf614
Parents: 00778de
Author: santhosh <santhosh.edukulla@gmail.com>
Authored: Wed May 21 00:22:17 2014 +1000
Committer: Girish Shilamkar <girish@clogeny.com>
Committed: Fri Jul 11 20:49:00 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aab6e122/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 0750287..0810752 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())
@@ -117,7 +116,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(
@@ -207,6 +206,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
             self.mock_volume_failure
         ]
 
+
     @attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false")
     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/aab6e122/test/integration/smoke/test_hosts.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py
index 02c4ef1..952f160 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/aab6e122/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index 397d43b..08ec0d3 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
@@ -160,16 +160,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"], required_hardware="false")
@@ -328,7 +322,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,
@@ -381,7 +375,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" % \
@@ -451,7 +445,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,
@@ -790,7 +784,6 @@ class TestReleaseIP(cloudstackTestCase):
 
         retriesCount = 10
         isIpAddressDisassociated = False
-
         while retriesCount > 0:
             listResponse = list_publicIP(
                                     self.apiclient,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aab6e122/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index f5cc9a5..f77d11a 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,6 +183,7 @@ class TestRouterServices(cloudstackTestCase):
         return
 
 
+
     @attr(tags = ["advanced", "advancedns"], required_hardware="false")
     def test_02_router_internal_adv(self):
         """Test router internal advanced zone
@@ -203,7 +204,6 @@ class TestRouterServices(cloudstackTestCase):
                             True,
                             "Check list response returns a valid list"
                         )
-        
         router = list_router_response[0]
 
         hosts = list_hosts(
@@ -252,7 +252,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,
@@ -461,7 +460,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()
@@ -653,7 +651,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()
@@ -723,6 +720,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"], required_hardware="false")
     def test_09_reboot_router(self):
         """Test reboot router
@@ -746,32 +750,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/aab6e122/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 a787d86..1386830 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -498,14 +498,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:
@@ -548,7 +548,7 @@ class TestVMLifeCycle(cloudstackTestCase):
 
     @attr(configuration = "expunge.interval")
     @attr(configuration = "expunge.delay")
-    @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
+    @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"],BugId="CLOUDSTACK-6708",
required_hardware="false")
     def test_09_expunge_vm(self):
         """Test destroy(expunge) Virtual Machine
         """
@@ -576,7 +576,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 = VirtualMachine.list(
                                                 self.apiclient,


Mime
View raw message