cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [07/44] git commit: updated refs/heads/4.9-bountycastle-daan to a001d75
Date Mon, 02 May 2016 14:36:28 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de86c0cb/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
index 3fc9c32..a8361d0 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
@@ -15,16 +15,17 @@
 # specific language governing permissions and limitations
 # under the License.
 
-""" Tests for Basic VPC Network Functionality with NuageVsp network Plugin
+""" Tests for basic VPC Network functionality with Nuage VSP SDN plugin
 """
 # Import Local Modules
+from nuageTestCase import nuageTestCase
 from marvin.lib.base import Account
+# Import System Modules
 from nose.plugins.attrib import attr
-from nuageTestCase import nuageTestCase
 
 
 class TestVpcNetworkNuage(nuageTestCase):
-    """ Test Basic VPC Network Functionality with NuageVsp network Plugin
+    """ Test basic VPC Network functionality with Nuage VSP SDN plugin
     """
 
     @classmethod
@@ -44,55 +45,55 @@ class TestVpcNetworkNuage(nuageTestCase):
 
     @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
     def test_nuage_vpc_network(self):
-        """ Test Basic VPC Network Functionality with NuageVsp network Plugin
+        """ Test Basic VPC Network Functionality with Nuage VSP SDN plugin
         """
 
         # 1. Create Nuage VSP VPC offering, check if it is successfully created and enabled.
         # 2. Create a VPC with Nuage VSP VPC offering, check if it is successfully created
and enabled.
-        # 3. Create Nuage Vsp VPC Network offering, check if it is successfully created and
enabled.
+        # 3. Create Nuage VSP VPC Network offering, check if it is successfully created and
enabled.
         # 4. Create an ACL list in the created VPC, and add an ACL item to it.
-        # 5. Create a VPC Network with Nuage Vsp VPC Network offering and the created ACL
list, check if it is
+        # 5. Create a VPC Network with Nuage VSP VPC Network offering and the created ACL
list, check if it is
         #    successfully created, is in the "Implemented" state, and is added to the VPC
VR.
         # 6. Deploy a VM in the created VPC network, check if the VM is successfully deployed
and is in the "Running"
         #    state.
-        # 7. Verify that the created ACL item is successfully implemented in Nuage Vsp.
+        # 7. Verify that the created ACL item is successfully implemented in Nuage VSP.
 
         # Creating a VPC offering
         self.debug("Creating Nuage VSP VPC offering...")
-        vpc_offering = self.create_VpcOffering(self.test_data["nuage_vsp_services"]["vpc_offering"])
-        self.validate_vpc_offering(vpc_offering, state="Enabled")
+        vpc_offering = self.create_VpcOffering(self.test_data["nuagevsp"]["vpc_offering"])
+        self.validate_VpcOffering(vpc_offering, state="Enabled")
 
         # Creating a VPC
         self.debug("Creating a VPC with Nuage VSP VPC offering...")
         vpc = self.create_Vpc(vpc_offering, cidr='10.1.0.0/16')
-        self.validate_vpc(vpc, state="Enabled")
+        self.validate_Vpc(vpc, state="Enabled")
 
         # Creating a network offering
-        self.debug("Creating Nuage Vsp VPC Network offering...")
-        network_offering = self.create_NetworkOffering(self.test_data["nuage_vsp_services"]["vpc_network_offering"])
-        self.validate_network_offering(network_offering, state="Enabled")
+        self.debug("Creating Nuage VSP VPC Network offering...")
+        network_offering = self.create_NetworkOffering(self.test_data["nuagevsp"]["vpc_network_offering"])
+        self.validate_NetworkOffering(network_offering, state="Enabled")
 
         # Creating an ACL list
-        acl_list = self.create_network_acl_list(name="acl", description="acl", vpc=vpc)
+        acl_list = self.create_NetworkAclList(name="acl", description="acl", vpc=vpc)
 
         # Creating an ACL item
-        acl_item = self.create_network_acl_rule(self.test_data["ingress_rule"], acl_list=acl_list)
+        acl_item = self.create_NetworkAclRule(self.test_data["ingress_rule"], acl_list=acl_list)
 
         # Creating a VPC network in the VPC
-        self.debug("Creating a VPC network with Nuage Vsp VPC Network offering...")
-        vpc_network = self.create_Network(network_offering, gateway='10.1.1.1', vpc=vpc,
acl_list=acl_list)
-        self.validate_network(vpc_network, state="Implemented")
-        vr = self.get_network_router(vpc_network)
-        self.check_router_state(vr, state="Running")
+        self.debug("Creating a VPC network with Nuage VSP VPC Network offering...")
+        vpc_network = self.create_Network(network_offering, vpc=vpc, acl_list=acl_list)
+        self.validate_Network(vpc_network, state="Implemented")
+        vr = self.get_Router(vpc_network)
+        self.check_Router_state(vr, state="Running")
 
         # Deploying a VM in the VPC network
-        vm = self.create_VM_in_Network(vpc_network)
-        self.check_vm_state(vm, state="Running")
+        vm = self.create_VM(vpc_network)
+        self.check_VM_state(vm, state="Running")
 
-        # VSPK verification
+        # VSD verification
         self.verify_vsp_network(self.domain.id, vpc_network, vpc)
         self.verify_vsp_router(vr)
         self.verify_vsp_vm(vm)
 
-        # VSPK verification for ACL item
+        # VSD verification for ACL item
         self.verify_vsp_firewall_rule(acl_item)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de86c0cb/test/integration/plugins/nuagevsp/test_nuage_vsp.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_vsp.py b/test/integration/plugins/nuagevsp/test_nuage_vsp.py
index a6ec7e1..ca2a28e 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vsp.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vsp.py
@@ -15,16 +15,17 @@
 # specific language governing permissions and limitations
 # under the License.
 
-""" P1 tests for NuageVsp network Plugin
+""" P1 tests for Nuage VSP SDN plugin
 """
 # Import Local Modules
+from nuageTestCase import nuageTestCase
 from marvin.lib.base import Account
+# Import System Modules
 from nose.plugins.attrib import attr
-from nuageTestCase import nuageTestCase
 
 
 class TestNuageVsp(nuageTestCase):
-    """ Test NuageVsp network plugin
+    """ Test Nuage VSP SDN plugin
     """
 
     @classmethod
@@ -44,12 +45,12 @@ class TestNuageVsp(nuageTestCase):
 
     @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
     def test_nuage_vsp(self):
-        """ Test NuageVsp network plugin with basic Isolated Network functionality
+        """ Test Nuage VSP SDN plugin with basic Isolated Network functionality
         """
 
-        # 1. Verify that the NuageVsp network service provider is successfully created and
enabled.
-        # 2. Create and enable Nuage Vsp Isolated Network offering, check if it is successfully
created and enabled.
-        # 3. Create an Isolated Network with Nuage Vsp Isolated Network offering, check if
it is successfully created
+        # 1. Verify that the Nuage VSP network service provider is successfully created and
enabled.
+        # 2. Create and enable Nuage VSP Isolated Network offering, check if it is successfully
created and enabled.
+        # 3. Create an Isolated Network with Nuage VSP Isolated Network offering, check if
it is successfully created
         #    and is in the "Allocated" state.
         # 4. Deploy a VM in the created Isolated network, check if the Isolated network state
is changed to
         #    "Implemented", and both the VM & VR are successfully deployed and are in
the "Running" state.
@@ -58,49 +59,49 @@ class TestNuageVsp(nuageTestCase):
         # 6. Delete the created Isolated Network after destroying its VMs, check if the Isolated
network is successfully
         #    deleted.
 
-        self.debug("Validating the NuageVsp network service provider...")
+        self.debug("Validating the Nuage VSP network service provider...")
         self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")
 
         # Creating a network offering
-        self.debug("Creating and enabling Nuage Vsp Isolated Network offering...")
+        self.debug("Creating and enabling Nuage VSP Isolated Network offering...")
         network_offering = self.create_NetworkOffering(
-            self.test_data["nuage_vsp_services"]["isolated_network_offering"])
-        self.validate_network_offering(network_offering, state="Enabled")
+            self.test_data["nuagevsp"]["isolated_network_offering"])
+        self.validate_NetworkOffering(network_offering, state="Enabled")
 
         # Creating a network
-        self.debug("Creating an Isolated Network with Nuage Vsp Isolated Network offering...")
-        network = self.create_Network(network_offering, gateway='10.1.1.1')
-        self.validate_network(network, state="Allocated")
+        self.debug("Creating an Isolated Network with Nuage VSP Isolated Network offering...")
+        network = self.create_Network(network_offering)
+        self.validate_Network(network, state="Allocated")
 
         # Deploying a VM in the network
-        vm_1 = self.create_VM_in_Network(network)
-        self.validate_network(network, state="Implemented")
-        vr = self.get_network_router(network)
-        self.check_router_state(vr, state="Running")
-        self.check_vm_state(vm_1, state="Running")
+        vm_1 = self.create_VM(network)
+        self.validate_Network(network, state="Implemented")
+        vr = self.get_Router(network)
+        self.check_Router_state(vr, state="Running")
+        self.check_VM_state(vm_1, state="Running")
 
-        # VSPK verification
+        # VSD verification
         self.verify_vsp_network(self.domain.id, network)
         self.verify_vsp_router(vr)
         self.verify_vsp_vm(vm_1)
 
         # Deploying one more VM in the network
-        vm_2 = self.create_VM_in_Network(network)
-        self.check_vm_state(vm_2, state="Running")
+        vm_2 = self.create_VM(network)
+        self.check_VM_state(vm_2, state="Running")
 
-        # VSPK verification
+        # VSD verification
         self.verify_vsp_vm(vm_2)
 
         # Deleting the network
-        self.debug("Deleting the Isolated Network with Nuage Vsp Isolated Network offering...")
+        self.debug("Deleting the Isolated Network with Nuage VSP Isolated Network offering...")
         self.delete_VM(vm_1)
         self.delete_VM(vm_2)
         self.delete_Network(network)
         with self.assertRaises(Exception):
-            self.validate_network(network)
+            self.validate_Network(network)
         self.debug("Isolated Network successfully deleted in CloudStack")
 
-        # VSPK verification
+        # VSD verification
         with self.assertRaises(Exception):
             self.verify_vsp_network(self.domain.id, network)
         self.debug("Isolated Network successfully deleted in VSD")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de86c0cb/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index 352f8a2..c9bb7c6 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -735,6 +735,34 @@ test_data = {
         "publicport": 22,
         "protocol": 'TCP'
     },
+    "internal_lbrule": {
+        "name": "SSH",
+        "algorithm": "roundrobin",
+        # Algorithm used for load balancing
+        "sourceport": 22,
+        "instanceport": 22,
+        "scheme": "internal",
+        "protocol": "TCP",
+        "cidrlist": '0.0.0.0/0',
+    },
+    "internal_lbrule_http": {
+        "name": "HTTP",
+        "algorithm": "roundrobin",
+        # Algorithm used for load balancing
+        "sourceport": 80,
+        "instanceport": 80,
+        "scheme": "internal",
+        "protocol": "TCP",
+        "cidrlist": '0.0.0.0/0',
+    },
+    "http_rule": {
+        "privateport": 80,
+        "publicport": 80,
+        "startport": 80,
+        "endport": 80,
+        "protocol": "TCP",
+        "cidrlist": '0.0.0.0/0',
+    },
     "icmprule": {
         "icmptype": -1,
         "icmpcode": -1,
@@ -1696,9 +1724,9 @@ test_data = {
                     "mode": 'HTTP_DOWNLOAD'
                 }
         },
-    # Nuage Vsp supported services
-    "nuage_vsp_services": {
-        # Services supported by Nuage Vsp for Isolated networks
+    # Nuage VSP SDN plugin specific test data
+    "nuagevsp": {
+        # Services supported by the Nuage VSP plugin for Isolated networks
         "isolated_network_offering": {
             "name": 'nuage_marvin',
             "displaytext": 'nuage_marvin',
@@ -1718,7 +1746,7 @@ test_data = {
                     "SourceNat": {"SupportedSourceNatTypes": "perzone"}
             }
         },
-        # Services supported by Nuage Vsp for VPC networks
+        # Services supported by the Nuage VSP plugin for VPC networks
         "vpc_network_offering": {
             "name": 'nuage_vpc_marvin',
             "displaytext": 'nuage_vpc_marvin',
@@ -1740,7 +1768,30 @@ test_data = {
                 "SourceNat": {"SupportedSourceNatTypes": "perzone"}
             }
         },
-        # Nuage Vsp supports only pre-defined and custom VPC offerings
+        "vpc_network_offering_internal_lb": {
+            "name": "nuage_vpc_marvin_internal_lb",
+            "displaytext": "nuage_vpc_marvin_internal_lb",
+            "guestiptype": 'Isolated',
+            "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+            "traffictype": 'GUEST',
+            "availability": 'Optional',
+            "useVpc": 'on',
+            "ispersistent": 'True',
+            "serviceProviderList": {
+                "Dhcp": "NuageVsp",
+                "Lb": "InternalLbVm",
+                "StaticNat": "NuageVsp",
+                "SourceNat": "NuageVsp",
+                "NetworkACL": "NuageVsp",
+                "Connectivity": "NuageVsp",
+                "UserData": "VpcVirtualRouter"
+            },
+            "serviceCapabilityList": {
+                "SourceNat": {"SupportedSourceNatTypes": "perzone"},
+                "Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
+            }
+        },
+        # Services supported by the Nuage VSP plugin for VPCs
         "vpc_offering": {
             "name": 'Nuage VSP VPC offering',
             "displaytext": 'Nuage VSP VPC offering',
@@ -1753,57 +1804,20 @@ test_data = {
                 "Connectivity": "NuageVsp",
                 "UserData": "VpcVirtualRouter"
             }
-        }
-    },
-   
-    #_pr -_ passwordreset - below services used in test_nuage_password_reset
-    "network_offering_pr": {
-        "name": 'nuage_marvin',
-        "displaytext": 'nuage_marvin',
-        "guestiptype": 'Isolated',
-        "supportedservices":
-        'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall',
-        "traffictype": 'GUEST',
-        "availability": 'Optional',
-        "serviceProviderList": {
-            "UserData": 'VirtualRouter',
-            "Dhcp": 'NuageVsp',
-            "Connectivity": 'NuageVsp',
-            "StaticNat": 'NuageVsp',
-            "SourceNat": 'NuageVsp',
-            "Firewall": 'NuageVsp'
         },
-    },
-    "network_pr": {
-        "name": "Test Network",
-        "displaytext": "Test Network",
-        "netmask": '255.255.255.0'
-    },
-    "fw_rule_pr": {
-        "startport": 1,
-        "endport": 6000,
-        "cidr": '0.0.0.0/0',
-        # Any network (For creating FW rule)
-        "protocol": "TCP"
-    },
-    "virtual_machine_pr": {
-        "displayname": "Test VM",
-        "username": "root",
-        "password": "password",
-        "ssh_port": 22,
-        "hypervisor": 'kvm',
-        # Hypervisor type should be same as
-        # hypervisor type of cluster
-        "privateport": 22,
-        "publicport": 22,
-        "protocol": 'TCP',
-        "userdata": "This is sample data",
-    },
-    "template_pr": {
-        "displaytext": "Cent OS Template",
-        "name": "Cent OS Template",
-        "passwordenabled": True,
-    },
-    "ostype_pr": 'CentOS 5.5 (64-bit)',
-
+        "vpc_offering_lb": {
+            "name": 'Nuage VSP VPC offering with Lb',
+            "displaytext": 'Nuage VSP VPC offering with Lb',
+            "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+            "serviceProviderList": {
+                "Dhcp": "NuageVsp",
+                "Lb": "InternalLbVm",
+                "StaticNat": "NuageVsp",
+                "SourceNat": "NuageVsp",
+                "NetworkACL": "NuageVsp",
+                "Connectivity": "NuageVsp",
+                "UserData": "VpcVirtualRouter"
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de86c0cb/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index e2f4a2c..4ceb7ac 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -4673,7 +4673,7 @@ class ApplicationLoadBalancer:
     @classmethod
     def create(cls, apiclient, services, name=None, sourceport=None,
                instanceport=22, algorithm="roundrobin", scheme="internal",
-               sourcenetworkid=None, networkid=None):
+               sourcenetworkid=None, networkid=None, sourceipaddress=None):
         """Create Application Load Balancer"""
         cmd = createLoadBalancer.createLoadBalancerCmd()
 
@@ -4712,6 +4712,11 @@ class ApplicationLoadBalancer:
         elif networkid:
             cmd.networkid = networkid
 
+        if "sourceipaddress" in services:
+            cmd.sourceipaddress = services["sourceipaddress"]
+        elif sourceipaddress:
+            cmd.sourceipaddress = sourceipaddress
+
         return LoadBalancerRule(apiclient.createLoadBalancer(cmd).__dict__)
 
     def delete(self, apiclient):


Mime
View raw message