Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9668C18E2C for ; Fri, 11 Mar 2016 01:04:17 +0000 (UTC) Received: (qmail 73732 invoked by uid 500); 11 Mar 2016 01:04:17 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 73678 invoked by uid 500); 11 Mar 2016 01:04:17 -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 73667 invoked by uid 99); 11 Mar 2016 01:04:16 -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, 11 Mar 2016 01:04:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CB8A7DFB8A; Fri, 11 Mar 2016 01:04:16 +0000 (UTC) From: shivsg To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-9304: Add nuagevsp userdata te... Content-Type: text/plain Message-Id: <20160311010416.CB8A7DFB8A@git1-us-west.apache.org> Date: Fri, 11 Mar 2016 01:04:16 +0000 (UTC) Github user shivsg commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1431#discussion_r55776272 --- Diff: test/integration/component/test_nuage_vsp.py --- @@ -1,334 +0,0 @@ -# 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. - -""" P1 tests for NuageVsp network Plugin -""" -# Import Local Modules -from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (listPhysicalNetworks, - listNetworkServiceProviders, - addNetworkServiceProvider, - deleteNetworkServiceProvider, - deleteNuageVspDevice, - updateNetworkServiceProvider, - addNuageVspDevice, - destroyVirtualMachine) -from marvin.lib.utils import (cleanup_resources) -from marvin.lib.base import (Account, - VirtualMachine, - ServiceOffering, - NetworkOffering, - Network) -from marvin.lib.common import (get_domain, - get_zone, - get_template) - -import logging -import unittest - - -class Services: - - """Test NuageVsp plugin - """ - - def __init__(self): - print "in __init__" - self.services = { - "account": { - "email": "cloudstack@cloudmonkey.com", - "firstname": "cloudstack", - "lastname": "bob", - "username": "admin", - "password": "password", - }, - "service_offering": { - "name": "Tiny Instance", - "displaytext": "Tiny Instance", - "cpunumber": 1, - "cpuspeed": 100, # in MHz - "memory": 128, # In MBs - }, - "virtual_machine": { - "displayname": "TestVM", - "username": "root", - "password": "password", - "ssh_port": 22, - "hypervisor": 'KVM', - "privateport": 22, - "publicport": 22, - "protocol": 'TCP', - }, - "nuage_vsp_device": { - "hostname": '172.31.222.162', - "username": 'cloudstackuser1', - "password": 'cloudstackuser1', - "port": '8443', - "apiversion": 'v3_2', - "retrycount": '4', - "retryinterval": '60' - }, - # services supported by Nuage for isolated networks. - "network_offering": { - "name": 'nuage_marvin', - "displaytext": 'nuage_marvin', - "guestiptype": 'Isolated', - "supportedservices": - 'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall', - "traffictype": 'GUEST', - "availability": 'Optional', - "serviceProviderList": { - "UserData": 'VirtualRouter', - "Dhcp": 'NuageVsp', - "Connectivity": 'NuageVsp', - "StaticNat": 'NuageVsp', - "SourceNat": 'NuageVsp', - "Firewall": 'NuageVsp' - }, - "serviceCapabilityList": { - "SourceNat": {"SupportedSourceNatTypes": "perzone"}, - } - }, - "network": { - "name": "nuage", - "displaytext": "nuage", - }, - "ostype": 'CentOS 5.5 (64-bit)', - "sleep": 60, - "timeout": 10 - } - - -class TestNuageVsp(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - print "In setup class" - cls._cleanup = [] - cls.testClient = super(TestNuageVsp, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - - cls.services = Services().services - # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - # nuage vsp device brings the Nuage virtual service platform into play - cls.nuage_services = cls.services["nuage_vsp_device"] - try: - - resp = listPhysicalNetworks.listPhysicalNetworksCmd() - print "in cls.setupClass- resp: %s" % resp - resp.zoneid = cls.zone.id - physical_networks = cls.api_client.listPhysicalNetworks(resp) - for pn in physical_networks: - if pn.isolationmethods=='VSP': - physical_network = pn - #if isinstance(physical_networks, list): - # physical_network = physical_networks[1] - resp = listNetworkServiceProviders.listNetworkServiceProvidersCmd() - resp.name = 'NuageVsp' - resp.physicalnetworkid = physical_network.id - nw_service_providers = cls.api_client.listNetworkServiceProviders( - resp) - if not isinstance(nw_service_providers, list): - # create network service provider and add nuage vsp device - resp_add_nsp =\ - addNetworkServiceProvider.addNetworkServiceProviderCmd() - resp_add_nsp.name = 'NuageVsp' - resp_add_nsp.physicalnetworkid = physical_network.id - cls.api_client.addNetworkServiceProvider(resp_add_nsp) - #Get NSP ID - nw_service_providers = cls.api_client.listNetworkServiceProviders( - resp) - cls.debug("NuageVsp NSP ID: %s" % nw_service_providers[0].id) - - resp_add_device = addNuageVspDevice.addNuageVspDeviceCmd() - resp_add_device.physicalnetworkid = physical_network.id - resp_add_device.username = cls.nuage_services["username"] - resp_add_device.password = cls.nuage_services["password"] - resp_add_device.hostname = cls.nuage_services["hostname"] - resp_add_device.port = cls.nuage_services["port"] - resp_add_device.apiversion = cls.nuage_services[ - "apiversion"] - resp_add_device.retrycount = cls.nuage_services[ - "retrycount"] - resp_add_device.retryinterval = cls.nuage_services[ - "retryinterval"] - cls.nuage = cls.api_client.addNuageVspDevice( - resp_add_device) - #Enable NuageVsp NSP - cls.debug("NuageVsp NSP ID : %s" % nw_service_providers[0].id) - resp_up_nsp = \ - updateNetworkServiceProvider.updateNetworkServiceProviderCmd() - resp_up_nsp.id = nw_service_providers[0].id - resp_up_nsp.state = 'Enabled' - cls.api_client.updateNetworkServiceProvider(resp_up_nsp) - - cls.network_offering = NetworkOffering.create( - cls.api_client, - cls.services["network_offering"], - conservemode=True - ) - cls._cleanup.append(cls.network_offering) - - cls.network_offering.update(cls.api_client, state='Enabled') - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offering"] - ) - cls._cleanup.append(cls.service_offering) - except Exception as e: - cls.tearDownClass() - raise unittest.SkipTest("Unable to add VSP device") --- End diff -- @sanju1010 Looks like when SkipTest is raised, the exception will be logged in the skipped attribute of the result, ‘S’ or ‘SKIP’ (verbose) will be output, and the exception will not be counted as an error or failure. http://nose.readthedocs.org/en/latest/plugins/skip.html In our tests, we do the see the same behavior: ---------------------------------------------------------------------- Ran 0 tests in 1.139s OK (SKIP=3) --- 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. ---