cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [1/2] git commit: updated refs/heads/4.2 to 1e64df8
Date Wed, 24 Jul 2013 12:35:07 GMT
Updated Branches:
  refs/heads/4.2 58b981bd0 -> 1e64df854


CLOUDSTACK-3698: Ensure VM is accessible before stopping VR

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 368f32fa2510cf07492eceab277c9913f8032ae4)


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

Branch: refs/heads/4.2
Commit: 26044101b6ecdf20263aa40fd2d2fd4d0dc0eb07
Parents: 58b981b
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Wed Jul 24 18:03:27 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed Jul 24 18:04:49 2013 +0530

----------------------------------------------------------------------
 .../component/test_vpc_network_pfrules.py       | 28 +++++++++++---------
 1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26044101/test/integration/component/test_vpc_network_pfrules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network_pfrules.py b/test/integration/component/test_vpc_network_pfrules.py
index d9a045c..1e1b5cc 100644
--- a/test/integration/component/test_vpc_network_pfrules.py
+++ b/test/integration/component/test_vpc_network_pfrules.py
@@ -171,7 +171,6 @@ class Services:
                 "protocol": 'TCP',
             },
             "ostype": 'CentOS 5.3 (64-bit)',
-            "sleep": 60,
             "timeout": 10,
         }
 
@@ -212,8 +211,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
             #Cleanup resources used
             cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
-            print("Warning: Exception during cleanup : %s" % e)
-            #raise Exception("Warning: Exception during cleanup : %s" % e)
+            raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
 
@@ -225,14 +223,13 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
                                                 admin=True,
                                                 domainid=self.domain.id
                                                 )
-        self._cleanup = [self.account]
+        self.cleanup = [self.account]
         self.debug("Creating a VPC offering..")
         self.vpc_off = VpcOffering.create(
                                                 self.apiclient,
                                                 self.services["vpc_offering"]
                                                 )
 
-        self._cleanup.append(self.vpc_off)
         self.debug("Enabling the VPC offering created")
         self.vpc_off.update(self.apiclient, state='Enabled')
 
@@ -251,10 +248,9 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
     def tearDown(self):
         try:
             #Clean up, terminate the created network offerings
-            cleanup_resources(self.apiclient, self._cleanup)
+            cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             self.debug("Warning: Exception during cleanup : %s" % e)
-            #raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
     def get_vpcrouter(self):
@@ -364,7 +360,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
                                                     public_ip.ipaddress.ipaddress, e))
 
     def create_natrule(self, vm, public_ip, network, services=None):
-        self.debug("Creatinng NAT rule in network for vm with public IP")
+        self.debug("Creating NAT rule in network for vm with public IP")
         if not services:
             services = self.services["natrule"]
         nat_rule = NATRule.create(self.apiclient,
@@ -391,7 +387,7 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
                                         accountid=self.account.name,
                                         zoneid=self.zone.id,
                                         domainid=self.account.domainid,
-                                        networkid=None, #network.id,
+                                        networkid=network.id,
                                         vpcid=self.vpc.id
                                         )
         self.debug("Associated %s with network %s" % (public_ip.ipaddress.ipaddress,
@@ -449,8 +445,8 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
                                                 )
                 self.debug("Created network with ID: %s" % obj_network.id)
                 return obj_network
-        except:
-                self.fail('Unable to create a Network with offering=%s' % net_offerring)
+        except Exception, e:
+                self.fail('Unable to create a Network with offering=%s because of %s ' %
(net_offerring, e))
 
     def deployvm_in_network(self, network, host_id=None):
         try:
@@ -522,11 +518,17 @@ class TestVPCNetworkPFRules(cloudstackTestCase):
         network_1 = self.create_network(self.services["network_offering"])
         vm_1 = self.deployvm_in_network(network_1)
         public_ip_1 = self.acquire_publicip(network_1)
+        #ensure vm is accessible over public ip
+        nat_rule = self.create_natrule(vm_1, public_ip_1, network_1)
+        self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
+        #remove the nat rule
+        nat_rule.delete(self.apiclient)
+
         router = self.stop_vpcrouter()
-        self.create_natrule( vm_1, public_ip_1, network_1)
+        #recreate nat rule
+        self.create_natrule(vm_1, public_ip_1, network_1)
         self.start_vpcrouter(router)
         self.check_ssh_into_vm(vm_1, public_ip_1, testnegative=False)
-
         return
 
     @attr(tags=["advanced", "intervlan"])


Mime
View raw message