cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/4.2 to a329223
Date Fri, 02 Aug 2013 01:00:06 GMT
Updated Branches:
  refs/heads/4.2 1294a13f4 -> a3292231d


Automation: Reconnect the ssh for test_vpc_vm_life_cycle.py

Since VM are reused for test cases, we need to reconnect the SSH client to avoid
error like:

Failed to SSH into VM, SSH session not active


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

Branch: refs/heads/4.2
Commit: a3292231ddddffe2c564d1318b111d40a4168138
Parents: 1294a13
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu Aug 1 17:29:35 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Thu Aug 1 18:00:00 2013 -0700

----------------------------------------------------------------------
 .../component/test_vpc_vm_life_cycle.py         | 51 +++++++++++++++-----
 1 file changed, 39 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3292231/test/integration/component/test_vpc_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py
index ed86ae3..3531aff 100644
--- a/test/integration/component/test_vpc_vm_life_cycle.py
+++ b/test/integration/component/test_vpc_vm_life_cycle.py
@@ -27,6 +27,8 @@ from marvin.integration.lib.base import *
 from marvin.integration.lib.common import *
 from marvin.remoteSSHClient import remoteSSHClient
 
+import time
+
 class Services:
     """Test VM life cycle in VPC network services
     """
@@ -426,7 +428,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
             self.debug("Checking if we can SSH into VM_1 through %s?" %
                     (self.public_ip_1.ipaddress.ipaddress))
             ssh_1 = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -452,7 +455,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
                 (self.public_ip_2.ipaddress.ipaddress))
         try:
             ssh_2 = self.vm_1.get_ssh_client(
-                            ipaddress=self.public_ip_2.ipaddress.ipaddress)
+                            ipaddress=self.public_ip_2.ipaddress.ipaddress,
+                            reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -563,6 +567,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
             self.vm_2.start(self.apiclient)
         except Exception as e:
             self.fail("Failed to start the virtual instances, %s" % e)
+        # Wait until vms are up
+        time.sleep(120)
         self.debug("Validating if the network rules work properly or not?")
         self.validate_network_rules()
         return
@@ -590,6 +596,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to reboot the virtual instances, %s" % e)
 
+        # Wait until vms are up
+        time.sleep(120)
         self.debug("Validating if the network rules work properly or not?")
         self.validate_network_rules()
         return
@@ -666,6 +674,9 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to start the instances, %s" % e)
 
+        # Wait until vms are up
+        time.sleep(120)
+
         self.debug("Validating if the network rules work properly or not?")
         self.validate_network_rules()
         return
@@ -736,7 +747,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")
@@ -790,7 +802,8 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")
@@ -1151,8 +1164,11 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
         """Validating if the network rules (PF/LB) works properly or not?"""
 
         try:
+            self.debug("Checking if we can SSH into VM_1 through %s?" %
+                    (self.public_ip_1.ipaddress.ipaddress))
             ssh_1 = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -1515,7 +1531,8 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")
@@ -1569,7 +1586,8 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")
@@ -1860,8 +1878,11 @@ class TestVMLifeCycleBothIsolated(cloudstackTestCase):
         """Validating if the network rules (PF/LB) works properly or not?"""
 
         try:
+            self.debug("Checking if we can SSH into VM_1 through %s?" %
+                    (self.public_ip_1.ipaddress.ipaddress))
             ssh_1 = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -2285,8 +2306,11 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
     def validate_network_rules(self):
         """Validates if the network rules work properly or not?"""
         try:
+            self.debug("Checking if we can SSH into VM_1 through %s?" %
+                    (self.public_ip_1.ipaddress.ipaddress))
             ssh_1 = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -2311,7 +2335,8 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
         self.debug("Checking if we can SSH into VM_1?")
         try:
             ssh_2 = self.vm_1.get_ssh_client(
-                            ipaddress=self.public_ip_2.ipaddress.ipaddress)
+                            ipaddress=self.public_ip_2.ipaddress.ipaddress,
+                            reconnect=True)
             self.debug("SSH into VM is successfully")
 
             self.debug("Verifying if we can ping to outside world from VM?")
@@ -2595,7 +2620,8 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")
@@ -2649,7 +2675,8 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
 
         try:
             ssh = self.vm_1.get_ssh_client(
-                                ipaddress=self.public_ip_1.ipaddress.ipaddress)
+                                ipaddress=self.public_ip_1.ipaddress.ipaddress,
+                                reconnect=True)
             self.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into instance")


Mime
View raw message