cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [02/13] git commit: updated refs/heads/master to 0e057ad
Date Wed, 07 Dec 2016 18:36:41 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/test/integration/plugins/nuagevsp/test_nuage_sharednetwork_vpc_vm_monitor.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_sharednetwork_vpc_vm_monitor.py b/test/integration/plugins/nuagevsp/test_nuage_sharednetwork_vpc_vm_monitor.py
new file mode 100644
index 0000000..d8ca41f
--- /dev/null
+++ b/test/integration/plugins/nuagevsp/test_nuage_sharednetwork_vpc_vm_monitor.py
@@ -0,0 +1,704 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# 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
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Component tests for Shared Network functionality with Nuage VSP SDN plugin:
+VPC Virtual Machine Monitoring
+"""
+# Import Local Modules
+from nuageTestCase import nuageTestCase
+from marvin.lib.utils import cleanup_resources, validateList
+from marvin.lib.base import (VPC,
+                             Account,
+                             Domain,
+                             User,
+                             VirtualMachine,
+                             Network,
+                             NetworkOffering,
+                             VpcOffering)
+from marvin.lib.common import list_virtual_machines
+from marvin.codes import PASS
+# Import System modules
+from nose.plugins.attrib import attr
+
+
+class TestNuageSharedNetworkVpcVmMonitor(nuageTestCase):
+    @classmethod
+    def setUpClass(cls):
+        """
+        Create the following domain tree and accounts that are required for
+        executing Nuage VSP SDN plugin test cases for shared networks:
+            Under ROOT - create domain D1
+            Under domain D1 - Create two subdomains D11 and D12
+            Under each of the domains - create one admin user and couple of
+            regular users.
+        Create shared network with the following scope:
+            1. Network with scope="all"
+            2. Network with scope="domain" with no subdomain access
+            3. Network with scope="domain" with subdomain access
+            4. Network with scope="account"
+        """
+
+        super(TestNuageSharedNetworkVpcVmMonitor, cls).setUpClass()
+        cls.sharednetworkdata = cls.test_data["acl"]
+        cls.nuagenetworkdata = cls.test_data["nuagevsp"]
+
+        cls.domain_1 = None
+        cls.domain_2 = None
+
+        try:
+            # backup default apikey and secretkey
+            cls.default_apikey = cls.api_client.connection.apiKey
+            cls.default_secretkey = cls.api_client.connection.securityKey
+
+            # Create domains
+            cls.domain_1 = Domain.create(
+                cls.api_client,
+                cls.sharednetworkdata["domain1"]
+            )
+            cls.domain_11 = Domain.create(
+                cls.api_client,
+                cls.sharednetworkdata["domain11"],
+                parentdomainid=cls.domain_1.id
+            )
+            cls.domain_12 = Domain.create(
+                cls.api_client,
+                cls.sharednetworkdata["domain12"],
+                parentdomainid=cls.domain_1.id
+            )
+            # Create  1 admin account and 2 user accounts for doamin_1
+            cls.account_d1 = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD1"],
+                admin=True,
+                domainid=cls.domain_1.id
+            )
+
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d1)
+            cls.user_d1_apikey = user.apikey
+            cls.user_d1_secretkey = user.secretkey
+
+            cls.account_d1a = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD1A"],
+                admin=False,
+                domainid=cls.domain_1.id
+            )
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d1a)
+            cls.user_d1a_apikey = user.apikey
+            cls.user_d1a_secretkey = user.secretkey
+
+            cls.account_d1b = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD1B"],
+                admin=False,
+                domainid=cls.domain_1.id
+            )
+
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d1b)
+            cls.user_d1b_apikey = user.apikey
+            cls.user_d1b_secretkey = user.secretkey
+
+            # Create  1 admin and 2 user accounts for doamin_11
+            cls.account_d11 = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD11"],
+                admin=True,
+                domainid=cls.domain_11.id
+            )
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d11)
+            cls.user_d11_apikey = user.apikey
+            cls.user_d11_secretkey = user.secretkey
+
+            cls.account_d11a = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD11A"],
+                admin=False,
+                domainid=cls.domain_11.id
+            )
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d11a)
+            cls.user_d11a_apikey = user.apikey
+            cls.user_d11a_secretkey = user.secretkey
+
+            cls.account_d11b = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD11B"],
+                admin=False,
+                domainid=cls.domain_11.id
+            )
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d11b)
+            cls.user_d11b_apikey = user.apikey
+            cls.user_d11b_secretkey = user.secretkey
+
+            # Create  2 user accounts for doamin_12
+            cls.account_d12a = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD12A"],
+                admin=False,
+                domainid=cls.domain_12.id
+            )
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d12a)
+            cls.user_d12a_apikey = user.apikey
+            cls.user_d12a_secretkey = user.secretkey
+
+            cls.account_d12b = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountD12B"],
+                admin=False,
+                domainid=cls.domain_12.id
+            )
+
+            user = cls.generateKeysForUser(cls.api_client, cls.account_d12b)
+            cls.user_d12b_apikey = user.apikey
+            cls.user_d12b_secretkey = user.secretkey
+
+            # Create 1 user account and admin account in "ROOT" domain
+
+            cls.account_roota = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountROOTA"],
+                admin=False,
+            )
+
+            user = cls.generateKeysForUser(cls.api_client, cls.account_roota)
+            cls.user_roota_apikey = user.apikey
+            cls.user_roota_secretkey = user.secretkey
+
+            cls.account_root = Account.create(
+                cls.api_client,
+                cls.sharednetworkdata["accountROOTA"],
+                admin=True,
+            )
+
+            user = cls.generateKeysForUser(cls.api_client, cls.account_root)
+            cls.user_root_apikey = user.apikey
+            cls.user_root_secretkey = user.secretkey
+
+            # service offering is already created in Nuagetestcase
+            cls.sharednetworkdata['mode'] = cls.zone.networktype
+
+            # As admin user , create shared network with scope "all", "domain"
+            # with subdomain access , "domain" without subdomain access and
+            # "account"
+            cls.api_client.connection.apiKey = cls.default_apikey
+            cls.api_client.connection.securityKey = cls.default_secretkey
+
+            cls.shared_network_offering = NetworkOffering.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"]["shared_nuage_network_offering"],
+                conservemode=False
+                )
+            # Enable Network offering
+            cls.shared_network_offering.update(cls.api_client, state='Enabled')
+            cls.shared_network_offering_id = cls.shared_network_offering.id
+
+            cls.shared_network_all = Network.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"]["network_all"],
+                networkofferingid=cls.shared_network_offering_id,
+                zoneid=cls.zone.id
+            )
+
+            cls.shared_network_domain_d11 = Network.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"][
+                    "network_domain_with_no_subdomain_access"],
+                networkofferingid=cls.shared_network_offering_id,
+                zoneid=cls.zone.id,
+                domainid=cls.domain_11.id,
+                subdomainaccess=False
+            )
+
+            cls.shared_network_domain_with_subdomain_d11 = Network.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"][
+                    "network_domain_with_subdomain_access"],
+                networkofferingid=cls.shared_network_offering_id,
+                zoneid=cls.zone.id,
+                domainid=cls.domain_11.id,
+                subdomainaccess=True
+            )
+
+            cls.shared_network_account_d111a = Network.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"]["network_account"],
+                networkofferingid=cls.shared_network_offering_id,
+                zoneid=cls.zone.id,
+                domainid=cls.domain_11.id,
+                accountid=cls.account_d11a.user[0].username
+            )
+
+            cls.debug("Creating Nuage VSP VPC offering...")
+            cls.vpc_offering = VpcOffering.create(cls.api_client,
+                                                  cls.test_data["nuagevsp"][
+                                                      "vpc_offering"]
+                                                  )
+
+            cls.vpc_offering.update(cls.api_client, state="Enabled")
+
+            # Creating a VPC
+            cls.debug("Creating a VPC with Nuage VSP VPC offering...")
+            cls.test_data["vpc"]["cidr"] = '10.1.0.0/16'
+            cls.vpcd11 = VPC.create(cls.api_client,
+                                    cls.test_data["vpc"],
+                                    vpcofferingid=cls.vpc_offering.id,
+                                    zoneid=cls.zone.id,
+                                    account=cls.account_d11a.name,
+                                    domainid=cls.account_d11a.domainid
+                                    )
+
+            # Creating a network offering
+            cls.debug("Creating Nuage Vsp VPC Network offering...")
+            cls.network_offering = NetworkOffering.create(
+                cls.api_client,
+                cls.test_data["nuagevsp"]["vpc_network_offering"],
+                conservemode=False
+            )
+            cls.network_offering.update(cls.api_client, state="Enabled")
+
+            # Creating two VPC network in the VPC
+            cls.debug(
+                "Creating a VPC network with Nuage Vsp VPC Network "
+                "offering...")
+            cls.test_data["network"]["netmask"] = "255.255.255.0"
+            cls.vpc_network1 = Network.create(
+                cls.api_client,
+                cls.test_data["network"],
+                accountid=cls.account_d11a.name,
+                domainid=cls.account_d11a.domainid,
+                networkofferingid=cls.network_offering.id,
+                zoneid=cls.zone.id,
+                gateway="10.1.1.1",
+                vpcid=cls.vpcd11.id
+            )
+
+            cls.debug(
+                "Creating a VPC Tier2 network with Nuage Vsp VPC Network "
+                "offering...")
+            cls.test_data["network"]["name"] = "Tier2"
+            cls.vpc_network2 = Network.create(
+                cls.api_client,
+                cls.test_data["network"],
+                accountid=cls.account_d11a.name,
+                domainid=cls.account_d11a.domainid,
+                networkofferingid=cls.network_offering.id,
+                zoneid=cls.zone.id,
+                gateway="10.1.2.1",
+                vpcid=cls.vpcd11.id
+            )
+
+            cls.vmdata = {"name": "vmvpc1",
+                          "displayname": "vmvpc1"
+                          }
+
+            # Deploying a VM in the VPC network
+            cls.vmvpc1 = VirtualMachine.create(
+                cls.api_client,
+                cls.vmdata,
+                zoneid=cls.zone.id,
+                serviceofferingid=cls.service_offering.id,
+                templateid=cls.template.id,
+                networkids=cls.vpc_network1.id,
+                accountid=cls.account_d11a.name,
+                domainid=cls.account_d11a.domainid
+            )
+
+            cls.vmdata = {"name": "vmvpc2",
+                          "displayname": "vmvpc2"
+                          }
+
+            cls.vmvpc2 = VirtualMachine.create(
+                cls.api_client,
+                cls.vmdata,
+                zoneid=cls.zone.id,
+                serviceofferingid=cls.service_offering.id,
+                templateid=cls.template.id,
+                networkids=cls.vpc_network2.id,
+                accountid=cls.account_d11a.name,
+                domainid=cls.account_d11a.domainid
+            )
+
+            cls._cleanup = [
+                cls.account_root,
+                cls.account_roota,
+                cls.shared_network_all,
+                cls.shared_network_offering,
+                cls.network_offering,
+                cls.vpc_offering,
+                cls.service_offering,
+            ]
+        except Exception as e:
+            cls.domain_1.delete(cls.api_client, cleanup="true")
+            cleanup_resources(cls.api_client, cls._cleanup)
+            raise Exception(
+                "Failed to create the setup required to execute the test "
+                "cases: %s" % e)
+
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.api_client.connection.apiKey = cls.default_apikey
+        cls.api_client.connection.securityKey = cls.default_secretkey
+        cls.domain_1.delete(cls.api_client, cleanup="true")
+        cleanup_resources(cls.api_client, cls._cleanup)
+        return
+
+    def setUp(self):
+        self.api_client = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+
+    def tearDown(self):
+        # restore back default apikey and secretkey
+        self.api_client.connection.apiKey = self.default_apikey
+        self.api_client.connection.securityKey = self.default_secretkey
+        return
+
+    def verify_nic(self, network, vm):
+        """verify required nic is present in the VM"""
+        self.debug(
+            "Going to verify if %s Network nic is present in virtual machine "
+            "%s" % (network.name, vm.id))
+        vm_list = list_virtual_machines(self.api_client, id=vm.id)
+        vm_list_validation_result = validateList(vm_list)
+        self.assertEqual(vm_list_validation_result[0], PASS,
+                         "vm list validation failed due to %s" %
+                         vm_list_validation_result[2])
+        self.debug("virtual machine nics: %s" % vm_list[0].nic)
+        # filter nic of virtual machine based on Network
+        nics = [x for x in vm_list[0].nic if x.networkid == network.id]
+        self.debug("Filtered nics list: %s:" % nics)
+        if len(nics) == 1:
+            return True
+        else:
+            return False
+
+    # Test cases relating to MonitorVM through SharedNetwork
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_01_addNic_in_sharedNetwork_scope_all_as_domainuser(self):
+        """Validate that Normal user in the same domain able to add NIC in a
+        shared network with scope=all
+        """
+
+        # Deploy VM for a user in a domain under ROOT as admin
+
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+        self.debug("Adding NIC of shared Network as user d11a")
+
+        self.vmvpc1.add_nic(self.api_client, self.shared_network_all.id)
+
+        if self.verify_nic(self.shared_network_all, self.vmvpc1):
+            self.debug(
+                "virtual machine has NIC is SharedNetwork: %s" %
+                self.shared_network_all.name)
+        else:
+            self.fail(
+                "Expected network %s NIC is not present in the virtual "
+                "Machine %s" %
+                (self.shared_network_all.name, self.vmvpc1.id))
+
+        self.debug("validating Network and VM on VSD")
+        self.verify_vsd_shared_network(
+            self.account_d11a.domainid,
+            self.shared_network_all,
+            gateway=self.nuagenetworkdata["network_all"]["gateway"])
+        subnet_id = self.get_subnet_id(
+            self.shared_network_all.id,
+            self.nuagenetworkdata["network_all"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc1,
+                                      sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_02_addNic_in_sharedNetwork_scope_all_as_domain_parentAdmin(self):
+        """Validate that Parent domain admin is able to add a NIC  in a shared
+        network with scope=all
+        """
+
+        # Add NIC as D1 user
+        self.api_client.connection.apiKey = self.user_d1_apikey
+        self.api_client.connection.securityKey = self.user_d1_secretkey
+        self.debug("Adding NIC of shared Network as user d1")
+
+        self.vmvpc2.add_nic(self.api_client, self.shared_network_all.id)
+
+        if self.verify_nic(self.shared_network_all, self.vmvpc2):
+            self.debug(
+                "virtual machine has NIC is SharedNetwork: %s" %
+                self.shared_network_all.name)
+        else:
+            self.fail(
+                "Expected network %s NIC is not present in the virtual "
+                "Machine %s" %
+                (self.shared_network_all.name, self.vmvpc2.id))
+
+        self.debug("validating Network and VM on VSD")
+        self.verify_vsd_shared_network(
+            self.account_d1.domainid,
+            self.shared_network_all,
+            gateway=self.nuagenetworkdata["network_all"]["gateway"])
+        subnet_id = self.get_subnet_id(
+            self.shared_network_all.id,
+            self.nuagenetworkdata["network_all"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc2,
+                                      sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_03_staticNat_in_VPC_secondNic_sharedNetwork_scope_all(self):
+        """Validate that User can enable staticNat on VPC NIC where second nic
+        is in a shared network with scope=all
+        """
+
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+        self.debug("Enabling StaticNat as user d11a")
+        public_ip_1 = self.acquire_PublicIPAddress(self.vpc_network1,
+                                                   self.vpcd11,
+                                                   account=self.account_d11a)
+        self.create_StaticNatRule_For_VM(self.vmvpc1, public_ip_1,
+                                         self.vpc_network1)
+        self.validate_PublicIPAddress(public_ip_1, self.vpc_network1,
+                                      static_nat=True, vm=self.vmvpc1)
+        subnet_id = self.get_subnet_id(
+            self.shared_network_all.id,
+            self.nuagenetworkdata["network_all"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc2,
+                                      sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_04_rebootVM_after_sharedNetwork_nic(self):
+        """Validate that reboot VM is done successfully without any Error
+        """
+
+        # Deploy VM for a user in a domain under ROOT as admin
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+
+        self.debug("Rebooting VMs as user d1")
+
+        try:
+            self.vmvpc1.reboot(self.api_client)
+            self.vmvpc2.reboot(self.api_client)
+        except Exception as e:
+            self.fail("Failed to reboot the virtual instances, %s" % e)
+
+        self.debug("validating VM on VSD")
+        subnet_id = self.get_subnet_id(
+            self.shared_network_all.id,
+            self.nuagenetworkdata["network_all"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc1,
+                                      sharedsubnetid=subnet_id)
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc2,
+                                      sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_05_restart_Tier_VPC_Network_sharedNetwork_nic(self):
+        """Validate that restart Tier Network is done successfully with cleanup
+        """
+
+        # Deploy VM for a user in a domain under ROOT as admin
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+
+        self.debug("Restarting Tier Networks and VPC")
+
+        self.vpc_network1.restart(self.api_client, cleanup=True)
+        self.vpc_network2.restart(self.api_client, cleanup=True)
+        self.restart_Vpc(self.vpcd11, cleanup=False)
+
+        self.debug("validating VM on VSD")
+        subnet_id = self.get_subnet_id(
+            self.shared_network_all.id,
+            self.nuagenetworkdata["network_all"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc1,
+                                      sharedsubnetid=subnet_id)
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_all, self.vmvpc2,
+                                      sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_06_restart_sharedNetwork_scope_all(self):
+        """Validate that restart Shared Network is done successfully without
+        any Error
+        """
+
+        self.debug("Restarting shared Network with cleanup")
+        self.shared_network_all.restart(self.api_client, cleanup=True)
+
+        self.debug("validating SharedNetwork on VSD")
+        self.verify_vsd_shared_network(
+            self.account_d11a.domainid,
+            self.shared_network_all,
+            gateway=self.nuagenetworkdata["network_all"]["gateway"])
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_07_removeNic_in_sharedNetwork_scope_all_as_domainuser(self):
+        """Validate that Normal user in the same domain able to remove NIC in a
+        shared network which is added by Parent Domain Admin
+        """
+
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+
+        self.debug("Removing NIC of shared Network as user d11a")
+
+        vm_list = list_virtual_machines(self.api_client, id=self.vmvpc2.id)
+        vm_list_validation_result = validateList(vm_list)
+        self.assertEqual(vm_list_validation_result[0], PASS,
+                         "vm list validation failed due to %s" %
+                         vm_list_validation_result[2])
+        self.debug("virtual machine nics: %s" % vm_list[0].nic)
+        for nic in vm_list[0].nic:
+            if nic.networkid == self.shared_network_all.id:
+                reqNic = nic
+
+        self.vmvpc2.remove_nic(self.api_client, reqNic.id)
+        if not self.verify_nic(self.shared_network_all, self.vmvpc2):
+            self.debug(
+                "virtual machine has NIC is SharedNetwork: %s" %
+                self.shared_network_all.name)
+        else:
+            self.fail("network %s NIC is present in the virtual Machine %s" %
+                      (self.shared_network_all.name, self.vmvpc2.id))
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_08_removeNic_in_sharedNetwork_scope_all_as_domain_parentAdmin(
+            self):
+        """Validate that Parent domain admin is able to remove a NIC  which is
+        added by child domain user
+        """
+
+        self.api_client.connection.apiKey = self.user_d1_apikey
+        self.api_client.connection.securityKey = self.user_d1_secretkey
+        self.debug("Removing NIC od shared Network as user d1")
+
+        vm_list = list_virtual_machines(self.api_client, id=self.vmvpc1.id)
+        vm_list_validation_result = validateList(vm_list)
+        self.assertEqual(vm_list_validation_result[0], PASS,
+                         "vm list validation failed due to %s" %
+                         vm_list_validation_result[2])
+        self.debug("virtual machine nics: %s" % vm_list[0].nic)
+        for nic in vm_list[0].nic:
+            if nic.networkid == self.shared_network_all.id:
+                reqNic = nic
+
+        self.vmvpc1.remove_nic(self.api_client, reqNic.id)
+
+        if not self.verify_nic(self.shared_network_all, self.vmvpc1):
+            self.debug(
+                "virtual machine has mot NIC is SharedNetwork: %s" %
+                self.shared_network_all.name)
+        else:
+            self.fail("network %s NIC is present in the virtual Machine %s" %
+                      (self.shared_network_all.name, self.vmvpc1.id))
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_09_addNic_in_sharedNetwork_scope_domain_as_domainuser(self):
+        """Validate that Normal user in the same domain able to add NIC in a
+        shared network with scope=domain without subdomain Access
+        """
+
+        # Deploy VM for a user in a domain under ROOT as admin
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+        self.debug("Adding NIC of shared Network as user d11a")
+
+        self.vmvpc1.add_nic(self.api_client, self.shared_network_domain_d11.id)
+
+        if self.verify_nic(self.shared_network_domain_d11, self.vmvpc1):
+            self.debug(
+                "virtual machine has NIC is SharedNetwork: %s" %
+                self.shared_network_domain_d11.name)
+        else:
+            self.fail(
+                "Expected network %s NIC is not present in the virtual "
+                "Machine %s" %
+                (self.shared_network_domain_d11.name, self.vmvpc1.id))
+
+        self.debug("validating Network and VM on VSD")
+        self.verify_vsd_shared_network(
+            self.account_d11a.domainid,
+            self.shared_network_domain_d11,
+            gateway=self.nuagenetworkdata[
+                "network_domain_with_no_subdomain_access"]["gateway"])
+        subnet_id = self.get_subnet_id(
+            self.shared_network_domain_d11.id,
+            self.nuagenetworkdata[
+                "network_domain_with_no_subdomain_access"]["gateway"])
+        self.verify_vsd_enterprise_vm(self.account_d11a.domainid,
+                                      self.shared_network_domain_d11,
+                                      self.vmvpc1, sharedsubnetid=subnet_id)
+
+    @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
+    def test_10_addNic_in_sharedNetwork_scope_domain_subdomain_as_domainuser(
+            self):
+        """Validate that Normal user in the same domain able to add NIC in a
+        shared network with scope=domain with subdomain Access
+        """
+
+        # Deploy VM for a user in a domain under ROOT as admin
+        self.api_client.connection.apiKey = self.user_d11a_apikey
+        self.api_client.connection.securityKey = self.user_d11a_secretkey
+        self.debug("Adding NIC of shared Network as user d11a")
+
+        self.vmvpc2.add_nic(self.api_client,
+                            self.shared_network_domain_with_subdomain_d11.id)
+
+        if self.verify_nic(self.shared_network_domain_with_subdomain_d11,
+                           self.vmvpc2):
+            self.debug(
+                "virtual machine has NIC is SharedNetwork: %s" %
+                self.shared_network_domain_with_subdomain_d11.name)
+        else:
+            self.fail(
+                "Expected network %s NIC is not present in the virtual "
+                "Machine %s" %
+                (self.shared_network_domain_with_subdomain_d11.name,
+                 self.vmvpc2.id))
+
+        self.debug("validating Network and VM on VSD")
+        self.verify_vsd_shared_network(
+            self.account_d11a.domainid,
+            self.shared_network_domain_with_subdomain_d11,
+            gateway=self.nuagenetworkdata[
+                "network_domain_with_subdomain_access"]["gateway"])
+        subnet_id = self.get_subnet_id(
+            self.shared_network_domain_with_subdomain_d11.id,
+            self.nuagenetworkdata[
+                "network_domain_with_subdomain_access"]["gateway"])
+        self.verify_vsd_enterprise_vm(
+            self.account_d11a.domainid,
+            self.shared_network_domain_with_subdomain_d11,
+            self.vmvpc2, sharedsubnetid=subnet_id)
+
+    @staticmethod
+    def generateKeysForUser(api_client, account):
+        user = User.list(
+            api_client,
+            account=account.name,
+            domainid=account.domainid
+        )[0]
+
+        return (User.registerUserKeys(
+            api_client,
+            user.id
+        ))

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/test/integration/plugins/nuagevsp/test_nuage_source_nat.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_source_nat.py b/test/integration/plugins/nuagevsp/test_nuage_source_nat.py
index f0b2319..2d9e3b9 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_source_nat.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_source_nat.py
@@ -218,11 +218,11 @@ class TestNuageSourceNat(nuageTestCase):
         Source NAT service providers
         """
 
-        # 1. Create Nuage VSP Isolated Network offering with different
-        #    combinations of Source NAT service providers
-        #    (NuageVsp, VirtualRouter, no SourceNat service), check if only the
-        #    network offering with Source NAT service provider as NuageVsp is
-        #    successfully created and enabled.
+        # 1. Create Nuage VSP Isolated Network offerings and corresponding
+        #    Isolated networks with different combinations of Source NAT
+        #    service providers (NuageVsp, VirtualRouter, no SourceNat service),
+        #    check if only the Isolated networks with Source NAT service
+        #    provider as NuageVsp are successfully created.
         # 2. Recreate the above created Network offering with ispersistent flag
         #    set to True, check if the network offering is successfully created
         #    and enabled.
@@ -303,10 +303,7 @@ class TestNuageSourceNat(nuageTestCase):
             'Dhcp,Connectivity,StaticNat,UserData,Firewall,Dns'
         del network_offering["serviceProviderList"]["SourceNat"]
         del network_offering["serviceCapabilityList"]
-        with self.assertRaises(Exception):
-            self.create_NetworkOffering(network_offering)
-        self.debug("Nuage VSP does not support Network offerings without "
-                   "Source NAT service")
+        net_off_4 = self.create_NetworkOffering(network_offering)
 
         # Creating Isolated networks, and deploying VMs
         self.debug("Creating an Isolated network with Source NAT service "
@@ -376,6 +373,13 @@ class TestNuageSourceNat(nuageTestCase):
         # VSD verification for Source NAT functionality
         self.verify_vsd_SourceNAT_network(network_3)
 
+        self.debug("Creating an Isolated network without Source NAT "
+                   "service...")
+        with self.assertRaises(Exception):
+            self.create_Network(net_off_4, gateway='10.1.4.1')
+        self.debug("Nuage VSP does not support creation of Isolated networks "
+                   "without Source NAT service")
+
     @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
     def test_02_nuage_SourceNAT_vpc_networks(self):
         """Test Nuage VSP VPC networks with different combinations of Source

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py b/test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
index 0cb9b15..97319aa 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
@@ -167,12 +167,79 @@ class TestNuageInternalLb(nuageTestCase):
         self.debug("InternalLbVm instance - %s is in the expected state - %s" %
                    (internal_lb_vms[0].name, state))
 
+    # verify_vpc_vm_ingress_traffic - Verifies ingress traffic to the given VM
+    # (SSH into VM) via a created Static NAT rule in the given VPC network
+    def verify_vpc_vm_ingress_traffic(self, vm, network, vpc):
+        self.debug("Verifying ingress traffic to the VM (SSH into VM) - %s "
+                   "via a created Static NAT rule in the VPC network - %s" %
+                   (vm, network))
+
+        # Creating Static NAT rule for the given VM in the given VPC network
+        self.debug("Creating Static NAT Rule...")
+        test_public_ip = self.acquire_PublicIPAddress(network, vpc)
+        self.validate_PublicIPAddress(test_public_ip, network)
+        self.create_StaticNatRule_For_VM(vm, test_public_ip, network)
+        self.validate_PublicIPAddress(
+            test_public_ip, network, static_nat=True, vm=vm)
+
+        # VSD verification
+        self.verify_vsd_floating_ip(network, vm, test_public_ip.ipaddress, vpc)
+
+        # Adding Network ACL rule in the given VPC network
+        self.debug("Creating Network ACL rule ...")
+        test_public_ssh_rule = self.create_NetworkAclRule(
+            self.test_data["ingress_rule"], network=network)
+
+        # VSD verification
+        self.verify_vsd_firewall_rule(test_public_ssh_rule)
+
+        # SSH into VM
+        self.debug("Verifying VM ingress traffic (SSH into VM)...")
+        self.ssh_into_VM(vm, test_public_ip)
+
+        # Removing Network ACL rule in the given VPC network
+        self.debug("Removing the created Network ACL rule...")
+        test_public_ssh_rule.delete(self.api_client)
+
+        # VSD verification
+        with self.assertRaises(Exception):
+            self.verify_vsd_firewall_rule(test_public_ssh_rule)
+        self.debug("Network ACL rule successfully deleted in VSD")
+
+        # Deleting Static NAT Rule
+        self.debug("Deleting the created Static NAT Rule...")
+        self.delete_StaticNatRule_For_VM(test_public_ip)
+        with self.assertRaises(Exception):
+            self.validate_PublicIPAddress(
+                test_public_ip, network, static_nat=True, vm=vm)
+        self.debug("Static NAT Rule successfully deleted in CloudStack")
+
+        # VSD verification
+        with self.assertRaises(Exception):
+            self.verify_vsd_floating_ip(
+                network, vm, test_public_ip.ipaddress, vpc=vpc)
+        self.debug("Floating IP successfully deleted in VSD")
+
+        # Releasing acquired public IP
+        self.debug("Releasing the acquired public IP...")
+        test_public_ip.delete(self.api_client)
+        with self.assertRaises(Exception):
+            self.validate_PublicIPAddress(test_public_ip, network)
+        self.debug("Acquired public IP in the network successfully released "
+                   "in CloudStack")
+
+        self.debug("Successfully verified ingress traffic to the VM "
+                   "(SSH into VM) - %s via a created Static NAT rule in the "
+                   "VPC network - %s" % (vm, network))
+
     # wget_from_vm_cmd - From within the given VM (ssh client),
     # fetches index.html file of web server running with the given public IP
     def wget_from_vm_cmd(self, ssh_client, ip_address, port):
         wget_file = ""
-        cmd = "wget --no-cache --output-document=index.html -t 1 http://" + \
-              ip_address + ":" + str(port) + "/"
+        cmd = "rm -rf index.html*"
+        self.execute_cmd(ssh_client, cmd)
+        cmd = "wget --no-cache -t 1 http://" + ip_address + ":" + str(port) + \
+              "/"
         response = self.execute_cmd(ssh_client, cmd)
         if "200 OK" in response:
             self.debug("wget from a VM with http server IP address "
@@ -181,7 +248,7 @@ class TestNuageInternalLb(nuageTestCase):
             cmd = "cat index.html"
             wget_file = self.execute_cmd(ssh_client, cmd)
             # Removing the wget file
-            cmd = "rm -r index.html"
+            cmd = "rm -rf index.html*"
             self.execute_cmd(ssh_client, cmd)
         else:
             self.debug("Failed to wget from a VM with http server IP address "
@@ -198,11 +265,11 @@ class TestNuageInternalLb(nuageTestCase):
                 if str(nic.ipaddress) in str(wget_file):
                     wget_server_ip = str(nic.ipaddress)
         if wget_server_ip:
-            self.debug("Verified wget file from an Internal Load Balanced VM "
-                       "with http server IP address - %s" % wget_server_ip)
+            self.debug("Verified wget file from Internal Load Balanced VMs - "
+                       "%s" % vm_array)
         else:
-            self.fail("Did not wget file from the Internal Load Balanced VMs "
-                      "- %s" % vm_array)
+            self.fail("Failed to verify wget file from Internal Load Balanced "
+                      "VMs - %s" % vm_array)
         return wget_server_ip
 
     # validate_internallb_algorithm_traffic - Validates Internal LB algorithms
@@ -1207,9 +1274,7 @@ class TestNuageInternalLb(nuageTestCase):
 
         # Adding Network ACL rules in the Internal tier
         self.debug("Adding Network ACL rules to make the created Internal LB "
-                   "rules (SSH & HTTP) accessible...")
-        ssh_rule = self.create_NetworkAclRule(
-            self.test_data["ingress_rule"], network=internal_tier_1)
+                   "rules (HTTP) accessible...")
         http_rule_1 = self.create_NetworkAclRule(
             self.test_data["http_rule"], network=internal_tier_1)
         http_rule = copy.deepcopy(self.test_data["http_rule"])
@@ -1221,7 +1286,6 @@ class TestNuageInternalLb(nuageTestCase):
             http_rule, network=internal_tier_1)
 
         # VSD verification
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule_1)
         self.verify_vsd_firewall_rule(http_rule_2)
 
@@ -1294,19 +1358,33 @@ class TestNuageInternalLb(nuageTestCase):
 
         # Adding Network ACL rules in the Internal tier
         self.debug("Adding Network ACL rules to make the created Internal LB "
-                   "rules (SSH & HTTP) accessible...")
-        ssh_rule = self.create_NetworkAclRule(
-            self.test_data["ingress_rule"], network=internal_tier_2)
+                   "rules (HTTP) accessible...")
         http_rule_1 = self.create_NetworkAclRule(
             self.test_data["http_rule"], network=internal_tier_2)
         http_rule_2 = self.create_NetworkAclRule(
             http_rule, network=internal_tier_2)
 
         # VSD verification
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule_1)
         self.verify_vsd_firewall_rule(http_rule_2)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_1, internal_tier_1, vpc)
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_1_1, internal_tier_1, vpc)
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_1_2, internal_tier_1, vpc)
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_2, internal_tier_2, vpc)
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_2_1, internal_tier_2, vpc)
+        self.verify_vpc_vm_ingress_traffic(
+            internal_vm_2_2, internal_tier_2, vpc)
+
         # Creating Static NAT rule for the VM in the Public tier
         public_ip = self.acquire_PublicIPAddress(public_tier, vpc)
         self.validate_PublicIPAddress(public_ip, public_tier)
@@ -1548,16 +1626,21 @@ class TestNuageInternalLb(nuageTestCase):
 
         # Adding Network ACL rules in the Internal tier
         self.debug("Adding Network ACL rules to make the created Internal LB "
-                   "rules (SSH & HTTP) accessible...")
-        ssh_rule = self.create_NetworkAclRule(
-            self.test_data["ingress_rule"], network=internal_tier)
+                   "rules (HTTP) accessible...")
         http_rule = self.create_NetworkAclRule(
             self.test_data["http_rule"], network=internal_tier)
 
         # VSD verification
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Creating Static NAT rule for the VM in the Public tier
         public_ip = self.acquire_PublicIPAddress(public_tier, vpc)
         self.validate_PublicIPAddress(public_ip, public_tier)
@@ -1742,16 +1825,21 @@ class TestNuageInternalLb(nuageTestCase):
 
         # Adding Network ACL rules in the Internal tier
         self.debug("Adding Network ACL rules to make the created Internal LB "
-                   "rules (SSH & HTTP) accessible...")
-        ssh_rule = self.create_NetworkAclRule(
-            self.test_data["ingress_rule"], network=internal_tier)
+                   "rules (HTTP) accessible...")
         http_rule = self.create_NetworkAclRule(
             self.test_data["http_rule"], network=internal_tier)
 
         # VSD verification
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Creating Static NAT rule for the VM in the Public tier
         public_ip = self.acquire_PublicIPAddress(public_tier, vpc)
         self.validate_PublicIPAddress(public_ip, public_tier)
@@ -1798,7 +1886,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_vm(internal_vm)
         self.verify_vsd_vm(internal_vm_1)
         self.verify_vsd_vm(internal_vm_2)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -1811,6 +1898,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -1837,7 +1932,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_vm(internal_vm)
         self.verify_vsd_vm(internal_vm_1)
         self.verify_vsd_vm(internal_vm_2)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -1850,6 +1944,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -1885,6 +1987,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -1920,6 +2030,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -1949,7 +2067,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_vm(internal_vm, stopped=True)
         self.verify_vsd_vm(internal_vm_1, stopped=True)
         self.verify_vsd_vm(internal_vm_2, stopped=True)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -1991,7 +2108,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_vm(internal_vm)
         self.verify_vsd_vm(internal_vm_1)
         self.verify_vsd_vm(internal_vm_2)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -2001,6 +2117,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         tries = 0
@@ -2047,7 +2171,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_floating_ip(
             public_tier, public_vm, public_ip.ipaddress, vpc)
         self.verify_vsd_firewall_rule(public_ssh_rule)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -2057,6 +2180,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2094,7 +2225,6 @@ class TestNuageInternalLb(nuageTestCase):
         self.verify_vsd_floating_ip(
             public_tier, public_vm, public_ip.ipaddress, vpc)
         self.verify_vsd_firewall_rule(public_ssh_rule)
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
         # Validating InternalLbVm state
@@ -2104,6 +2234,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2259,16 +2397,21 @@ class TestNuageInternalLb(nuageTestCase):
 
         # Adding Network ACL rules in the Internal tier
         self.debug("Adding Network ACL rules to make the created Internal LB "
-                   "rules (SSH & HTTP) accessible...")
-        ssh_rule = self.create_NetworkAclRule(
-            self.test_data["ingress_rule"], network=internal_tier)
+                   "rules (HTTP) accessible...")
         http_rule = self.create_NetworkAclRule(
             self.test_data["http_rule"], network=internal_tier)
 
         # VSD verification
-        self.verify_vsd_firewall_rule(ssh_rule)
         self.verify_vsd_firewall_rule(http_rule)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Creating Static NAT rule for the VM in the Public tier
         public_ip = self.acquire_PublicIPAddress(public_tier, vpc)
         self.validate_PublicIPAddress(public_ip, public_tier)
@@ -2307,6 +2450,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm, stopped=True)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2328,6 +2479,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2358,6 +2517,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm, stopped=True)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2379,6 +2546,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2397,6 +2572,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm, stopped=True)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(
@@ -2418,6 +2601,14 @@ class TestNuageInternalLb(nuageTestCase):
         # VSD Verification
         self.verify_vsd_lb_device(int_lb_vm)
 
+        # Verifying Internal Load Balanced VMs ingress traffic
+        # (SSH into VM via Static NAT rule)
+        self.debug("Verifying Internal Load Balanced VMs ingress traffic "
+                   "(SSH into VM via Static NAT rule)...")
+        self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
+        self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
+
         # Internal LB (wget) traffic test
         ssh_client = self.ssh_into_VM(public_vm, public_ip)
         wget_file = self.wget_from_vm_cmd(

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/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 ca16efb..0885177 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
@@ -20,7 +20,7 @@ Nuage VSP SDN plugin
 """
 # Import Local Modules
 from nuageTestCase import nuageTestCase
-from marvin.lib.base import Account, Zone
+from marvin.lib.base import Account
 # Import System Modules
 from nose.plugins.attrib import attr
 
@@ -123,13 +123,12 @@ class TestNuageVpcNetwork(nuageTestCase):
 
         self.debug("Testing basic VPC Network functionality with Nuage VSP "
                    "SDN plugin on multiple zones...")
-        zones = Zone.list(self.api_client)
-        if len(zones) == 1:
+        if len(self.zones) == 1:
             self.skipTest("There is only one Zone configured: skipping test")
-        for zone in zones:
+        for zone in self.zones:
             self.debug("Zone - %s" % zone.name)
             # Get Zone details
-            self.getZoneDetails()
+            self.getZoneDetails(zone=zone)
             # Configure VSD sessions
             self.configureVSDSessions()
             self.test_nuage_vpc_network()

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/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 38b5b23..9f2d1f2 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vsp.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vsp.py
@@ -97,59 +97,66 @@ class TestNuageVsp(nuageTestCase):
         #    valid VSD credentials, verify that the Nuage VSP device is
         #    successfully added in the Nuage VSP Physical Network.
 
-        # Nuage VSP network service provider validation
-        self.debug("Validating the Nuage VSP network service provider in the "
-                   "Nuage VSP Physical Network...")
-        self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")
-
-        # Nuage VSP device validation
-        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
-                   "Network...")
-        self.validate_NuageVspDevice()
-
-        # Nuage VSP device deletion
-        self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical "
-                   "Network...")
-        self.delete_NuageVspDevice()
-
-        # Nuage VSP device validation
-        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
-                   "Network...")
-        with self.assertRaises(Exception):
+        for zone in self.zones:
+            self.debug("Zone - %s" % zone.name)
+            # Get Zone details
+            self.getZoneDetails(zone=zone)
+            # Configure VSD sessions
+            self.configureVSDSessions()
+
+            # Nuage VSP network service provider validation
+            self.debug("Validating the Nuage VSP network service provider in "
+                       "the Nuage VSP Physical Network...")
+            self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")
+
+            # Nuage VSP device validation
+            self.debug("Validating the Nuage VSP device in the Nuage VSP "
+                       "Physical Network...")
             self.validate_NuageVspDevice()
-        self.debug("Successfully deleted the Nuage VSP device in the Nuage "
-                   "VSP Physical Network")
-
-        # Adding the Nuage VSP device with invalid VSD credentials
-        self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
-                   "Network with invalid VSD credentials...")
-        vsd_info = self.nuage_vsp_device.__dict__
-        invalid_vsd_info = copy.deepcopy(vsd_info)
-        invalid_vsd_info["password"] = ""
-        with self.assertRaises(Exception):
-            Nuage.add(
-                self.api_client, invalid_vsd_info,
-                self.vsp_physical_network.id)
-        self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
-                   "Physical Network due to invalid VSD credentials")
-
-        # Nuage VSP device validation
-        self.debug("Validating the Nuage VSP device in the Nuage VSP "
-                   "Physical Network...")
-        with self.assertRaises(Exception):
-            self.validate_NuageVspDevice()
-        self.debug("The Nuage VSP device is not added in the Nuage VSP "
-                   "Physical Network")
 
-        # Adding the Nuage VSP device with valid VSD credentials
-        self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
-                   "Network with valid VSD credentials...")
-        Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)
-
-        # Nuage VSP device validation
-        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
-                   "Network...")
-        self.validate_NuageVspDevice()
+            # Nuage VSP device deletion
+            self.debug("Deleting the Nuage VSP device in the Nuage VSP "
+                       "Physical Network...")
+            self.delete_NuageVspDevice()
+
+            # Nuage VSP device validation
+            self.debug("Validating the Nuage VSP device in the Nuage VSP "
+                       "Physical Network...")
+            with self.assertRaises(Exception):
+                self.validate_NuageVspDevice()
+            self.debug("Successfully deleted the Nuage VSP device in the "
+                       "Nuage VSP Physical Network")
+
+            # Adding the Nuage VSP device with invalid VSD credentials
+            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
+                       "Network with invalid VSD credentials...")
+            vsd_info = self.nuage_vsp_device.__dict__
+            invalid_vsd_info = copy.deepcopy(vsd_info)
+            invalid_vsd_info["password"] = ""
+            with self.assertRaises(Exception):
+                Nuage.add(
+                    self.api_client, invalid_vsd_info,
+                    self.vsp_physical_network.id)
+            self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
+                       "Physical Network due to invalid VSD credentials")
+
+            # Nuage VSP device validation
+            self.debug("Validating the Nuage VSP device in the Nuage VSP "
+                       "Physical Network...")
+            with self.assertRaises(Exception):
+                self.validate_NuageVspDevice()
+            self.debug("The Nuage VSP device is not added in the Nuage VSP "
+                       "Physical Network")
+
+            # Adding the Nuage VSP device with valid VSD credentials
+            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
+                       "Network with valid VSD credentials...")
+            Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)
+
+            # Nuage VSP device validation
+            self.debug("Validating the Nuage VSP device in the Nuage VSP "
+                       "Physical Network...")
+            self.validate_NuageVspDevice()
 
     @attr(tags=["advanced", "nuagevsp"], required_hardware="false")
     def test_nuage_vsp(self):
@@ -172,49 +179,56 @@ class TestNuageVsp(nuageTestCase):
         #    check if the Isolated network is successfully deleted.
         # 7. Delete all the created objects (cleanup).
 
-        # Creating a network offering
-        self.debug("Creating and enabling Nuage VSP Isolated Network "
-                   "offering...")
-        network_offering = self.create_NetworkOffering(
-            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)
-        self.validate_Network(network, state="Allocated")
-
-        # Deploying a VM in the network
-        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")
-
-        # VSD verification
-        self.verify_vsd_network(self.domain.id, network)
-        self.verify_vsd_router(vr)
-        self.verify_vsd_vm(vm_1)
-
-        # Deploying one more VM in the network
-        vm_2 = self.create_VM(network)
-        self.check_VM_state(vm_2, state="Running")
-
-        # VSD verification
-        self.verify_vsd_vm(vm_2)
-
-        # Deleting the network
-        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.debug("Isolated Network successfully deleted in CloudStack")
-
-        # VSD verification
-        with self.assertRaises(Exception):
+        for zone in self.zones:
+            self.debug("Zone - %s" % zone.name)
+            # Get Zone details
+            self.getZoneDetails(zone=zone)
+            # Configure VSD sessions
+            self.configureVSDSessions()
+
+            # Creating a network offering
+            self.debug("Creating and enabling Nuage VSP Isolated Network "
+                       "offering...")
+            network_offering = self.create_NetworkOffering(
+                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)
+            self.validate_Network(network, state="Allocated")
+
+            # Deploying a VM in the network
+            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")
+
+            # VSD verification
             self.verify_vsd_network(self.domain.id, network)
-        self.debug("Isolated Network successfully deleted in VSD")
+            self.verify_vsd_router(vr)
+            self.verify_vsd_vm(vm_1)
+
+            # Deploying one more VM in the network
+            vm_2 = self.create_VM(network)
+            self.check_VM_state(vm_2, state="Running")
+
+            # VSD verification
+            self.verify_vsd_vm(vm_2)
+
+            # Deleting the network
+            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.debug("Isolated Network successfully deleted in CloudStack")
+
+            # VSD verification
+            with self.assertRaises(Exception):
+                self.verify_vsd_network(self.domain.id, network)
+            self.debug("Isolated Network successfully deleted in VSD")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/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 d84eac9..c4d1aed 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -1847,6 +1847,100 @@ test_data = {
                 "UserData": "VpcVirtualRouter",
                 "Dns": "VpcVirtualRouter"
             }
+        },
+        "shared_nuage_network_offering": {
+            "name": 'nuage_marvin',
+            "displaytext": 'nuage_marvin',
+            "guestiptype": 'shared',
+            "supportedservices": 'Dhcp,Connectivity',
+            "traffictype": 'GUEST',
+            "specifyVlan": "False",
+            "specifyIpRanges": "True",
+            "availability": 'Optional',
+            "serviceProviderList": {
+                "Dhcp": "NuageVsp",
+                "Connectivity": "NuageVsp"
+            }
+        },
+        "shared_nuage_public_network_offering": {
+            "name": 'nuage_marvin',
+            "displaytext": 'nuage_marvin',
+            "guestiptype": 'shared',
+            "supportedservices": 'Dhcp,Connectivity',
+            "traffictype": 'GUEST',
+            "specifyVlan": "False",
+            "specifyIpRanges": "True",
+            "availability": 'Optional',
+            "serviceProviderList": {
+                "Dhcp": "NuageVsp",
+                "Connectivity": "NuageVsp"
+            },
+            "serviceCapabilityList": {
+                "Connectivity": {
+                    "PublicAccess": "true"
+                }
+            }
+
+        },
+        # Test data for Shared Network creation
+        "network_all": {
+            "name": "SharedNetwork-All-nuage",
+            "displaytext": "SharedNetwork-All-nuage",
+            "gateway": "10.223.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.223.1.21",
+            "endip": "10.223.1.100",
+            "acltype": "Domain"
+        },
+        "network_domain_with_no_subdomain_access": {
+            "name": "SharedNetwork-Domain-nosubdomain-nuage",
+            "displaytext": "SharedNetwork-Domain-nosubdomain-nuage",
+            "gateway": "10.222.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.222.1.2",
+            "endip": "10.222.1.100",
+            "acltype": "Domain",
+            "subdomainaccess": "false"
+        },
+        "network_domain_with_subdomain_access": {
+            "name": "SharedNetwork-Domain-withsubdomain-nuage",
+            "displaytext": "SharedNetwork-Domain-withsubdomain-nuage",
+            "gateway": "10.221.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.221.1.2",
+            "endip": "10.221.1.100",
+            "acltype": "Domain",
+            "subdomainaccess": "true"
+        },
+        "network_account": {
+            "name": "SharedNetwork-Account-nuage",
+            "displaytext": "SharedNetwork-Account-nuage",
+            "gateway": "10.220.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.220.1.2",
+            "endip": "10.220.1.100",
+            "acltype": "Account"
+        },
+        "publiciprange1": {
+            "gateway": "10.223.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.223.1.101",
+            "endip": "10.223.1.105",
+            "forvirtualnetwork": "false"
+        },
+        "publiciprange2": {
+            "gateway": "10.219.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.219.1.2",
+            "endip": "10.219.1.5",
+            "forvirtualnetwork": "false"
+        },
+        "publiciprange3": {
+            "gateway": "10.223.1.1",
+            "netmask": "255.255.255.0",
+            "startip": "10.223.1.2",
+            "endip": "10.223.1.20",
+            "forvirtualnetwork": "false"
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index 474fde5..c0cc28a 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -513,7 +513,7 @@ class VirtualMachine:
 
         if ipaddress:
             cmd.ipaddress = ipaddress
-        elif ipaddress in services:
+        elif "ipaddress" in services:
             cmd.ipaddress = services["ipaddress"]
 
         if securitygroupids:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/ui/l10n/en.js
----------------------------------------------------------------------
diff --git a/ui/l10n/en.js b/ui/l10n/en.js
index 3fc3631..075a0d8 100644
--- a/ui/l10n/en.js
+++ b/ui/l10n/en.js
@@ -1575,6 +1575,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
 "label.supported.services":"Supported Services",
 "label.supported.source.NAT.type":"Supported Source NAT type",
 "label.supportsstrechedl2subnet":"Supports Streched L2 Subnet",
+"label.supportspublicaccess":"Supports Public Access",
 "label.suspend.project":"Suspend Project",
 "label.switch.type":"Switch Type",
 "label.system.capacity":"System Capacity",

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c91c9c5/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 81770f4..512ccf7 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -2367,6 +2367,7 @@
                                     var $serviceofferingid = args.$form.find('.form-item[rel=serviceofferingid]');
                                     var $conservemode = args.$form.find('.form-item[rel=conservemode]');
                                     var $supportsstrechedl2subnet = args.$form.find('.form-item[rel=supportsstrechedl2subnet]');
+                                    var $supportspublicaccess = args.$form.find('.form-item[rel=supportspublicaccess]');
                                     var $serviceSourceNatRedundantRouterCapabilityCheckbox = args.$form.find('.form-item[rel="service.SourceNat.redundantRouterCapabilityCheckbox"]');
                                     var hasAdvancedZones = false;
 
@@ -2675,6 +2676,20 @@
                                         } else {
                                             $supportsstrechedl2subnet.hide();
                                         }
+
+                                        //PublicAccess checkbox should be displayed only when 'Connectivity' service is checked
+                                        if (args.$form.find('.form-item[rel=\"service.Connectivity.isEnabled\"]').find('input[type=checkbox]').is(':checked') && $guestTypeField.val() == 'Shared' &&
+                                            args.$form.find('.form-item[rel=\"service.Connectivity.provider\"]').find('select').val() == 'NuageVsp') {
+                                            $supportspublicaccess.css('display', 'inline-block');
+                                        } else {
+                                            $supportspublicaccess.hide();
+                                        }
+
+                                        //Uncheck specifyVlan checkbox when (1)guest type is Shared and (2)NuageVsp is selected as a Connectivity provider
+                                        if ($guestTypeField.val() == 'Shared') {
+                                            var $specifyVlanCheckbox = args.$form.find('.form-item[rel=specifyVlan]').find('input[type=checkbox]');
+                                            $specifyVlanCheckbox.attr('checked', args.$form.find('.form-item[rel=\"service.Connectivity.provider\"]').find('select').val() != 'NuageVsp')
+                                        }
                                     });
 
                                     args.$form.change();
@@ -3055,6 +3070,13 @@
                                         isHidden: true
                                     },
 
+                                    supportspublicaccess: {
+                                        label: 'label.supportspublicaccess',
+                                        isBoolean: true,
+                                        isChecked: false,
+                                        isHidden: true
+                                    },
+
                                     conservemode: {
                                         label: 'label.conserve.mode',
                                         isBoolean: true,
@@ -3187,18 +3209,23 @@
                                     }
                                 }
 
-                                //passing supportsstrechedl2subnet's value as capability
+                                //passing supportsstrechedl2subnet and supportspublicaccess's value as capability
                                 for (var k in inputData) {
                                     if (k == 'supportsstrechedl2subnet' && ("Connectivity" in serviceProviderMap)) {
-                                            inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'Connectivity';
-                                            inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'StretchedL2Subnet';
-                                            inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = true;
-                                            serviceCapabilityIndex++;
-                                            break;
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'Connectivity';
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'StretchedL2Subnet';
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = true;
+                                        serviceCapabilityIndex++;
+                                    } else if (k == 'supportspublicaccess' && ("Connectivity" in serviceProviderMap) && serviceProviderMap['Connectivity'] == 'NuageVsp') {
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'Connectivity';
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'PublicAccess';
+                                        inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = true;
+                                        serviceCapabilityIndex++;
                                     }
                                 }
-                                //removing supportsstrechedl2subnet from parameters, it has been set as capability
+                                //removing supportsstrechedl2subnet and supportspublicaccess from parameters, it has been set as capability
                                 delete inputData['supportsstrechedl2subnet'];
+                                delete inputData['supportspublicaccess'];
 
                                 // Make supported services list
                                 inputData['supportedServices'] = $.map(serviceProviderMap, function(value, key) {
@@ -3207,7 +3234,8 @@
 
 
                                 if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
-                                    inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
+                                    var $specifyVlanCheckbox = args.$form.find('.form-item[rel=specifyVlan]').find('input[type=checkbox]');
+                                    inputData['specifyVlan'] = $specifyVlanCheckbox.is(':checked'); //hardcode inputData['specifyVlan']
                                     inputData['specifyIpRanges'] = true;
                                     delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)
                                 } else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown
@@ -3538,6 +3566,10 @@
                                         label: 'label.supportsstrechedl2subnet',
                                         converter: cloudStack.converters.toBooleanText
                                     },
+                                    supportspublicaccess: {
+                                        label: 'label.supportspublicaccess',
+                                        converter: cloudStack.converters.toBooleanText
+                                    },
                                     supportedServices: {
                                         label: 'label.supported.services'
                                     },


Mime
View raw message