From 5542c7c042f2cc4d7e046ccde2eafb9ec3c307e9 Mon Sep 17 00:00:00 2001 From: Henry Gessau Date: Sat, 31 Jan 2015 13:57:24 -0500 Subject: [PATCH] Initial changes to get environment working. This patch makes some changes to get the development and test environment useable. - Strip down setup.cfg leaving only what is needed for this repo - Minimize [test-]requirements.txt (copied from networking-odl) - Tweaked tox environments for this repo - Copy etc/policy.json from neutron (needed by unit tests) There are six unit test cases that fail. The cause is obscure and will take some effort to diagnose. Skipping them for now and opened bug 1416859 to address the issue. Change-Id: Ia4a601d1afa4ed37cb30ba5b9e33ad23104089c1 --- .gitignore | 1 + etc/policy.json | 143 ++++++++++++++++++++++++++++++++++++ requirements.txt | 35 +-------- setup.cfg | 121 +----------------------------- test-requirements.txt | 8 +- tools/misc-sanity-checks.sh | 73 ++++++++++++++++++ tools/pretty_tox.sh | 6 ++ tox.ini | 38 ++-------- 8 files changed, 239 insertions(+), 186 deletions(-) create mode 100644 etc/policy.json create mode 100644 tools/misc-sanity-checks.sh create mode 100755 tools/pretty_tox.sh diff --git a/.gitignore b/.gitignore index 6e52e6d..63e7c93 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ pbr*.egg/ quantum.egg-info/ quantum/vcsversion.py quantum/versioninfo +src/ setuptools*.egg/ *.log *.mo diff --git a/etc/policy.json b/etc/policy.json new file mode 100644 index 0000000..4c7f003 --- /dev/null +++ b/etc/policy.json @@ -0,0 +1,143 @@ +{ + "context_is_admin": "role:admin", + "admin_or_owner": "rule:context_is_admin or tenant_id:%(tenant_id)s", + "context_is_advsvc": "role:advsvc", + "admin_or_network_owner": "rule:context_is_admin or tenant_id:%(network:tenant_id)s", + "admin_only": "rule:context_is_admin", + "regular_user": "", + "shared": "field:networks:shared=True", + "shared_firewalls": "field:firewalls:shared=True", + "external": "field:networks:router:external=True", + "default": "rule:admin_or_owner", + + "create_subnet": "rule:admin_or_network_owner", + "get_subnet": "rule:admin_or_owner or rule:shared", + "update_subnet": "rule:admin_or_network_owner", + "delete_subnet": "rule:admin_or_network_owner", + + "create_network": "", + "get_network": "rule:admin_or_owner or rule:shared or rule:external or rule:context_is_advsvc", + "get_network:router:external": "rule:regular_user", + "get_network:segments": "rule:admin_only", + "get_network:provider:network_type": "rule:admin_only", + "get_network:provider:physical_network": "rule:admin_only", + "get_network:provider:segmentation_id": "rule:admin_only", + "get_network:queue_id": "rule:admin_only", + "create_network:shared": "rule:admin_only", + "create_network:router:external": "rule:admin_only", + "create_network:segments": "rule:admin_only", + "create_network:provider:network_type": "rule:admin_only", + "create_network:provider:physical_network": "rule:admin_only", + "create_network:provider:segmentation_id": "rule:admin_only", + "update_network": "rule:admin_or_owner", + "update_network:segments": "rule:admin_only", + "update_network:shared": "rule:admin_only", + "update_network:provider:network_type": "rule:admin_only", + "update_network:provider:physical_network": "rule:admin_only", + "update_network:provider:segmentation_id": "rule:admin_only", + "update_network:router:external": "rule:admin_only", + "delete_network": "rule:admin_or_owner", + + "create_port": "", + "create_port:mac_address": "rule:admin_or_network_owner or rule:context_is_advsvc", + "create_port:fixed_ips": "rule:admin_or_network_owner or rule:context_is_advsvc", + "create_port:port_security_enabled": "rule:admin_or_network_owner or rule:context_is_advsvc", + "create_port:binding:host_id": "rule:admin_only", + "create_port:binding:profile": "rule:admin_only", + "create_port:mac_learning_enabled": "rule:admin_or_network_owner or rule:context_is_advsvc", + "get_port": "rule:admin_or_owner or rule:context_is_advsvc", + "get_port:queue_id": "rule:admin_only", + "get_port:binding:vif_type": "rule:admin_only", + "get_port:binding:vif_details": "rule:admin_only", + "get_port:binding:host_id": "rule:admin_only", + "get_port:binding:profile": "rule:admin_only", + "update_port": "rule:admin_or_owner or rule:context_is_advsvc", + "update_port:fixed_ips": "rule:admin_or_network_owner or rule:context_is_advsvc", + "update_port:port_security_enabled": "rule:admin_or_network_owner or rule:context_is_advsvc", + "update_port:binding:host_id": "rule:admin_only", + "update_port:binding:profile": "rule:admin_only", + "update_port:mac_learning_enabled": "rule:admin_or_network_owner or rule:context_is_advsvc", + "delete_port": "rule:admin_or_owner or rule:context_is_advsvc", + + "get_router:ha": "rule:admin_only", + "create_router": "rule:regular_user", + "create_router:external_gateway_info:enable_snat": "rule:admin_only", + "create_router:distributed": "rule:admin_only", + "create_router:ha": "rule:admin_only", + "get_router": "rule:admin_or_owner", + "get_router:distributed": "rule:admin_only", + "update_router:external_gateway_info:enable_snat": "rule:admin_only", + "update_router:distributed": "rule:admin_only", + "update_router:ha": "rule:admin_only", + "delete_router": "rule:admin_or_owner", + + "add_router_interface": "rule:admin_or_owner", + "remove_router_interface": "rule:admin_or_owner", + + "create_router:external_gateway_info:external_fixed_ips": "rule:admin_only", + "update_router:external_gateway_info:external_fixed_ips": "rule:admin_only", + + "create_firewall": "", + "get_firewall": "rule:admin_or_owner", + "create_firewall:shared": "rule:admin_only", + "get_firewall:shared": "rule:admin_only", + "update_firewall": "rule:admin_or_owner", + "update_firewall:shared": "rule:admin_only", + "delete_firewall": "rule:admin_or_owner", + + "create_firewall_policy": "", + "get_firewall_policy": "rule:admin_or_owner or rule:shared_firewalls", + "create_firewall_policy:shared": "rule:admin_or_owner", + "update_firewall_policy": "rule:admin_or_owner", + "delete_firewall_policy": "rule:admin_or_owner", + + "create_firewall_rule": "", + "get_firewall_rule": "rule:admin_or_owner or rule:shared_firewalls", + "update_firewall_rule": "rule:admin_or_owner", + "delete_firewall_rule": "rule:admin_or_owner", + + "create_qos_queue": "rule:admin_only", + "get_qos_queue": "rule:admin_only", + + "update_agent": "rule:admin_only", + "delete_agent": "rule:admin_only", + "get_agent": "rule:admin_only", + + "create_dhcp-network": "rule:admin_only", + "delete_dhcp-network": "rule:admin_only", + "get_dhcp-networks": "rule:admin_only", + "create_l3-router": "rule:admin_only", + "delete_l3-router": "rule:admin_only", + "get_l3-routers": "rule:admin_only", + "get_dhcp-agents": "rule:admin_only", + "get_l3-agents": "rule:admin_only", + "get_loadbalancer-agent": "rule:admin_only", + "get_loadbalancer-pools": "rule:admin_only", + + "create_floatingip": "rule:regular_user", + "create_floatingip:floating_ip_address": "rule:admin_only", + "update_floatingip": "rule:admin_or_owner", + "delete_floatingip": "rule:admin_or_owner", + "get_floatingip": "rule:admin_or_owner", + + "create_network_profile": "rule:admin_only", + "update_network_profile": "rule:admin_only", + "delete_network_profile": "rule:admin_only", + "get_network_profiles": "", + "get_network_profile": "", + "update_policy_profiles": "rule:admin_only", + "get_policy_profiles": "", + "get_policy_profile": "", + + "create_metering_label": "rule:admin_only", + "delete_metering_label": "rule:admin_only", + "get_metering_label": "rule:admin_only", + + "create_metering_label_rule": "rule:admin_only", + "delete_metering_label_rule": "rule:admin_only", + "get_metering_label_rule": "rule:admin_only", + + "get_service_provider": "rule:regular_user", + "get_lsn": "rule:admin_only", + "create_lsn": "rule:admin_only" +} diff --git a/requirements.txt b/requirements.txt index 80b2958..6ead9fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,36 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. + pbr>=0.6,!=0.7,<1.0 - -Paste -PasteDeploy>=1.5.0 -Routes>=1.12.3,!=2.0 -eventlet>=0.15.2 -greenlet>=0.3.2 -httplib2>=0.7.5 -requests>=2.2.0,!=2.4.0 -jsonrpclib -Jinja2>=2.6 # BSD License (3 clause) -keystonemiddleware>=1.0.0 -netaddr>=0.7.12 -python-neutronclient>=2.3.6,<3 -retrying>=1.2.3,!=1.3.0 # Apache-2.0 -SQLAlchemy>=0.9.7,<=0.9.99 -WebOb>=1.2.3 -python-keystoneclient>=0.11.1 -alembic>=0.7.1 -six>=1.7.0 -stevedore>=1.1.0 # Apache-2.0 -oslo.concurrency>=1.4.1 # Apache-2.0 -oslo.config>=1.6.0 # Apache-2.0 -oslo.context>=0.1.0 # Apache-2.0 -oslo.db>=1.4.1 # Apache-2.0 -oslo.i18n>=1.3.0 # Apache-2.0 -oslo.messaging>=1.4.0,!=1.5.0 -oslo.middleware>=0.3.0 # Apache-2.0 -oslo.rootwrap>=1.3.0 -oslo.serialization>=1.2.0 # Apache-2.0 -oslo.utils>=1.2.0 # Apache-2.0 - -python-novaclient>=2.18.0 +Babel>=1.3 +-e git://git.openstack.org/openstack/neutron.git#egg=neutron diff --git a/setup.cfg b/setup.cfg index 8ffb9eb..bc44990 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = networking-cisco +version = 2015.1 summary = Networking Cisco contains the Cisco vendor code for Openstack Neutron description-file = README.rst @@ -15,77 +16,18 @@ classifier = Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 [files] packages = networking_cisco data_files = etc/neutron = - etc/api-paste.ini - etc/dhcp_agent.ini - etc/l3_agent.ini - etc/metadata_agent.ini - etc/metering_agent.ini - etc/policy.json - etc/neutron.conf - etc/rootwrap.conf - etc/neutron/rootwrap.d = - etc/neutron/rootwrap.d/debug.filters - etc/neutron/rootwrap.d/dhcp.filters - etc/neutron/rootwrap.d/iptables-firewall.filters - etc/neutron/rootwrap.d/ipset-firewall.filters - etc/neutron/rootwrap.d/l3.filters - etc/neutron/rootwrap.d/linuxbridge-plugin.filters - etc/neutron/rootwrap.d/nec-plugin.filters - etc/neutron/rootwrap.d/ofagent.filters - etc/neutron/rootwrap.d/openvswitch-plugin.filters - etc/init.d = etc/init.d/neutron-server - etc/neutron/plugins/bigswitch = - etc/neutron/plugins/bigswitch/restproxy.ini - etc/neutron/plugins/bigswitch/ssl/ca_certs = - etc/neutron/plugins/bigswitch/ssl/ca_certs/README - etc/neutron/plugins/bigswitch/ssl/host_certs = - etc/neutron/plugins/bigswitch/ssl/host_certs/README - etc/neutron/plugins/brocade = etc/neutron/plugins/brocade/brocade.ini - etc/neutron/plugins/cisco = + etc/neutron/plugins/ml2/ml2_conf_cisco.ini + etc/neutron/plugins/ml2/ml2_conf_ncs.ini etc/neutron/plugins/cisco/cisco_cfg_agent.ini etc/neutron/plugins/cisco/cisco_plugins.ini etc/neutron/plugins/cisco/cisco_router_plugin.ini etc/neutron/plugins/cisco/cisco_vpn_agent.ini - etc/neutron/plugins/embrane = etc/neutron/plugins/embrane/heleos_conf.ini - etc/neutron/plugins/hyperv = etc/neutron/plugins/hyperv/hyperv_neutron_plugin.ini - etc/neutron/plugins/ibm = etc/neutron/plugins/ibm/sdnve_neutron_plugin.ini - etc/neutron/plugins/linuxbridge = etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini - etc/neutron/plugins/metaplugin = etc/neutron/plugins/metaplugin/metaplugin.ini - etc/neutron/plugins/midonet = etc/neutron/plugins/midonet/midonet.ini - etc/neutron/plugins/ml2 = - etc/neutron/plugins/bigswitch/restproxy.ini - etc/neutron/plugins/ml2/ml2_conf.ini - etc/neutron/plugins/ml2/ml2_conf_arista.ini - etc/neutron/plugins/ml2/ml2_conf_brocade.ini - etc/neutron/plugins/ml2/ml2_conf_cisco.ini - etc/neutron/plugins/ml2/ml2_conf_mlnx.ini - etc/neutron/plugins/ml2/ml2_conf_ncs.ini - etc/neutron/plugins/ml2/ml2_conf_odl.ini - etc/neutron/plugins/ml2/ml2_conf_ofa.ini - etc/neutron/plugins/ml2/ml2_conf_fslsdn.ini - etc/neutron/plugins/ml2/ml2_conf_sriov.ini - etc/neutron/plugins/nuage/nuage_plugin.ini - etc/neutron/plugins/mlnx = etc/neutron/plugins/mlnx/mlnx_conf.ini - etc/neutron/plugins/nec = etc/neutron/plugins/nec/nec.ini - etc/neutron/plugins/nuage = etc/neutron/plugins/nuage/nuage_plugin.ini - etc/neutron/plugins/oneconvergence = etc/neutron/plugins/oneconvergence/nvsdplugin.ini - etc/neutron/plugins/openvswitch = etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini - etc/neutron/plugins/plumgrid = etc/neutron/plugins/plumgrid/plumgrid.ini - etc/neutron/plugins/vmware = etc/neutron/plugins/vmware/nsx.ini - etc/neutron/plugins/opencontrail = etc/neutron/plugins/opencontrail/contrailplugin.ini -scripts = - bin/neutron-rootwrap - bin/neutron-rootwrap-xen-dom0 [global] setup-hooks = @@ -97,73 +39,16 @@ console_scripts = neutron.core_plugins = cisco = neutron.plugins.cisco.network_plugin:PluginV2 ml2 = neutron.plugins.ml2.plugin:Ml2Plugin -neutron.service_plugins = - router = neutron.services.l3_router.l3_router_plugin:L3RouterPlugin - firewall = neutron_fwaas.services.firewall.fwaas_plugin:FirewallPlugin - lbaas = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin - vpnaas = neutron_vpnaas.services.vpn.plugin:VPNDriverPlugin - metering = neutron.services.metering.metering_plugin:MeteringPlugin - neutron.services.firewall.fwaas_plugin.FirewallPlugin = neutron_fwaas.services.firewall.fwaas_plugin:FirewallPlugin - neutron.services.loadbalancer.plugin.LoadBalancerPlugin = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin - neutron.services.vpn.plugin.VPNDriverPlugin = neutron_vpnaas.services.vpn.plugin:VPNDriverPlugin -neutron.service_providers = - # These are for backwards compat with Juno firewall service provider configuration values - neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver = neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas:IptablesFwaasDriver - neutron.services.firewall.drivers.varmour.varmour_fwaas.vArmourFwaasDriver = neutron_fwaas.services.firewall.drivers.varmour.varmour_fwaas:vArmourFwaasDriver - # These are for backwards compat with Juno loadbalancer service provider configuration values - neutron.services.loadbalancer.drivers.a10networks.driver_v1.ThunderDriver = neutron_lbaas.services.loadbalancer.drivers.a10networks.driver_v1:ThunderDriver - neutron.services.loadbalancer.drivers.embrane.driver.EmbraneLbaas = neutron_lbaas.services.loadbalancer.drivers.embrane.driver:EmbraneLbaas - neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver = neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver:HaproxyOnHostPluginDriver - neutron.services.loadbalancer.drivers.netscaler.netscaler_driver.NetScalerPluginDriver = neutron_lbaas.services.loadbalancer.drivers.netscaler.netscaler_driver:NetScalerPluginDriver - neutron.services.loadbalancer.drivers.radware.driver.LoadBalancerDriver = neutron_lbaas.services.loadbalancer.drivers.radware.driver:LoadBalancerDriver - # These are for backwards compat with Juno vpnaas service provider configuration values - neutron.services.vpn.service_drivers.cisco_ipsec.CiscoCsrIPsecVPNDriver = neutron_vpnaas.services.vpn.service_drivers.cisco_ipsec:CiscoCsrIPsecVPNDriver - neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver = neutron_vpnaas.services.vpn.service_drivers.ipsec:IPsecVPNDriver -neutron.ml2.type_drivers = - flat = neutron.plugins.ml2.drivers.type_flat:FlatTypeDriver - local = neutron.plugins.ml2.drivers.type_local:LocalTypeDriver - vlan = neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver - gre = neutron.plugins.ml2.drivers.type_gre:GreTypeDriver - vxlan = neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver neutron.ml2.mechanism_drivers = - opendaylight = neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver - logger = neutron.tests.unit.ml2.drivers.mechanism_logger:LoggerMechanismDriver - test = neutron.tests.unit.ml2.drivers.mechanism_test:TestMechanismDriver - linuxbridge = neutron.plugins.ml2.drivers.mech_linuxbridge:LinuxbridgeMechanismDriver - openvswitch = neutron.plugins.ml2.drivers.mech_openvswitch:OpenvswitchMechanismDriver - hyperv = neutron.plugins.ml2.drivers.mech_hyperv:HypervMechanismDriver ncs = neutron.plugins.ml2.drivers.mechanism_ncs:NCSMechanismDriver - arista = neutron.plugins.ml2.drivers.arista.mechanism_arista:AristaDriver cisco_nexus = neutron.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus:CiscoNexusMechanismDriver cisco_apic = neutron.plugins.ml2.drivers.cisco.apic.mechanism_apic:APICMechanismDriver - l2population = neutron.plugins.ml2.drivers.l2pop.mech_driver:L2populationMechanismDriver - bigswitch = neutron.plugins.ml2.drivers.mech_bigswitch.driver:BigSwitchMechanismDriver - ofagent = neutron.plugins.ml2.drivers.mech_ofagent:OfagentMechanismDriver - mlnx = neutron.plugins.ml2.drivers.mlnx.mech_mlnx:MlnxMechanismDriver - brocade = neutron.plugins.ml2.drivers.brocade.mechanism_brocade:BrocadeMechanism - fslsdn = neutron.plugins.ml2.drivers.freescale.mechanism_fslsdn:FslsdnMechanismDriver - sriovnicswitch = neutron.plugins.ml2.drivers.mech_sriov.mech_driver:SriovNicSwitchMechanismDriver - nuage = neutron.plugins.ml2.drivers.mech_nuage.driver:NuageMechanismDriver -neutron.ml2.extension_drivers = - test = neutron.tests.unit.ml2.test_extension_driver_api:TestExtensionDriver -neutron.openstack.common.cache.backends = - memory = neutron.openstack.common.cache._backends.memory:MemoryBackend -# These are for backwards compat with Icehouse notification_driver configuration values -oslo.messaging.notify.drivers = - neutron.openstack.common.notifier.log_notifier = oslo.messaging.notify._impl_log:LogDriver - neutron.openstack.common.notifier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver - neutron.openstack.common.notifier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver - neutron.openstack.common.notifier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver - neutron.openstack.common.notifier.test_notifier = oslo.messaging.notify._impl_test:TestDriver [build_sphinx] source-dir = doc/source build-dir = doc/build all_files = 1 -[upload_sphinx] -upload-dir = doc/build/html - [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg diff --git a/test-requirements.txt b/test-requirements.txt index f18b9b7..a1e461f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,16 +1,14 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. + hacking>=0.10.0,<0.11 -cliff>=1.7.0 # Apache-2.0 coverage>=3.6 discover -fixtures>=0.3.14 -mock>=1.0 python-subunit>=0.0.18 -requests-mock>=0.5.1 # Apache-2.0 -sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 +mock>=1.0 +sphinx>=1.1.2 oslosphinx>=2.2.0 # Apache-2.0 testrepository>=0.0.18 testtools>=0.9.36,!=1.2.0 diff --git a/tools/misc-sanity-checks.sh b/tools/misc-sanity-checks.sh new file mode 100644 index 0000000..55ebec3 --- /dev/null +++ b/tools/misc-sanity-checks.sh @@ -0,0 +1,73 @@ +#! /bin/sh + +# Copyright (C) 2014 VA Linux Systems Japan K.K. +# Copyright (C) 2014 YAMAMOTO Takashi +# All Rights Reserved. +# +# Licensed 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. + +TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX` || exit 1 +export TMPDIR +trap "rm -rf $TMPDIR" EXIT + +FAILURES=$TMPDIR/failures + + +check_opinionated_shell () { + # The purpose of this function is to avoid casual introduction of more + # bash dependency. Please consider alternatives before commiting code + # which uses bash specific features. + + # Check that shell scripts are not bash opinionated (ignore comments though) + # If you cannot avoid the use of bash, please change the EXPECTED var below. + OBSERVED=$(grep -E '^([[:space:]]*[^#[:space:]]|#!).*bash' \ + tox.ini tools/* | wc -l) + EXPECTED=1 + if [ ${EXPECTED} -ne ${OBSERVED} ]; then + echo "Bash usage has been detected!" >>$FAILURES + fi +} + + +check_no_symlinks_allowed () { + # Symlinks break the package build process, so ensure that they + # do not slip in, except hidden symlinks. + if [ $(find . -type l ! -path '*/.*' | wc -l) -ge 1 ]; then + echo "Symlinks are not allowed!" >>$FAILURES + fi +} + + +check_pot_files_errors () { + # The job neutron-propose-translation-update does not update from + # transifex since our po files contain duplicate entries where + # obsolete entries duplicate normal entries. Prevent obsolete + # entries to slip in + find networking_cisco -type f -regex '.*\.pot?' \ + -print0|xargs -0 -n 1 msgfmt --check-format \ + -o /dev/null + if [ "$?" -ne 0 ]; then + echo "PO files syntax is not correct!" >>$FAILURES + fi +} + +# Add your checks here... +check_opinionated_shell +check_no_symlinks_allowed +# check_pot_files_errors + +# Fail, if there are emitted failures +if [ -f $FAILURES ]; then + cat $FAILURES + exit 1 +fi diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh new file mode 100755 index 0000000..0fc3605 --- /dev/null +++ b/tools/pretty_tox.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +TESTRARGS=$1 + +exec 3>&1 +status=$(exec 4>&1 >&3; ( python setup.py testr --slowest --testr-args="--subunit $TESTRARGS"; echo $? >&4 ) | subunit-trace -f) && exit $status diff --git a/tox.ini b/tox.ini index ff210cf..f753e2d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py33,py34,py26,py27,pypy,pep8 +envlist = py27,pep8 minversion = 1.6 skipsdist = True @@ -9,9 +9,8 @@ skipsdist = True setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 usedevelop = True -install_command = pip install -U {opts} {packages} -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +install_command = pip install -r requirements.txt -U {opts} {packages} +deps = -r{toxinidir}/test-requirements.txt whitelist_externals = sh commands = sh tools/pretty_tox.sh '{posargs}' @@ -24,38 +23,16 @@ commands = # tox --hashseed 1235130571 -e hashtest setenv = VIRTUAL_ENV={envdir} -[testenv:api] -setenv = OS_TEST_PATH=./neutron/tests/api - -[testenv:functional] -setenv = OS_TEST_PATH=./neutron/tests/functional - OS_TEST_TIMEOUT=90 -deps = - {[testenv]deps} - -r{toxinidir}/neutron/tests/functional/requirements.txt - -[testenv:dsvm-functional] -setenv = OS_TEST_PATH=./neutron/tests/functional - OS_SUDO_TESTING=1 - OS_ROOTWRAP_CMD=sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf - OS_FAIL_ON_MISSING_DEPS=1 - OS_TEST_TIMEOUT=90 -sitepackages=True -deps = - {[testenv:functional]deps} - -[tox:jenkins] -sitepackages = True -downloadcache = ~/cache/pip - [testenv:pep8] commands = # If it is easier to add a check via a shell script, consider adding it in this file sh ./tools/misc-sanity-checks.sh flake8 - neutron-db-manage check_migration whitelist_externals = sh +[testenv:i18n] +commands = python ./tools/check_i18n.py ./networking_cisco ./tools/i18n_cfg.py + [testenv:cover] commands = python setup.py testr --coverage --testr-args='{posargs}' @@ -78,8 +55,7 @@ commands = python setup.py build_sphinx ignore = E125,E126,E128,E129,E265,H305,H404,H405 show-source = true builtins = _ -# TODO(dougw) neutron/tests/unit/vmware exclusion is a temporary services split hack -exclude = \.*,build,dist,neutron/openstack/common/*,neutron/tests/unit/vmware* +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,src,tools [testenv:pylint] deps =