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/master to f3dd0c6
Date Fri, 02 Aug 2013 01:52:37 GMT
Updated Branches:
  refs/heads/master 07dcd6ffb -> f3dd0c600


Automation: More fix fox test_vpc_vm_life_cycle.py

You cannot reach VPC router IP because you're in one of it's networks.

As well as adding missing import for test_vpc_network_pfrules.py


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

Branch: refs/heads/master
Commit: f3dd0c6008533621600a92c1afe5e83348584346
Parents: 07dcd6f
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu Aug 1 18:47:40 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Thu Aug 1 18:52:30 2013 -0700

----------------------------------------------------------------------
 .../component/test_vpc_network_pfrules.py       |   1 +
 .../component/test_vpc_vm_life_cycle.py         | 169 ++++---------------
 2 files changed, 36 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3dd0c60/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 274012d..0d8e2f1 100644
--- a/test/integration/component/test_vpc_network_pfrules.py
+++ b/test/integration/component/test_vpc_network_pfrules.py
@@ -39,6 +39,7 @@ from marvin.integration.lib.common import (get_domain,
                                                         cleanup_resources,
                                                         list_routers)
 import socket
+import time
 
 
 class Services:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3dd0c60/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 3531aff..9b10133 100644
--- a/test/integration/component/test_vpc_vm_life_cycle.py
+++ b/test/integration/component/test_vpc_vm_life_cycle.py
@@ -753,22 +753,10 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the userdata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/user-data" % router.guestipaddress,
+               "wget http://%s/latest/user-data" % self.network_1.gateway,
                "cat user-data",
                ]
             for c in cmds:
@@ -808,23 +796,11 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the metadata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/meta-data" % router.guestipaddress,
-               "cat user-data",
+               "wget http://%s/latest/vm-id" % self.network_1.gateway,
+               "cat vm-id",
                ]
             for c in cmds:
                 result = ssh.execute(c)
@@ -872,28 +848,19 @@ class TestVMLifeCycleVPC(cloudstackTestCase):
                         )
 
         # Check if the network rules still exists after Vm stop
-        self.debug("Checking if NAT rules ")
-        nat_rules = NATRule.list(
-                                 self.apiclient,
-                                 id=self.nat_rule.id,
-                                 listall=True
-                                 )
-        self.assertEqual(
-                         nat_rules,
-                         None,
-                         "List NAT rules should not return anything"
-                         )
+        self.debug("Checking if NAT rules existed")
+        with self.assertRaises(Exception):
+            nat_rules = NATRule.list(
+                                     self.apiclient,
+                                     id=self.nat_rule.id,
+                                     listall=True
+                                     )
 
-        lb_rules = LoadBalancerRule.list(
+            lb_rules = LoadBalancerRule.list(
                                          self.apiclient,
                                          id=self.lb_rule.id,
                                          listall=True
                                          )
-        self.assertEqual(
-                         lb_rules,
-                         None,
-                         "List LB rules should not return anything"
-                         )
         return
 
 class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
@@ -1537,22 +1504,10 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the userdata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/user-data" % router.guestipaddress,
+               "wget http://%s/latest/user-data" % self.network_1.gateway,
                "cat user-data",
                ]
             for c in cmds:
@@ -1592,23 +1547,11 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the metadata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/meta-data" % router.guestipaddress,
-               "cat user-data",
+               "wget http://%s/latest/vm-id" % self.network_1.gateway,
+               "cat vm-id",
                ]
             for c in cmds:
                 result = ssh.execute(c)
@@ -1674,29 +1617,20 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase):
                          ["expunge.interval", "expunge.delay"]
                         )
 
-        # Check if the network rules still exists after Vm stop
-        self.debug("Checking if NAT rules ")
-        nat_rules = NATRule.list(
-                                 self.apiclient,
-                                 id=self.nat_rule.id,
-                                 listall=True
-                                 )
-        self.assertEqual(
-                         nat_rules,
-                         None,
-                         "List NAT rules should not return anything"
-                         )
+        # Check if the network rules still exists after Vm expunged 
+        self.debug("Checking if NAT rules existed ")
+        with self.assertRaises(Exception):
+            nat_rules = NATRule.list(
+                                     self.apiclient,
+                                     id=self.nat_rule.id,
+                                     listall=True
+                                     )
 
-        lb_rules = LoadBalancerRule.list(
+            lb_rules = LoadBalancerRule.list(
                                          self.apiclient,
                                          id=self.lb_rule.id,
                                          listall=True
                                          )
-        self.assertEqual(
-                         lb_rules,
-                         None,
-                         "List LB rules should not return anything"
-                         )
         return
 
 
@@ -2626,22 +2560,10 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the userdata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/user-data" % router.guestipaddress,
+               "wget http://%s/latest/user-data" % self.network_1.gateway,
                "cat user-data",
                ]
             for c in cmds:
@@ -2681,23 +2603,11 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to SSH into instance")
 
-        # Find router associated with user account
-        routers = Router.list(
-                                    self.apiclient,
-                                    zoneid=self.zone.id,
-                                    listall=True
-                                    )
-        self.assertEqual(
-                            isinstance(routers, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        router = routers[0]
         self.debug("check the metadata with that of present in router")
         try:
             cmds = [
-               "wget http://%s/latest/meta-data" % router.guestipaddress,
-               "cat user-data",
+               "wget http://%s/latest/vm-id" % self.network_1.gateway,
+               "cat vm-id",
                ]
             for c in cmds:
                 result = ssh.execute(c)
@@ -2744,27 +2654,18 @@ class TestVMLifeCycleStoppedVPCVR(cloudstackTestCase):
                          ["expunge.interval", "expunge.delay"]
                         )
 
-        # Check if the network rules still exists after Vm stop
-        self.debug("Checking if NAT rules ")
-        nat_rules = NATRule.list(
-                                 self.apiclient,
-                                 id=self.nat_rule.id,
-                                 listall=True
-                                 )
-        self.assertEqual(
-                         nat_rules,
-                         None,
-                         "List NAT rules should not return anything"
-                         )
+        # Check if the network rules still exists after Vm expunged 
+        self.debug("Checking if NAT rules existed ")
+        with self.assertRaises(Exception):
+            nat_rules = NATRule.list(
+                                     self.apiclient,
+                                     id=self.nat_rule.id,
+                                     listall=True
+                                     )
 
-        lb_rules = LoadBalancerRule.list(
+            lb_rules = LoadBalancerRule.list(
                                          self.apiclient,
                                          id=self.lb_rule.id,
                                          listall=True
                                          )
-        self.assertEqual(
-                         lb_rules,
-                         None,
-                         "List LB rules should not return anything"
-                         )
         return


Mime
View raw message