cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject [2/2] git commit: updated refs/heads/pvlan to 2bcf716
Date Mon, 13 May 2013 21:55:24 GMT
PVLAN: Add integration test



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

Branch: refs/heads/pvlan
Commit: 2bcf71638dba9a252378c251bbd32e6f72f74028
Parents: 065d256
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu May 9 19:44:14 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Mon May 13 11:42:15 2013 -0700

----------------------------------------------------------------------
 test/integration/smoke/test_pvlan.py |   86 +++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bcf7163/test/integration/smoke/test_pvlan.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py
new file mode 100644
index 0000000..4eb76e1
--- /dev/null
+++ b/test/integration/smoke/test_pvlan.py
@@ -0,0 +1,86 @@
+# 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.
+""" test for private vlan isolation
+"""
+#Import Local Modules
+import marvin
+from marvin.cloudstackTestCase import *
+from marvin.cloudstackAPI import *
+from marvin import remoteSSHClient
+from marvin.integration.lib.utils import *
+from marvin.integration.lib.base import *
+from marvin.integration.lib.common import *
+from nose.plugins.attrib import attr
+import telnetlib
+
+#Import System modules
+import time
+_multiprocess_shared_ = True
+
+class TestPVLAN(cloudstackTestCase):
+
+    zoneId = 1
+    networkOfferingId = 7
+    vlan = 1234
+    isolatedpvlan = 567
+
+    def setUp(self):
+        self.apiClient = self.testClient.getApiClient()
+
+    def test_create_pvlan_network(self):
+        self.debug("Test create pvlan network")
+        createNetworkCmd = createNetwork.createNetworkCmd()
+        createNetworkCmd.name = "pvlan network"
+        createNetworkCmd.displaytext = "pvlan network"
+        createNetworkCmd.netmask = "255.255.255.0"
+        createNetworkCmd.gateway = "10.10.10.1"
+        createNetworkCmd.startip = "10.10.10.10"
+        createNetworkCmd.gateway = "10.10.10.20"
+        createNetworkCmd.vlan = "1234"
+        createNetworkCmd.isolatedpvlan = "567"
+        createNetworkCmd.zoneid = self.zoneId
+        createNetworkCmd.networkofferingid = self.networkOfferingId
+        createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
+        self.networkId = createNetworkResponse.id
+        self.broadcasttype = createNetworkResponse.broadcastdomaintype
+        self.broadcasturi = createNetworkResponse.broadcasturi
+
+        self.assertIsNotNone(createNetworkResponse.id, "Network failed to create")
+        self.assertTrue(createNetworkResponse.broadcastdomaintype, "Pvlan")
+        self.assertTrue(createNetworkResponse.broadcasturi, "pvlan://1234-i567")
+
+        self.debug("Clean up test pvlan network")
+        deleteNetworkCmd = deleteNetwork.deleteNetworkCmd()
+        deleteNetworkCmd.id = self.networkId;
+        self.apiClient.deleteNetwork(deleteNetworkCmd)
+
+        #Test invalid parameter
+
+        # CLOUDSTACK-2392: Should not allow create pvlan with ipv6
+        createNetworkCmd.ip6gateway="fc00:1234::1"
+        createNetworkCmd.ip6cidr="fc00:1234::/64"
+        createNetworkCmd.startipv6="fc00:1234::10"
+        createNetworkCmd.endipv6="fc00:1234::20"
+        err = 0;
+        try:
+            createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd)
+        except Exception as e:
+            err = 1;
+            self.debug("Try alloc with ipv6, got:%s" % e)
+        self.assertEqual(err, 1, "Shouldn't allow create PVLAN network with IPv6");
+
+


Mime
View raw message