Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A34F9200B72 for ; Fri, 26 Aug 2016 22:39:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A1D65160AB6; Fri, 26 Aug 2016 20:39:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C1819160A94 for ; Fri, 26 Aug 2016 22:38:59 +0200 (CEST) Received: (qmail 49774 invoked by uid 500); 26 Aug 2016 20:38:58 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 49763 invoked by uid 99); 26 Aug 2016 20:38:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2016 20:38:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20BC8E0200; Fri, 26 Aug 2016 20:38:58 +0000 (UTC) From: jburwell To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request #1659: CLOUDSTACK-9339 Virtual Routers don't handle ... Content-Type: text/plain Message-Id: <20160826203858.20BC8E0200@git1-us-west.apache.org> Date: Fri, 26 Aug 2016 20:38:58 +0000 (UTC) archived-at: Fri, 26 Aug 2016 20:39:00 -0000 Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1659#discussion_r76484431 --- Diff: test/integration/smoke/test_multiple_public_ip_ranges.py --- @@ -0,0 +1,887 @@ +# 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 services on public IP's from different public IP + range than that of associated source NAT IP of the network. Each IP associated + with network from a different public IP range results in a new public + interface on VR (eth3, eth4 etc) and iptable +""" +# Import Local Modules +from marvin.codes import (FAILED, STATIC_NAT_RULE, LB_RULE, + NAT_RULE, PASS) +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackException import CloudstackAPIException +from marvin.cloudstackAPI import rebootRouter +from marvin.sshClient import SshClient +from marvin.lib.utils import cleanup_resources, get_process_status +from marvin.lib.base import (Account, + VirtualMachine, + ServiceOffering, + NATRule, + PublicIPAddress, + StaticNATRule, + FireWallRule, + Network, + NetworkOffering, + LoadBalancerRule, + PublicIpRange, + Router, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + list_hosts, + list_publicIP, + list_nat_rules, + list_routers, + list_virtual_machines, + list_lb_rules, + list_configurations, + verifyGuestTrafficPortGroups) +from nose.plugins.attrib import attr +from ddt import ddt, data +# Import System modules +import socket +import time +import logging + +_multiprocess_shared_ = True + +logger = logging.getLogger('TestNetworkOps') +stream_handler = logging.StreamHandler() +logger.setLevel(logging.DEBUG) +logger.addHandler(stream_handler) + +class TestPortForwarding(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + + testClient = super(TestPortForwarding, cls).getClsTestClient() + cls.apiclient = testClient.getApiClient() + cls.services = testClient.getParsedTestDataConfig() + cls.hypervisor = testClient.getHypervisorInfo() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.apiclient) + cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["zoneid"] = cls.zone.id + template = get_template( + cls.apiclient, + cls.zone.id, + cls.services["ostype"] + ) + if template == FAILED: + assert False, "get_template() failed to return template with description %s" % cls.services[ + "ostype"] + + # Create an account, network, VM and IP addresses + cls.account = Account.create( + cls.apiclient, + cls.services["account"], + admin=True, + domainid=cls.domain.id + ) + cls.services["publiciprange"]["zoneid"] = cls.zone.id + cls.service_offering = ServiceOffering.create( + cls.apiclient, + cls.services["service_offerings"]["tiny"] + ) + cls.virtual_machine = VirtualMachine.create( + cls.apiclient, + cls.services["virtual_machine"], + templateid=template.id, + accountid=cls.account.name, + domainid=cls.account.domainid, + serviceofferingid=cls.service_offering.id + ) + cls._cleanup = [ + cls.virtual_machine, + cls.account, + cls.service_offering + ] + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.cleanup = [] + return + + @classmethod + def tearDownClass(cls): + try: + cls.apiclient = super( + TestPortForwarding, + cls).getClsTestClient().getApiClient() + cleanup_resources(cls.apiclient, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + def tearDown(self): + cleanup_resources(self.apiclient, self.cleanup) + return + + @attr(tags=["advanced", "smoke"], required_hardware="true") + def test_port_forwarding_on_ip_from_non_src_nat_ip_range(self): + """Test for port forwarding on a IP which is in pubic IP range different + from public IP range that has source NAT IP associated with network + """ + + # Validate the following: + # 1. Create a new public IP range and dedicate to a account + # 2. Acquire a IP from new public range + # 3. create a port forwarding on acquired IP from new range + # 4. Create a firewall rule to open up the port + # 5. Test SSH works to the VM + + self.public_ip_range = PublicIpRange.create( + self.apiclient, + self.services["publiciprange"] + ) + --- End diff -- Add an assertion to validate the ``this.public_ip_range`` is not ``None`` or has an error. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---