weizhouapache commented on a change in pull request #5786:
URL: https://github.com/apache/cloudstack/pull/5786#discussion_r807841272



##########
File path: test/integration/smoke/test_network_ipv6.py
##########
@@ -0,0 +1,357 @@
+# 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.
+""" BVT tests for Network offerings"""
+
+#Import Local Modules
+from marvin.codes import FAILED
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import (listNetworkOfferings,
+                                  listGuestNetworkIpv6Prefixes)
+from marvin.lib.utils import (isAlmostEqual,
+                              cleanup_resources,
+                              random_gen)
+from marvin.lib.base import (Domain,
+                             NetworkOffering,
+                             Account,
+                             PublicIpRange,
+                             Network,
+                             Router,
+                             ServiceOffering,
+                             VirtualMachine,
+                             NIC)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               list_hosts,
+                               get_test_template)
+from nose.plugins.attrib import attr
+
+import time
+from marvin.sshClient import SshClient
+from marvin.cloudstackException import CloudstackAPIException
+from marvin.lib.decoratorGenerators import skipTestIf
+
+
+_multiprocess_shared_ = True
+
+class TestCreateIpv6NetworkOffering(cloudstackTestCase):
+
+    def setUp(self):
+        self.services = self.testClient.getParsedTestDataConfig()
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+        return
+
+    def tearDown(self):
+        try:
+            #Clean up, terminate the created templates
+            cleanup_resources(self.apiclient, self.cleanup)
+
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    @classmethod
+    def setUpClass(cls):
+        testClient = super(TestCreateIpv6NetworkOffering, 
cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
+        cls._cleanup = []
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            cls.apiclient = super(
+                TestCreateIpv6NetworkOffering,
+                cls).getClsTestClient().getApiClient()
+            # Clean up, terminate the created templates
+            cleanup_resources(cls.apiclient, cls._cleanup)
+
+        except Exception as e:
+            raise Exception("Warning: Exception during class cleanup : %s" % e)
+
+    @attr(
+        tags=[
+            "advanced",
+            "basic",
+            "eip",
+            "sg",
+            "advancedns",
+            "smoke"],
+        required_hardware="false")
+    def test_01_create_ipv6_network_offering(self):
+        """Test to create network offering
+
+        # Validate the following:
+        # 1. createNetworkOfferings should return valid info for new offering
+        # 2. The Cloud Database contains the valid information
+        """
+        ipv6_service = self.services["network_offering"]
+        ipv6_service["internetprotocol"] = "dualstack"
+        network_offering = NetworkOffering.create(
+            self.apiclient,
+            ipv6_service
+        )
+        self.cleanup.append(network_offering)
+
+        self.debug("Created Network offering with ID: %s" % 
network_offering.id)
+
+        cmd = listNetworkOfferings.listNetworkOfferingsCmd()
+        cmd.id = network_offering.id
+        list_network_off_response = self.apiclient.listNetworkOfferings(cmd)
+        self.assertEqual(
+            isinstance(list_network_off_response, list),
+            True,
+            "Check list response returns a valid list"
+        )
+        self.assertNotEqual(
+            len(list_network_off_response),
+            0,
+            "Check Network offering is created"
+        )
+        network_off_response = list_network_off_response[0]
+
+        self.assertEqual(
+            network_off_response.id,
+            network_offering.id,
+            "Check server id in createNetworkOffering"
+        )
+        self.assertEqual(
+            network_off_response.details.internetProtocol.lower(),
+            ipv6_service["internetprotocol"].lower(),
+            "Check internetprotocol in createNetworkOffering"
+        )
+        return
+
+class TestIpv6Network(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        testClient = super(TestIpv6Network, cls).getClsTestClient()
+        cls.services = testClient.getParsedTestDataConfig()
+        cls.apiclient = testClient.getApiClient()
+        cls.dbclient = testClient.getDbConnection()
+        cls._cleanup = []
+
+        cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
+        cls.services['mode'] = cls.zone.networktype
+        cls.ipv6NotSupported = False
+
+
+        cmd = listGuestNetworkIpv6Prefixes.listGuestNetworkIpv6PrefixesCmd()

Review comment:
       @shwstppr 
   can you add test ipv6 ranges to test_data.py and create ipv6 range in this 
test ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to