You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/05/16 19:12:33 UTC
[12/39] git commit: updated refs/heads/ui-vpc-redesign to 8d9a8ca
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/ui-vpc-redesign
Commit: 2bcf71638dba9a252378c251bbd32e6f72f74028
Parents: 065d256
Author: Sheng Yang <sh...@citrix.com>
Authored: Thu May 9 19:44:14 2013 -0700
Committer: Sheng Yang <sh...@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");
+
+