You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2014/05/20 17:51:06 UTC

git commit: updated refs/heads/4.4-forward to c7f5077

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 02f769c4d -> c7f5077ab


Fixed Regression issues mentioned under CLOUDSTACK-6708

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


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

Branch: refs/heads/4.4-forward
Commit: c7f5077ab18031e5601eb04f1ff7010b214861fe
Parents: 02f769c
Author: santhosh <sa...@gmail.com>
Authored: Wed May 21 00:22:17 2014 +1000
Committer: Jayapal <ja...@apache.org>
Committed: Tue May 20 21:20:35 2014 +0530

----------------------------------------------------------------------
 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/c7f5077a/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 473b020..db26980 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/c7f5077a/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/c7f5077a/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index b82501c..7cd3973 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", "selfservice"])
@@ -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" % \
@@ -452,7 +446,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,
@@ -789,7 +783,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/c7f5077a/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index f77a051..d503af1 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
@@ -184,9 +184,6 @@ class TestRouterServices(cloudstackTestCase):
         return
 
 
-
-
-
     @attr(tags = ["advanced", "smoke", "provisioning"])
     def test_02_router_internal_adv(self):
         """Test router internal advanced zone
@@ -208,7 +205,6 @@ class TestRouterServices(cloudstackTestCase):
                             True,
                             "Check list response returns a valid list"
                         )
-        
         router = list_router_response[0]
 
         hosts = list_hosts(
@@ -257,7 +253,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,
@@ -469,7 +464,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()
@@ -664,7 +658,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()
@@ -737,6 +730,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
@@ -761,33 +761,23 @@ 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,
                                     listall=True
                                     )
-        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/c7f5077a/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 fea3dde..85033c5 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:
@@ -558,7 +558,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
         """
@@ -586,7 +586,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,