diff -Nru neutron-fwaas-dashboard-1.5.0/babel-django.cfg neutron-fwaas-dashboard-1.3.0/babel-django.cfg --- neutron-fwaas-dashboard-1.5.0/babel-django.cfg 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/babel-django.cfg 2018-02-22 06:27:32.000000000 +0000 @@ -2,4 +2,4 @@ django = django_babel.extract:extract_django [python: **.py] -[django: **/templates/**.html] +[django: templates/**.html] diff -Nru neutron-fwaas-dashboard-1.5.0/CONTRIBUTING.rst neutron-fwaas-dashboard-1.3.0/CONTRIBUTING.rst --- neutron-fwaas-dashboard-1.5.0/CONTRIBUTING.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/CONTRIBUTING.rst 2018-02-22 06:27:32.000000000 +0000 @@ -14,4 +14,4 @@ Bugs should be filed on Launchpad, not GitHub: - https://bugs.launchpad.net/neutron-fwaas-dashboard + https://bugs.launchpad.net/neutron-fwaas-dashbaard diff -Nru neutron-fwaas-dashboard-1.5.0/debian/changelog neutron-fwaas-dashboard-1.3.0/debian/changelog --- neutron-fwaas-dashboard-1.5.0/debian/changelog 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/changelog 2018-12-18 09:14:39.000000000 +0000 @@ -1,36 +1,19 @@ -neutron-fwaas-dashboard (1.5.0-0ubuntu3) cosmic; urgency=medium +neutron-fwaas-dashboard (1.3.0-0ubuntu1.1~cloud0) xenial-queens; urgency=medium - * d/rules: Misc fixes to resolve FTBFS as this package only provides - a Python 3 module. + * New package for the Ubuntu Cloud Archive. - -- James Page Mon, 08 Oct 2018 09:54:10 +0100 + -- Openstack Ubuntu Testing Bot Tue, 18 Dec 2018 09:14:39 +0000 -neutron-fwaas-dashboard (1.5.0-0ubuntu2) cosmic; urgency=medium +neutron-fwaas-dashboard (1.3.0-0ubuntu1.1) bionic; urgency=medium - * d/rules,python3-neutron-fwaas-dashboard.*: Refactor to work with - Ubuntu layout for openstack-dashboard, resolving installation issues - (LP: #1796357). + * d/rules: Only install py files when enabling panels for + OpenStack dashboard. - -- James Page Mon, 08 Oct 2018 09:19:44 +0100 + -- James Page Mon, 17 Dec 2018 09:35:09 +0000 -neutron-fwaas-dashboard (1.5.0-0ubuntu1) cosmic; urgency=medium +neutron-fwaas-dashboard (1.3.0-0ubuntu1) bionic; urgency=medium - * d/gbp.conf: Update gbp configuration file. - * d/control: Update Vcs-* links and maintainers. - * New upstream release for OpenStack Rocky. - * d/control: Align (Build-)Depends with upstream. + * Initial release for Openstack Queens resolving disappearance + of FWaaS panels from the OpenStack Dashboard (LP: #1808168). - -- Corey Bryant Wed, 03 Oct 2018 07:48:31 -0400 - -neutron-fwaas-dashboard (1.3.0-1ubuntu1) cosmic; urgency=medium - - * Add missing build-dependency on python3-django-horizon, needed by - neutron_fwaas_dashboard/test/settings.py. - - -- Steve Langasek Thu, 23 Aug 2018 11:00:57 -0700 - -neutron-fwaas-dashboard (1.3.0-1) unstable; urgency=medium - - * Initial release (Closes: #898156). - - -- Thomas Goirand Wed, 21 Feb 2018 14:09:04 +0100 + -- James Page Thu, 13 Dec 2018 14:18:33 +0000 diff -Nru neutron-fwaas-dashboard-1.5.0/debian/control neutron-fwaas-dashboard-1.3.0/debian/control --- neutron-fwaas-dashboard-1.5.0/debian/control 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/control 2018-12-14 14:29:30.000000000 +0000 @@ -9,37 +9,36 @@ debhelper (>= 10), dh-python, openstack-pkg-tools, - python3-all, - python3-pbr (>= 2.0.0), - python3-setuptools, - python3-sphinx (>= 1.6.2), + python-all, + python-pbr (>= 2.0.0), + python-setuptools, + python-sphinx (>= 1.6.2), Build-Depends-Indep: - openstack-dashboard (>= 3:13.0.0), - python3-coverage (>= 4.0), - python3-django-horizon (>= 3:13.0.0), - python3-django-nose (>= 1.4.4), - python3-mock (>= 2.0.0), - python3-mox3, - python3-neutronclient (>= 1:6.7.0), - python3-nose, - python3-nose-exclude, - python3-nosehtmloutput (>= 0.0.3), - python3-openstack.nose-plugin, - python3-openstackdocstheme (>= 1.18.1), - python3-testtools (>= 2.2.0), + openstack-dashboard (>= 3:13.0.0~rc1), + python-coverage, + python-django-nose, + python-mock, + python-mox3, + python-neutronclient (>= 6.3.0), + python-nose, + python-nose-exclude, + python-nosehtmloutput, + python-openstack.nose-plugin, + python-openstackdocstheme (>= 1.18.1), + python-testtools (>= 2.2.0), Standards-Version: 4.1.3 -Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/neutron-fwaas-dashboard -Vcs-Git: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/neutron-fwaas-dashboard +Vcs-Browser: https://salsa.debian.org/openstack-team/services/neutron-fwaas-dashboard +Vcs-Git: https://salsa.debian.org/openstack-team/services/neutron-fwaas-dashboard.git Homepage: https://github.com/stackforge/neutron-fwaas-dashboard -Package: python3-neutron-fwaas-dashboard +Package: python-neutron-fwaas-dashboard Architecture: all Depends: openstack-dashboard (>= 3:13.0.0~rc1), - python3-neutronclient (>= 1:6.7.0), - python3-pbr (>= 2.0.0), + python-neutronclient (>= 6.3.0), + python-pbr (>= 2.0.0), ${misc:Depends}, - ${python3:Depends}, + ${python:Depends}, Description: OpenStack Firewall as a Service - dashboard plugin Neutron provides an API to dynamically request and configure virtual networks. These networks connect "interfaces" from other OpenStack services (such as diff -Nru neutron-fwaas-dashboard-1.5.0/debian/gbp.conf neutron-fwaas-dashboard-1.3.0/debian/gbp.conf --- neutron-fwaas-dashboard-1.5.0/debian/gbp.conf 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -[DEFAULT] -debian-branch = master -upstream-tag = %(version)s -pristine-tar = True - -[buildpackage] -export-dir = ../build-area diff -Nru neutron-fwaas-dashboard-1.5.0/debian/python3-neutron-fwaas-dashboard.install neutron-fwaas-dashboard-1.3.0/debian/python3-neutron-fwaas-dashboard.install --- neutron-fwaas-dashboard-1.5.0/debian/python3-neutron-fwaas-dashboard.install 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/python3-neutron-fwaas-dashboard.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -etc/neutron-fwaas-policy.json /etc/openstack-dashboard -/usr/* diff -Nru neutron-fwaas-dashboard-1.5.0/debian/python3-neutron-fwaas-dashboard.postinst neutron-fwaas-dashboard-1.3.0/debian/python3-neutron-fwaas-dashboard.postinst --- neutron-fwaas-dashboard-1.5.0/debian/python3-neutron-fwaas-dashboard.postinst 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/python3-neutron-fwaas-dashboard.postinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e - -if [ "${1}" = "configure" ] ; then - ( - cd /usr/share/openstack-dashboard - echo "Collecting and compressing static assets..." - rm -rf /var/lib/openstack-dashboard/static/ || : - python3 manage.py collectstatic --noinput 2>&1 > /dev/null - python3 manage.py compress --force 2>&1 > /dev/null - ) - - if [ -e /var/lib/openstack-dashboard ] ; then - chown -R horizon:horizon /var/lib/openstack-dashboard - fi -fi - -#DEBHELPER# diff -Nru neutron-fwaas-dashboard-1.5.0/debian/python-neutron-fwaas-dashboard.install neutron-fwaas-dashboard-1.3.0/debian/python-neutron-fwaas-dashboard.install --- neutron-fwaas-dashboard-1.5.0/debian/python-neutron-fwaas-dashboard.install 1970-01-01 00:00:00.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/python-neutron-fwaas-dashboard.install 2018-12-14 14:29:30.000000000 +0000 @@ -0,0 +1,2 @@ +etc/neutron-fwaas-policy.json /etc/openstack-dashboard +/usr/* diff -Nru neutron-fwaas-dashboard-1.5.0/debian/python-neutron-fwaas-dashboard.postinst neutron-fwaas-dashboard-1.3.0/debian/python-neutron-fwaas-dashboard.postinst --- neutron-fwaas-dashboard-1.5.0/debian/python-neutron-fwaas-dashboard.postinst 1970-01-01 00:00:00.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/python-neutron-fwaas-dashboard.postinst 2018-12-14 14:29:30.000000000 +0000 @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +if [ "${1}" = "configure" ] ; then + ( + cd /usr/share/openstack-dashboard + echo "Collecting and compressing static assets..." + rm -rf /var/lib/openstack-dashboard/static/ || : + python manage.py collectstatic --noinput 2>&1 > /dev/null + python manage.py compress --force 2>&1 > /dev/null + ) + + if [ -e /var/lib/openstack-dashboard ] ; then + chown -R horizon:horizon /var/lib/openstack-dashboard + fi +fi + +#DEBHELPER# diff -Nru neutron-fwaas-dashboard-1.5.0/debian/rules neutron-fwaas-dashboard-1.3.0/debian/rules --- neutron-fwaas-dashboard-1.5.0/debian/rules 2018-10-08 08:54:10.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/debian/rules 2018-12-17 09:20:01.000000000 +0000 @@ -3,11 +3,11 @@ include /usr/share/openstack-pkg-tools/pkgos.make %: - dh $@ --buildsystem=python_distutils --with python3 + dh $@ --buildsystem=python_distutils --with python2 override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - for i in $(PYTHON3S) ; do \ + for i in $(PYTHONS) ; do \ PYTHONPATH=$(CURDIR) \ NOSE_WITH_OPENSTACK=1 \ NOSE_OPENSTACK_COLOR=1 \ @@ -23,16 +23,18 @@ rm -rf .coverage* override_dh_auto_install: - pkgos-dh_auto_install --no-py2 + pkgos-dh_auto_install --no-py3 # Copy the enabled files - mkdir -p $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/enabled - cp -axuf neutron_fwaas_dashboard/enabled/_70* $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/enabled + mkdir -p $(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages/openstack_dashboard/enabled + mkdir -p $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/enabled + cp -axuf neutron_fwaas_dashboard/enabled/_70*.py $(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages/openstack_dashboard/enabled + cp -axuf neutron_fwaas_dashboard/enabled/_70*.py $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/enabled override_dh_auto_clean: - python3 setup.py clean + python setup.py clean -# NOTE(jamespage): Skip build as no py2 deps installed which confuses the +# NOTE(jamespage): Skip build as no py3 deps installed which confuses the # distutils support in dh_python. override_dh_auto_build: : diff -Nru neutron-fwaas-dashboard-1.5.0/devstack/README.rst neutron-fwaas-dashboard-1.3.0/devstack/README.rst --- neutron-fwaas-dashboard-1.5.0/devstack/README.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/devstack/README.rst 2018-02-22 06:27:32.000000000 +0000 @@ -17,8 +17,8 @@ You do not need to specify FWaaS API version in the DevStack plugin configuration. -How to enable FWaaS v2 dashboard --------------------------------- +How to enable FWaaS v2 dsashboard +--------------------------------- Add the following to the localrc section of your local.conf. @@ -29,8 +29,8 @@ enable_service q-fwaas-v2 enable_plugin neutron-fwaas-dashboard https://git.openstack.org/openstack/neutron-fwaas-dashboard master -How to enable FWaaS v1 dashboard --------------------------------- +How to enable FWaaS v1 dsashboard +--------------------------------- Add the following to the localrc section of your local.conf. diff -Nru neutron-fwaas-dashboard-1.5.0/doc/source/conf.py neutron-fwaas-dashboard-1.3.0/doc/source/conf.py --- neutron-fwaas-dashboard-1.5.0/doc/source/conf.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/doc/source/conf.py 2018-02-22 06:27:32.000000000 +0000 @@ -29,8 +29,6 @@ import django -import neutron_fwaas_dashboard.version - PROJECT = 'neutron-fwaas-dashboard' BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) @@ -41,6 +39,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'neutron_fwaas_dashboard.test.settings') +import neutron_fwaas_dashboard.version + django.setup() diff -Nru neutron-fwaas-dashboard-1.5.0/doc/source/install/index.rst neutron-fwaas-dashboard-1.3.0/doc/source/install/index.rst --- neutron-fwaas-dashboard-1.5.0/doc/source/install/index.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/doc/source/install/index.rst 2018-02-22 06:27:32.000000000 +0000 @@ -63,7 +63,7 @@ Configure the policy file for Neutron FWaaS dashboard in OpenStack Dashboard ``local_settings.py``. ```` is a directory which contains -configurations for Neutron FWaaS dashboard and the location varies +configurations for Neutron FWaaS dashboard and the locaiton varies across distributions or deployments. .. code-block:: python diff -Nru neutron-fwaas-dashboard-1.5.0/.gitreview neutron-fwaas-dashboard-1.3.0/.gitreview --- neutron-fwaas-dashboard-1.5.0/.gitreview 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/.gitreview 2018-02-22 06:27:32.000000000 +0000 @@ -2,3 +2,4 @@ host=review.openstack.org port=29418 project=openstack/neutron-fwaas-dashboard.git +defaultbranch=stable/queens diff -Nru neutron-fwaas-dashboard-1.5.0/lower-constraints.txt neutron-fwaas-dashboard-1.3.0/lower-constraints.txt --- neutron-fwaas-dashboard-1.5.0/lower-constraints.txt 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/lower-constraints.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -alabaster==0.7.10 -amqp==2.1.1 -appdirs==1.3.0 -asn1crypto==0.23.0 -Babel==2.3.4 -cachetools==2.0.0 -cffi==1.7.0 -cliff==2.8.0 -cmd2==0.8.0 -contextlib2==0.4.0 -coverage==4.0 -cryptography==2.1 -debtcollector==1.2.0 -decorator==3.4.0 -deprecation==1.0 -Django==1.11 -django-appconf==1.0.2 -django-babel==0.6.2 -django-compressor==2.0 -django-nose==1.4.4 -django-pyscss==2.0.2 -docutils==0.11 -dogpile.cache==0.6.2 -dulwich==0.15.0 -eventlet==0.18.2 -extras==1.0.0 -fasteners==0.7.0 -fixtures==3.0.0 -flake8==2.5.5 -flake8-import-order==0.13 -futurist==1.2.0 -greenlet==0.4.10 -hacking==0.12.0 -horizon==13.0.0 -idna==2.6 -imagesize==0.7.1 -iso8601==0.1.11 -Jinja2==2.10 -jmespath==0.9.0 -jsonpatch==1.16 -jsonpointer==1.13 -jsonschema==2.6.0 -keystoneauth1==3.4.0 -kombu==4.0.0 -linecache2==1.0.0 -MarkupSafe==1.0 -mccabe==0.2.1 -mock==2.0.0 -monotonic==0.6 -msgpack-python==0.4.0 -munch==2.1.0 -netaddr==0.7.18 -netifaces==0.10.4 -nose==1.3.7 -nosehtmloutput==0.0.3 -openstackdocstheme==1.18.1 -openstacksdk==0.11.2 -os-client-config==1.28.0 -os-service-types==1.2.0 -osc-lib==1.8.0 -oslo.concurrency==3.25.0 -oslo.config==5.2.0 -oslo.context==2.19.2 -oslo.i18n==3.15.3 -oslo.log==3.36.0 -oslo.messaging==5.29.0 -oslo.middleware==3.31.0 -oslo.policy==1.30.0 -oslo.serialization==2.18.0 -oslo.service==1.24.0 -oslo.utils==3.33.0 -osprofiler==1.4.0 -Paste==2.0.2 -PasteDeploy==1.5.0 -pbr==2.0.0 -pep8==1.5.7 -pika==0.10.0 -pika-pool==0.1.3 -Pint==0.5 -positional==1.2.1 -prettytable==0.7.2 -pycodestyle==2.3.1 -pycparser==2.18 -pyflakes==0.8.1 -Pygments==2.2.0 -pyinotify==0.9.6 -pymongo==3.0.2 -pyOpenSSL==17.1.0 -pyparsing==2.1.0 -pyperclip==1.5.27 -pyScss==1.3.4 -python-cinderclient==3.3.0 -python-dateutil==2.5.3 -python-glanceclient==2.8.0 -python-keystoneclient==3.8.0 -python-mimeparse==1.6.0 -python-neutronclient==6.7.0 -python-novaclient==9.1.0 -python-swiftclient==3.2.0 -pytz==2013.6 -PyYAML==3.12 -rcssmin==1.0.6 -reno==2.5.0 -repoze.lru==0.7 -requests==2.14.2 -requestsexceptions==1.2.0 -rfc3986==0.3.1 -rjsmin==1.0.12 -Routes==2.3.1 -semantic-version==2.3.1 -simplejson==3.5.1 -six==1.10.0 -snowballstemmer==1.2.1 -Sphinx==1.6.2 -sphinxcontrib-websupport==1.0.1 -statsd==3.2.1 -stevedore==1.20.0 -tenacity==3.2.1 -testtools==2.2.0 -traceback2==1.4.0 -unittest2==1.1.0 -vine==1.1.4 -warlock==1.2.0 -WebOb==1.7.1 -wrapt==1.7.0 -XStatic==1.0.0 -XStatic-Angular==1.5.8.0 -XStatic-Angular-Bootstrap==2.2.0.0 -XStatic-Angular-FileUpload==12.0.4.0 -XStatic-Angular-Gettext==2.3.8.0 -XStatic-Angular-lrdragndrop==1.0.2.2 -XStatic-Angular-Schema-Form==0.8.13.0 -XStatic-Bootstrap-Datepicker==1.3.1.0 -XStatic-Bootstrap-SCSS==3.3.7.1 -XStatic-bootswatch==3.3.7.0 -XStatic-D3==3.5.17.0 -XStatic-Font-Awesome==4.7.0.0 -XStatic-Hogan==2.0.0.2 -XStatic-Jasmine==2.4.1.1 -XStatic-jQuery==1.8.2.1 -XStatic-JQuery-Migrate==1.2.1.1 -XStatic-jquery-ui==1.10.4.1 -XStatic-JQuery.quicksearch==2.0.3.1 -XStatic-JQuery.TableSorter==2.14.5.1 -XStatic-JSEncrypt==2.3.1.1 -XStatic-mdi==1.4.57.0 -XStatic-objectpath==1.2.1.0 -XStatic-Rickshaw==1.5.0.0 -XStatic-roboto-fontface==0.5.0.0 -XStatic-smart-table==1.4.13.2 -XStatic-Spin==1.2.5.2 -XStatic-term.js==0.0.7.0 -XStatic-tv4==1.2.7.0 diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/forms.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/forms.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/forms.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/forms.py 2018-02-22 06:27:32.000000000 +0000 @@ -14,7 +14,7 @@ import logging -from django.urls import reverse +from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tables.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tables.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tables.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tables.py 2018-02-22 06:27:32.000000000 +0000 @@ -14,8 +14,8 @@ import logging +from django.core.urlresolvers import reverse from django.template import defaultfilters as filters -from django.urls import reverse from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tests.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tests.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tests.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/tests.py 2018-02-22 06:27:32.000000000 +0000 @@ -12,20 +12,24 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from mox3.mox import IsA -from django.urls import reverse +from django.core.urlresolvers import reverse +from django import http from openstack_dashboard import api -from openstack_dashboard.test import helpers from neutron_fwaas_dashboard.api import fwaas as api_fwaas from neutron_fwaas_dashboard.test import helpers as test class FirewallTests(test.TestCase): + class AttributeDict(dict): + def __getattr__(self, attr): + return self[attr] - use_mox = False + def __setattr__(self, attr, value): + self[attr] = value DASHBOARD = 'project' INDEX_URL = reverse('horizon:%s:firewalls:index' % DASHBOARD) @@ -48,59 +52,58 @@ ADDROUTER_PATH = 'horizon:%s:firewalls:addrouter' % DASHBOARD REMOVEROUTER_PATH = 'horizon:%s:firewalls:removerouter' % DASHBOARD - def setup_mocks(self, fwaas_router_extension=True): + def set_up_expect(self, fwaas_router_extension=True): + # retrieve rules + tenant_id = self.tenant.id + + api.neutron.is_extension_supported( + IsA(http.HttpRequest), 'fwaasrouterinsertion' + ).MultipleTimes().AndReturn(fwaas_router_extension) + + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndReturn(self.fw_rules.list()) + + # retrieves policies policies = self.fw_policies.list() + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + # retrieves firewalls firewalls = self.firewalls.list() - routers = self.routers.list() + api_fwaas.firewall_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(firewalls) - self.mock_is_extension_supported.return_value = fwaas_router_extension - self.mock_rule_list_for_tenant.return_value = self.fw_rules.list() - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_list_for_tenant.return_value = firewalls - self.mock_firewall_unassociated_routers_list.return_value = routers - - def check_mocks(self, fwaas_router_extension=True): - tenant_id = self.tenant.id - - self.assert_mock_multiple_calls_with_same_arguments( - self.mock_is_extension_supported, 5, - mock.call(helpers.IsHttpRequest(), 'fwaasrouterinsertion')) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.assert_mock_multiple_calls_with_same_arguments( - self.mock_firewall_unassociated_routers_list, 2, - mock.call(helpers.IsHttpRequest(), tenant_id)) - - def setup_mocks_with_exception(self): - self.mock_is_extension_supported.return_value = True - self.mock_rule_list_for_tenant.side_effect = self.exceptions.neutron - self.mock_policy_list_for_tenant.side_effect = self.exceptions.neutron - self.mock_firewall_list_for_tenant.side_effect = \ - self.exceptions.neutron - - def check_mocks_with_exception(self): - tenant_id = self.tenant.id - - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant', - 'firewall_unassociated_routers_list',), - api.neutron: ('is_extension_supported',), }) + routers = self.routers.list() + api_fwaas.firewall_unassociated_routers_list( + IsA(http.HttpRequest), tenant_id).\ + MultipleTimes().AndReturn(routers) + + def set_up_expect_with_exception(self): + tenant_id = self.tenant.id + + api.neutron.is_extension_supported( + IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) + + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + api_fwaas.firewall_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant', + 'firewall_unassociated_routers_list',), + api.neutron: ('is_extension_supported',), }) def test_index_firewalls(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -111,18 +114,19 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['table'].data), len(self.firewalls.list())) - self.check_mocks() # TODO(absubram): Change test_index_firewalls for with and without # router extensions. - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant', - 'firewall_unassociated_routers_list',), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant', + 'firewall_unassociated_routers_list',), + api.neutron: ('is_extension_supported',), }) def test_index_policies(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -134,15 +138,16 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['policiestable_table'].data), len(self.fw_policies.list())) - self.check_mocks() - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant', - 'firewall_unassociated_routers_list',), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant', + 'firewall_unassociated_routers_list',), + api.neutron: ('is_extension_supported',), }) def test_index_rules(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -154,14 +159,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['rulestable_table'].data), len(self.fw_rules.list())) - self.check_mocks() - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant'), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api.neutron: ('is_extension_supported',), }) def test_index_exception_firewalls(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -173,14 +179,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['table'].data), 0) - self.check_mocks_with_exception() - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant'), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api.neutron: ('is_extension_supported',), }) def test_index_exception_policies(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -193,14 +200,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['policiestable_table'].data), 0) - self.check_mocks_with_exception() - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant'), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api.neutron: ('is_extension_supported',), }) def test_index_exception_rules(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -213,9 +221,8 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['rulestable_table'].data), 0) - self.check_mocks_with_exception() - @helpers.create_mocks({api_fwaas: ('rule_create',), }) + @test.create_stubs({api_fwaas: ('rule_create',), }) def test_add_rule_post(self): rule1 = self.fw_rules.first() @@ -232,16 +239,17 @@ 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **form_data) - @helpers.create_mocks({api_fwaas: ('rule_create',), }) + @test.create_stubs({api_fwaas: ('rule_create',), }) def test_add_rule_post_src_None(self): rule1 = self.fw_rules.first() form_data = {'name': rule1.name, @@ -255,19 +263,17 @@ 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - data = form_data.copy() - data['source_ip_address'] = None - data['source_port'] = None - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) - @helpers.create_mocks({api_fwaas: ('rule_create',), }) + @test.create_stubs({api_fwaas: ('rule_create',), }) def test_add_rule_post_dest_None(self): rule1 = self.fw_rules.first() form_data = {'name': rule1.name, @@ -281,17 +287,15 @@ 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - data = form_data.copy() - data['destination_ip_address'] = None - data['destination_port'] = None - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) def test_add_rule_post_with_error(self): rule1 = self.fw_rules.first() @@ -309,12 +313,14 @@ 'ip_version': 6 } + self.mox.ReplayAll() + res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertFormErrors(res, 3) - @helpers.create_mocks({api_fwaas: ('policy_create', - 'rule_list_for_tenant'), }) + @test.create_stubs({api_fwaas: ('policy_create', + 'rule_list_for_tenant'), }) def test_add_policy_post(self): policy = self.fw_policies.first() rules = self.fw_rules.list() @@ -340,19 +346,20 @@ for rule in rules: if rule.id in policy.firewall_rules: rule.firewall_policy_id = rule.policy = None - self.mock_rule_list_for_tenant.return_value = rules - self.mock_policy_create.return_value = policy + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas.policy_create( + IsA(http.HttpRequest), **form_data).AndReturn(policy) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDPOLICY_PATH), post_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_policy_create.assert_called_once_with( - helpers.IsHttpRequest(), **form_data) - @helpers.create_mocks({api_fwaas: ('rule_list_for_tenant',), }) + @test.create_stubs({api_fwaas: ('policy_create', + 'rule_list_for_tenant'), }) def test_add_policy_post_with_error(self): policy = self.fw_policies.first() rules = self.fw_rules.list() @@ -362,19 +369,15 @@ 'shared': policy.shared, 'audited': policy.audited } - self.mock_rule_list_for_tenant.return_value = rules + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDPOLICY_PATH), form_data) self.assertFormErrors(res, 1) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - @helpers.create_mocks({api_fwaas: ('firewall_create', - 'policy_list_for_tenant', - 'firewall_list_for_tenant',), - api.neutron: ('is_extension_supported', - 'router_list'), }) def _test_add_firewall_post(self, router_extension=False): firewall = self.firewalls.first() policies = self.fw_policies.list() @@ -388,51 +391,46 @@ 'firewall_policy_id': firewall.firewall_policy_id, 'admin_state_up': firewall.admin_state_up } - data = form_data.copy() if router_extension: - # Lookup for unassociated router(s) - associated = [] - for fw in firewalls: - associated += fw.router_ids - unassociated = [r.id for r in routers if r.id not in associated] - form_data['router'] = unassociated - data['router_ids'] = unassociated - self.mock_router_list.return_value = routers - self.mock_firewall_list_for_tenant.return_value = firewalls - - self.mock_is_extension_supported.return_value = router_extension - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_create.return_value = firewall + form_data['router_ids'] = firewall.router_ids + api.neutron.router_list( + IsA(http.HttpRequest), tenant_id=tenant_id).AndReturn(routers) + api_fwaas.firewall_list_for_tenant( + IsA(http.HttpRequest), + tenant_id=tenant_id).AndReturn(firewalls) + + api.neutron.is_extension_supported( + IsA(http.HttpRequest), + 'fwaasrouterinsertion').AndReturn(router_extension) + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + api_fwaas.firewall_create( + IsA(http.HttpRequest), **form_data).AndReturn(firewall) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDFIREWALL_PATH), form_data) self.assertNoFormErrors(res) - # self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - - if router_extension: - self.mock_router_list.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id=tenant_id) - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id=tenant_id) - else: - self.mock_router_list.assert_not_called() - self.mock_firewall_list_for_tenant.assert_not_called() - - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) + self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) + @test.create_stubs({api_fwaas: ('firewall_create', + 'policy_list_for_tenant',), + api.neutron: ('is_extension_supported',), }) def test_add_firewall_post(self): self._test_add_firewall_post() + @test.create_stubs({api_fwaas: ('firewall_create', + 'policy_list_for_tenant', + 'firewall_list_for_tenant',), + api.neutron: ('is_extension_supported', + 'router_list'), }) def test_add_firewall_post_with_router_extension(self): self._test_add_firewall_post(router_extension=True) - @helpers.create_mocks({api_fwaas: ('policy_list_for_tenant',), - api.neutron: ('is_extension_supported',), }) + @test.create_stubs({api_fwaas: ('firewall_create', + 'policy_list_for_tenant',), + api.neutron: ('is_extension_supported',), }) def test_add_firewall_post_with_error(self): firewall = self.firewalls.first() policies = self.fw_policies.list() @@ -442,34 +440,35 @@ 'firewall_policy_id': None, 'admin_state_up': firewall.admin_state_up } - self.mock_is_extension_supported.return_value = False - self.mock_policy_list_for_tenant.return_value = policies + api.neutron.is_extension_supported( + IsA(http.HttpRequest), + 'fwaasrouterinsertion').AndReturn(False) + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDFIREWALL_PATH), form_data) self.assertFormErrors(res, 1) - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - @helpers.create_mocks({api_fwaas: ('rule_get',)}) + @test.create_stubs({api_fwaas: ('rule_get',)}) def test_update_rule_get(self): rule = self.fw_rules.first() - self.mock_rule_get.return_value = rule + api_fwaas.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) + + self.mox.ReplayAll() res = self.client.get(reverse(self.UPDATERULE_PATH, args=(rule.id,))) self.assertTemplateUsed(res, 'project/firewalls/updaterule.html') - self.mock_rule_get.assert_called_once_with(helpers.IsHttpRequest(), - rule.id) - @helpers.create_mocks({api_fwaas: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas: ('rule_get', 'rule_update')}) def test_update_rule_post(self): rule = self.fw_rules.first() - self.mock_rule_get.return_value = rule + api_fwaas.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) data = {'name': 'new name', 'description': 'new desc', @@ -484,7 +483,10 @@ 'destination_port': rule.destination_port, } - self.mock_rule_update.return_value = rule + api_fwaas.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) + + self.mox.ReplayAll() form_data = data.copy() form_data['destination_ip_address'] = '' @@ -496,18 +498,12 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **data) - - @helpers.create_mocks({api_fwaas: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas: ('rule_get', 'rule_update')}) def test_update_protocol_any_rule_post(self): # protocol any means protocol == None in neutron context. rule = self.fw_rules.get(protocol=None) - self.mock_rule_get.return_value = rule - self.mock_rule_update.return_value = rule + api_fwaas.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) data = {'name': 'new name', 'description': 'new desc', @@ -522,6 +518,11 @@ 'destination_port': rule.destination_port, } + api_fwaas.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) + + self.mox.ReplayAll() + form_data = data.copy() form_data['destination_ip_address'] = '' form_data['source_port'] = '' @@ -532,17 +533,11 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **data) - - @helpers.create_mocks({api_fwaas: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas: ('rule_get', 'rule_update')}) def test_update_rule_protocol_to_any_post(self): rule = self.fw_rules.first() - self.mock_rule_get.return_value = rule - self.mock_rule_update.return_value = rule + api_fwaas.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) data = {'name': 'new name', 'description': 'new desc', @@ -556,6 +551,10 @@ 'source_port': None, 'destination_port': rule.destination_port, } + api_fwaas.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) + + self.mox.ReplayAll() form_data = data.copy() form_data['destination_ip_address'] = '' @@ -568,31 +567,27 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **data) - - @helpers.create_mocks({api_fwaas: ('policy_get',)}) + @test.create_stubs({api_fwaas: ('policy_get',)}) def test_update_policy_get(self): policy = self.fw_policies.first() - self.mock_policy_get.return_value = policy + api_fwaas.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + + self.mox.ReplayAll() res = self.client.get( reverse(self.UPDATEPOLICY_PATH, args=(policy.id,))) self.assertTemplateUsed(res, 'project/firewalls/updatepolicy.html') - self.mock_policy_get.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - - @helpers.create_mocks({api_fwaas: ('policy_get', 'policy_update')}) + @test.create_stubs({api_fwaas: ('policy_get', 'policy_update', + 'rule_list_for_tenant')}) def test_update_policy_post(self): policy = self.fw_policies.first() - self.mock_policy_get.return_value = policy - self.mock_policy_update.return_value = policy + api_fwaas.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) data = {'name': 'new name', 'description': 'new desc', @@ -600,47 +595,43 @@ 'audited': False } + api_fwaas.policy_update(IsA(http.HttpRequest), policy.id, **data)\ + .AndReturn(policy) + + self.mox.ReplayAll() + res = self.client.post( reverse(self.UPDATEPOLICY_PATH, args=(policy.id,)), data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - self.mock_policy_update.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **data) - - @helpers.create_mocks({api_fwaas: ('firewall_get', - 'policy_list_for_tenant')}) + @test.create_stubs({api_fwaas: ('firewall_get', 'policy_list_for_tenant')}) def test_update_firewall_get(self): firewall = self.firewalls.first() policies = self.fw_policies.list() tenant_id = self.tenant.id - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_get.return_value = firewall + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + api_fwaas.firewall_get(IsA(http.HttpRequest), + firewall.id).AndReturn(firewall) + + self.mox.ReplayAll() res = self.client.get( reverse(self.UPDATEFIREWALL_PATH, args=(firewall.id,))) self.assertTemplateUsed(res, 'project/firewalls/updatefirewall.html') - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id) - - @helpers.create_mocks({api_fwaas: ('firewall_get', - 'policy_list_for_tenant', - 'firewall_update')}) + @test.create_stubs({api_fwaas: ('firewall_get', 'policy_list_for_tenant', + 'firewall_update')}) def test_update_firewall_post(self): firewall = self.firewalls.first() tenant_id = self.tenant.id - policies = self.fw_policies.list() - self.mock_firewall_get.return_value = firewall - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_update.return_value = firewall + api_fwaas.firewall_get(IsA(http.HttpRequest), + firewall.id).AndReturn(firewall) data = {'name': 'new name', 'description': 'new desc', @@ -648,23 +639,23 @@ 'admin_state_up': False } + policies = self.fw_policies.list() + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + api_fwaas.firewall_update(IsA(http.HttpRequest), firewall.id, **data)\ + .AndReturn(firewall) + + self.mox.ReplayAll() + res = self.client.post( reverse(self.UPDATEFIREWALL_PATH, args=(firewall.id,)), data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_update.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id, **data) - - @helpers.create_mocks({api_fwaas: ('policy_get', - 'policy_insert_rule', - 'rule_list_for_tenant', - 'rule_get')}) + @test.create_stubs({api_fwaas: ('policy_get', 'policy_insert_rule', + 'rule_list_for_tenant', 'rule_get')}) def test_policy_insert_rule(self): policy = self.fw_policies.first() tenant_id = self.tenant.id @@ -676,14 +667,21 @@ 'insert_before': rules[1].id, 'insert_after': rules[0].id} + api_fwaas.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + policy.firewall_rules = [rules[0].id, new_rule_id, rules[1].id] - self.mock_policy_get.return_value = policy - self.mock_rule_list_for_tenant.return_value = rules - self.mock_rule_get.return_value = rules[2] - self.mock_policy_insert_rule.return_value = policy + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas.rule_get( + IsA(http.HttpRequest), new_rule_id).AndReturn(rules[2]) + api_fwaas.policy_insert_rule(IsA(http.HttpRequest), policy.id, **data)\ + .AndReturn(policy) + + self.mox.ReplayAll() res = self.client.post( reverse(self.INSERTRULE_PATH, args=(policy.id,)), data) @@ -691,19 +689,8 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), new_rule_id) - self.mock_policy_insert_rule.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **data) - - @helpers.create_mocks({api_fwaas: ('policy_get', - 'policy_remove_rule', - 'rule_list_for_tenant', - 'rule_get')}) + @test.create_stubs({api_fwaas: ('policy_get', 'policy_remove_rule', + 'rule_list_for_tenant', 'rule_get')}) def test_policy_remove_rule(self): policy = self.fw_policies.first() tenant_id = self.tenant.id @@ -723,10 +710,16 @@ 'shared': True} after_remove_policy = api_fwaas.Policy(after_remove_policy_dict) - self.mock_policy_get.return_value = policy - self.mock_rule_list_for_tenant.return_value = rules - self.mock_rule_get.return_value = rules[0] - self.mock_policy_remove_rule.return_value = after_remove_policy + api_fwaas.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas.rule_get( + IsA(http.HttpRequest), remove_rule_id).AndReturn(rules[0]) + api_fwaas.policy_remove_rule(IsA(http.HttpRequest), policy.id, **data)\ + .AndReturn(after_remove_policy) + + self.mox.ReplayAll() res = self.client.post( reverse(self.REMOVERULE_PATH, args=(policy.id,)), data) @@ -734,19 +727,10 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), remove_rule_id) - self.mock_policy_remove_rule.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **data) - - @helpers.create_mocks({api_fwaas: ('firewall_get', - 'firewall_list_for_tenant', - 'firewall_update', - 'firewall_unassociated_routers_list')}) + @test.create_stubs({api_fwaas: ('firewall_get', + 'firewall_list_for_tenant', + 'firewall_update', + 'firewall_unassociated_routers_list')}) def test_firewall_add_router(self): tenant_id = self.tenant.id firewall = self.firewalls.first() @@ -758,11 +742,18 @@ form_data = {'router_ids': add_router_ids} post_data = {'router_ids': add_router_ids + existing_router_ids} + api_fwaas.firewall_get( + IsA(http.HttpRequest), firewall.id).AndReturn(firewall) + api_fwaas.firewall_unassociated_routers_list( + IsA(http.HttpRequest), tenant_id).AndReturn(routers) + firewall.router_ids = [add_router_ids, existing_router_ids] - self.mock_firewall_get.return_value = firewall - self.mock_firewall_unassociated_routers_list.return_value = routers - self.mock_firewall_update.return_value = firewall + api_fwaas.firewall_update( + IsA(http.HttpRequest), + firewall.id, **post_data).AndReturn(firewall) + + self.mox.ReplayAll() res = self.client.post( reverse(self.ADDROUTER_PATH, args=(firewall.id,)), form_data) @@ -770,16 +761,9 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id) - self.mock_firewall_unassociated_routers_list.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_update.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id, **post_data) - - @helpers.create_mocks({api_fwaas: ('firewall_get', - 'firewall_update'), - api.neutron: ('router_list',), }) + @test.create_stubs({api_fwaas: ('firewall_get', + 'firewall_update'), + api.neutron: ('router_list',), }) def test_firewall_remove_router(self): firewall = self.firewalls.first() tenant_id = self.tenant.id @@ -788,11 +772,16 @@ form_data = {'router_ids': existing_router_ids} + api_fwaas.firewall_get( + IsA(http.HttpRequest), firewall.id).AndReturn(firewall) + api.neutron.router_list( + IsA(http.HttpRequest), tenant_id=tenant_id).AndReturn(routers) firewall.router_ids = [] + api_fwaas.firewall_update( + IsA(http.HttpRequest), + firewall.id, **form_data).AndReturn(firewall) - self.mock_firewall_get.return_value = firewall - self.mock_router_list.return_value = routers - self.mock_firewall_update.return_value = firewall + self.mox.ReplayAll() res = self.client.post( reverse(self.REMOVEROUTER_PATH, args=(firewall.id,)), form_data) @@ -800,70 +789,56 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id) - api.neutron.router_list.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id=tenant_id) - self.mock_firewall_update.assert_called_once_with( - helpers.IsHttpRequest(), firewall.id, **form_data) - - @helpers.create_mocks({api_fwaas: ('rule_list_for_tenant', - 'rule_delete'), - api.neutron: ('is_extension_supported',)}) + @test.create_stubs({api_fwaas: ('rule_list_for_tenant', + 'rule_delete'), + api.neutron: ('is_extension_supported',)}) def test_delete_rule(self): - self.mock_is_extension_supported.return_value = True - self.mock_rule_list_for_tenant.return_value = self.fw_rules.list() - self.mock_rule_delete.return_value = None + api.neutron.is_extension_supported( + IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) rule = self.fw_rules.list()[2] + api_fwaas.rule_list_for_tenant( + IsA(http.HttpRequest), + self.tenant.id).AndReturn(self.fw_rules.list()) + api_fwaas.rule_delete(IsA(http.HttpRequest), rule.id) + self.mox.ReplayAll() + form_data = {"action": "rulestable__deleterule__%s" % rule.id} res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_rule_delete.assert_called_once_with( - helpers.IsHttpRequest(), rule.id) - - @helpers.create_mocks({api_fwaas: ('policy_list_for_tenant', - 'policy_delete'), - api.neutron: ('is_extension_supported',)}) + @test.create_stubs({api_fwaas: ('policy_list_for_tenant', + 'policy_delete'), + api.neutron: ('is_extension_supported',)}) def test_delete_policy(self): - self.mock_is_extension_supported.return_value = True - self.mock_policy_list_for_tenant.return_value = self.fw_policies.list() - self.mock_policy_delete.return_value = None + api.neutron.is_extension_supported( + IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) policy = self.fw_policies.first() + api_fwaas.policy_list_for_tenant( + IsA(http.HttpRequest), + self.tenant.id).AndReturn(self.fw_policies.list()) + api_fwaas.policy_delete(IsA(http.HttpRequest), policy.id) + self.mox.ReplayAll() + form_data = {"action": "policiestable__deletepolicy__%s" % policy.id} res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - api.neutron.is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_policy_delete.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - - @helpers.create_mocks({api_fwaas: ('firewall_list_for_tenant', - 'firewall_delete'), - api.neutron: ('is_extension_supported',)}) + + @test.create_stubs({api_fwaas: ('firewall_list_for_tenant', + 'firewall_delete'), + api.neutron: ('is_extension_supported', + 'router_list',)}) def test_delete_firewall(self): fwl = self.firewalls.first() - self.mock_firewall_list_for_tenant.return_value = [fwl] - self.mock_firewall_delete.return_value = None - self.mock_is_extension_supported.return_value = False + api_fwaas.firewall_list_for_tenant( + IsA(http.HttpRequest), self.tenant.id).AndReturn([fwl]) + api_fwaas.firewall_delete(IsA(http.HttpRequest), fwl.id) + self.mox.ReplayAll() form_data = {"action": "firewallstable__deletefirewall__%s" % fwl.id} res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_firewall_delete.assert_called_once_with( - helpers.IsHttpRequest(), fwl.id) - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/views.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/views.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/views.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/views.py 2018-02-22 06:27:32.000000000 +0000 @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.urls import reverse -from django.urls import reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/workflows.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/workflows.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls/workflows.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls/workflows.py 2018-02-22 06:27:32.000000000 +0000 @@ -262,7 +262,8 @@ class SelectRoutersStep(workflows.Step): action_class = SelectRoutersAction template_name = "project/firewalls/_update_routers.html" - contributes = ("router_ids",) + contributes = ("router_ids", "all_routers_selected", + "Select No Routers") def contribute(self, data, context): if data: diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/forms.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/forms.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/forms.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/forms.py 2018-02-22 06:27:32.000000000 +0000 @@ -15,7 +15,7 @@ import logging from operator import attrgetter -from django.urls import reverse +from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tables.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tables.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tables.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tables.py 2018-02-22 06:27:32.000000000 +0000 @@ -14,8 +14,8 @@ import logging +from django.core.urlresolvers import reverse from django.template import defaultfilters as filters -from django.urls import reverse from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tests.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tests.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tests.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tests.py 2018-02-22 06:27:32.000000000 +0000 @@ -12,18 +12,23 @@ # License for the specific language governing permissions and limitations # under the License. -from django.urls import reverse -import mock +from django.core.urlresolvers import reverse +from django import http +from mox3.mox import IsA -from openstack_dashboard.test import helpers +from openstack_dashboard.api import neutron as api_neutron from neutron_fwaas_dashboard.api import fwaas_v2 as api_fwaas_v2 from neutron_fwaas_dashboard.test import helpers as test class FirewallTests(test.TestCase): + class AttributeDict(dict): + def __getattr__(self, attr): + return self[attr] - use_mox = False + def __setattr__(self, attr, value): + self[attr] = value INDEX_URL = reverse('horizon:project:firewalls_v2:index') @@ -46,46 +51,48 @@ ADDPORT_PATH = 'horizon:project:firewalls_v2:addport' REMOVEPORT_PATH = 'horizon:project:firewalls_v2:removeport' - def setup_mocks(self): - firewallgroups = self.firewall_groups_v2.list() - self.mock_firewall_list_for_tenant.return_value = firewallgroups - policies = self.fw_policies_v2.list() - self.mock_policy_list_for_tenant.return_value = policies - self.mock_rule_list_for_tenant.return_value = self.fw_rules_v2.list() - - def check_mocks(self): + def set_up_expect(self): tenant_id = self.tenant.id - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) + # retrieves firewallgroups + firewallgroups = self.firewall_groups_v2.list() + api_fwaas_v2.firewall_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(firewallgroups) + + # retrieves policies # TODO(amotoki): get_firewallgroupstable_data() also calls # policy_list_for_tenant(). This needs to be clean up. - self.assert_mock_multiple_calls_with_same_arguments( - self.mock_policy_list_for_tenant, 2, - mock.call(helpers.IsHttpRequest(), tenant_id)) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - - def setup_mocks_with_exception(self): - self.mock_rule_list_for_tenant.side_effect = self.exceptions.neutron - self.mock_policy_list_for_tenant.side_effect = self.exceptions.neutron - self.mock_firewall_list_for_tenant.side_effect = \ - self.exceptions.neutron - - def check_mocks_with_exception(self): - tenant_id = self.tenant.id - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant',)}) + policies = self.fw_policies_v2.list() + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + # retrieve rules + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndReturn(self.fw_rules_v2.list()) + + def set_up_expect_with_exception(self): + tenant_id = self.tenant.id + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + api_fwaas_v2.firewall_list_for_tenant( + IsA(http.HttpRequest), + tenant_id).AndRaise(self.exceptions.neutron) + + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant',), + api_neutron: ('is_extension_supported',), }) def test_index_firewallgroups(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -95,13 +102,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['table'].data), len(self.firewall_groups_v2.list())) - self.check_mocks() - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant',)}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant',), + api_neutron: ('is_extension_supported',), }) def test_index_policies(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -112,13 +121,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['policiestable_table'].data), len(self.fw_policies_v2.list())) - self.check_mocks() - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant',)}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant',), + api_neutron: ('is_extension_supported',), }) def test_index_rules(self): - self.setup_mocks() + self.set_up_expect() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -129,13 +140,15 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['rulestable_table'].data), len(self.fw_rules_v2.list())) - self.check_mocks() - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant')}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api_neutron: ('is_extension_supported',), }) def test_index_exception_firewallgroups(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -145,13 +158,14 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['table'].data), 0) - self.check_mocks_with_exception() - - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant')}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api_neutron: ('is_extension_supported',), }) def test_index_exception_policies(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -163,13 +177,14 @@ 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['policiestable_table'].data), 0) - self.check_mocks_with_exception() - - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'rule_list_for_tenant')}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'rule_list_for_tenant'), + api_neutron: ('is_extension_supported',), }) def test_index_exception_rules(self): - self.setup_mocks_with_exception() + self.set_up_expect_with_exception() + + self.mox.ReplayAll() tenant_id = self.tenant.id @@ -180,9 +195,7 @@ self.assertTemplateUsed(res, 'horizon/common/_detail_table.html') self.assertEqual(len(res.context['rulestable_table'].data), 0) - self.check_mocks_with_exception() - - @helpers.create_mocks({api_fwaas_v2: ('rule_create',), }) + @test.create_stubs({api_fwaas_v2: ('rule_create',), }) def test_add_rule_post(self): rule1 = self.fw_rules_v2.first() @@ -199,46 +212,41 @@ 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas_v2.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **form_data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_create',), }) + @test.create_stubs({api_fwaas_v2: ('rule_create',), }) def test_add_rule_post_src_None(self): rule1 = self.fw_rules_v2.first() form_data = {'name': rule1.name, 'description': rule1.description, 'protocol': rule1.protocol, 'action': rule1.action, - 'source_ip_address': '', 'destination_ip_address': rule1.destination_ip_address, - 'source_port': '', 'destination_port': rule1.destination_port, 'shared': rule1.shared, 'enabled': rule1.enabled, 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas_v2.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - data = form_data.copy() - data['source_ip_address'] = None - data['source_port'] = None - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_create',), }) + @test.create_stubs({api_fwaas_v2: ('rule_create',), }) def test_add_rule_post_dest_None(self): rule1 = self.fw_rules_v2.first() form_data = {'name': rule1.name, @@ -246,27 +254,22 @@ 'protocol': rule1.protocol, 'action': rule1.action, 'source_ip_address': rule1.source_ip_address, - 'destination_ip_address': '', 'source_port': rule1.source_port, - 'destination_port': '', 'shared': rule1.shared, 'enabled': rule1.enabled, 'ip_version': rule1.ip_version } - self.mock_rule_create.return_value = rule1 + api_fwaas_v2.rule_create( + IsA(http.HttpRequest), **form_data).AndReturn(rule1) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - data = form_data.copy() - data['destination_ip_address'] = None - data['destination_port'] = None - self.mock_rule_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) - def test_add_rule_post_with_error(self): rule1 = self.fw_rules_v2.first() @@ -283,12 +286,14 @@ 'ip_version': 6 } + self.mox.ReplayAll() + res = self.client.post(reverse(self.ADDRULE_PATH), form_data) self.assertFormErrors(res, 3) - @helpers.create_mocks({api_fwaas_v2: ('policy_create', - 'rule_list_for_tenant'), }) + @test.create_stubs({api_fwaas_v2: ('policy_create', + 'rule_list_for_tenant'), }) def test_add_policy_post(self): policy = self.fw_policies_v2.first() rules = self.fw_rules_v2.list() @@ -314,20 +319,20 @@ for rule in rules: if rule.id in policy.firewall_rules: rule.firewall_policy_id = rule.policy = None - self.mock_rule_list_for_tenant.return_value = rules - self.mock_policy_create.return_value = policy + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas_v2.policy_create( + IsA(http.HttpRequest), **form_data).AndReturn(policy) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDPOLICY_PATH), post_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_policy_create.assert_called_once_with( - helpers.IsHttpRequest(), **form_data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_list_for_tenant',)}) + @test.create_stubs({api_fwaas_v2: ('policy_create', + 'rule_list_for_tenant'), }) def test_add_policy_post_with_error(self): policy = self.fw_policies_v2.first() rules = self.fw_rules_v2.list() @@ -337,54 +342,49 @@ 'shared': policy.shared, 'audited': policy.audited } - self.mock_rule_list_for_tenant.return_value = rules + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDPOLICY_PATH), form_data) self.assertFormErrors(res, 1) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - - @helpers.create_mocks({api_fwaas_v2: ('firewall_group_create', - 'policy_list_for_tenant', - 'fwg_port_list_for_tenant',)}) + @test.create_stubs({api_fwaas_v2: ('firewall_group_create', + 'policy_list_for_tenant', + 'fwg_port_list_for_tenant',), + api_neutron: ('is_extension_supported',), }) def test_add_firewall_group_post(self): - fwg = self.firewall_groups_v2.first() + firewall_group = self.firewall_groups_v2.first() policies = self.fw_policies_v2.list() tenant_id = self.tenant.id - form_data = { - 'name': fwg.name, - 'description': fwg.description, - 'ingress_firewall_policy_id': fwg.ingress_firewall_policy_id, - 'egress_firewall_policy_id': fwg.egress_firewall_policy_id, - 'admin_state_up': fwg.admin_state_up, - 'shared': False, - 'port': [], - } - - self.mock_policy_list_for_tenant.return_value = policies - self.mock_fwg_port_list_for_tenant.return_value = [] - self.mock_firewall_group_create.return_value = fwg + form_data = {'name': firewall_group.name, + 'description': firewall_group.description, + 'ingress_firewall_policy_id': + firewall_group.ingress_firewall_policy_id, + 'egress_firewall_policy_id': + firewall_group.egress_firewall_policy_id, + 'admin_state_up': firewall_group.admin_state_up + } + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + api_fwaas_v2.fwg_port_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn([]) + api_fwaas_v2.firewall_group_create( + IsA(http.HttpRequest), **form_data).AndReturn(firewall_group) + self.mox.ReplayAll() res = self.client.post(reverse(self.ADDFIREWALLGROUP_PATH), form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_fwg_port_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - data = form_data.copy() - data['ports'] = data.pop('port') - self.mock_firewall_group_create.assert_called_once_with( - helpers.IsHttpRequest(), **data) - # TODO(SarathMekala) : Fix this test. - # @helpers.create_mocks({api_fwaas_v2: ('firewall_group_create', - # 'policy_list_for_tenant', - # 'fwg_port_list_for_tenant',)}) + # @test.create_stubs({api_fwaas_v2: ('firewall_group_create', + # 'policy_list_for_tenant', + # 'fwg_port_list_for_tenant',), + # api_neutron: ('is_extension_supported',), }) # def test_add_firewall_post_with_error(self): # firewall_groups = self.firewall_groups_v2.first() # policies = self.fw_policies_v2.list() @@ -393,55 +393,49 @@ # 'description': firewall_groups.description, # 'admin_state_up': False # } - # self.mock_policy_list_for_tenant( - # helpers.IsHttpRequest(), tenant_id).AndReturn(policies) + # api_fwaas_v2.policy_list_for_tenant( + # IsA(http.HttpRequest), tenant_id).AndReturn(policies) # # self.mox.ReplayAll() # res = self.client.post(reverse(self.ADDFIREWALLGROUP_PATH), form_data) # # self.assertFormErrors(res, 1) - @helpers.create_mocks({api_fwaas_v2: ('rule_get',)}) + @test.create_stubs({api_fwaas_v2: ('rule_get',)}) def test_update_rule_get(self): rule = self.fw_rules_v2.first() - self.mock_rule_get.return_value = rule + api_fwaas_v2.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) + + self.mox.ReplayAll() res = self.client.get(reverse(self.UPDATERULE_PATH, args=(rule.id,))) self.assertTemplateUsed(res, 'project/firewalls_v2/updaterule.html') - self.mock_rule_get.assert_called_once_with(helpers.IsHttpRequest(), - rule.id) - @helpers.create_mocks({api_fwaas_v2: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas_v2: ('rule_get', 'rule_update')}) def test_update_rule_post(self): rule = self.fw_rules_v2.first() - self.mock_rule_get.return_value = rule - self.mock_rule_update.return_value = rule + api_fwaas_v2.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) + + data = {'name': 'new name', + 'description': 'new desc', + 'protocol': 'icmp', + 'action': 'allow', + 'shared': False, + 'enabled': True, + 'ip_version': rule.ip_version, + 'source_ip_address': rule.source_ip_address, + 'destination_ip_address': None, + 'source_port': None, + 'destination_port': rule.destination_port, + } + + api_fwaas_v2.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) - data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': 'icmp', - 'action': 'allow', - 'shared': False, - 'enabled': True, - 'ip_version': rule.ip_version, - 'source_ip_address': rule.source_ip_address, - 'destination_ip_address': None, - 'source_port': None, - 'destination_port': rule.destination_port, - } - expected_put_data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': 'icmp', - 'action': 'allow', - 'shared': False, - 'destination_ip_address': None, - 'source_port': None, - } + self.mox.ReplayAll() form_data = data.copy() form_data['destination_ip_address'] = '' @@ -453,41 +447,30 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with(helpers.IsHttpRequest(), - rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **expected_put_data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas_v2: ('rule_get', 'rule_update')}) def test_update_protocol_any_rule_post(self): # protocol any means protocol == None in neutron context. rule = self.fw_rules_v2.get(protocol=None) - self.mock_rule_get.return_value = rule - self.mock_rule_update.return_value = rule + api_fwaas_v2.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) + + data = {'name': 'new name', + 'description': 'new desc', + 'protocol': 'icmp', + 'action': 'allow', + 'shared': False, + 'enabled': True, + 'ip_version': rule.ip_version, + 'source_ip_address': rule.source_ip_address, + 'destination_ip_address': None, + 'source_port': None, + 'destination_port': rule.destination_port, + } - data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': 'icmp', - 'action': 'allow', - 'shared': False, - 'enabled': True, - 'ip_version': rule.ip_version, - 'source_ip_address': rule.source_ip_address, - 'destination_ip_address': None, - 'source_port': None, - 'destination_port': rule.destination_port, - } - expected_put_data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': 'icmp', - 'action': 'allow', - 'shared': False, - 'destination_ip_address': None, - 'source_port': None, - } + api_fwaas_v2.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) + + self.mox.ReplayAll() form_data = data.copy() form_data['destination_ip_address'] = '' @@ -499,41 +482,33 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with(helpers.IsHttpRequest(), - rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **expected_put_data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_get', 'rule_update')}) + @test.create_stubs({api_fwaas_v2: ('rule_get', 'rule_update')}) def test_update_rule_protocol_to_ANY_post(self): rule = self.fw_rules_v2.first() - self.mock_rule_get.return_value = rule - self.mock_rule_update.return_value = rule + api_fwaas_v2.rule_get(IsA(http.HttpRequest), rule.id).AndReturn(rule) - form_data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': 'any', - 'action': 'allow', - 'shared': False, - 'enabled': True, - 'ip_version': rule.ip_version, - 'source_ip_address': rule.source_ip_address, - 'destination_ip_address': '', - 'source_port': '', - 'destination_port': rule.destination_port, - } - - expected_put_data = { - 'name': 'new name', - 'description': 'new desc', - 'protocol': None, - 'action': 'allow', - 'shared': False, - 'destination_ip_address': None, - 'source_port': None, - } + data = {'name': 'new name', + 'description': 'new desc', + 'protocol': None, + 'action': 'allow', + 'shared': False, + 'enabled': True, + 'ip_version': rule.ip_version, + 'source_ip_address': rule.source_ip_address, + 'destination_ip_address': None, + 'source_port': None, + 'destination_port': rule.destination_port, + } + api_fwaas_v2.rule_update(IsA(http.HttpRequest), rule.id, **data)\ + .AndReturn(rule) + + self.mox.ReplayAll() + + form_data = data.copy() + form_data['destination_ip_address'] = '' + form_data['source_port'] = '' + form_data['protocol'] = 'any' res = self.client.post( reverse(self.UPDATERULE_PATH, args=(rule.id,)), form_data) @@ -541,43 +516,38 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_rule_get.assert_called_once_with(helpers.IsHttpRequest(), - rule.id) - self.mock_rule_update.assert_called_once_with( - helpers.IsHttpRequest(), rule.id, **expected_put_data) - - @helpers.create_mocks({api_fwaas_v2: ('policy_get',)}) + @test.create_stubs({api_fwaas_v2: ('policy_get',)}) def test_update_policy_get(self): policy = self.fw_policies_v2.first() - self.mock_policy_get.return_value = policy + api_fwaas_v2.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + + self.mox.ReplayAll() res = self.client.get( reverse(self.UPDATEPOLICY_PATH, args=(policy.id,))) self.assertTemplateUsed(res, 'project/firewalls_v2/updatepolicy.html') - self.mock_policy_get.assert_called_once_with(helpers.IsHttpRequest(), - policy.id) - - @helpers.create_mocks({api_fwaas_v2: ('policy_get', 'policy_update')}) + @test.create_stubs({api_fwaas_v2: ('policy_get', 'policy_update', + 'rule_list_for_tenant')}) def test_update_policy_post(self): policy = self.fw_policies_v2.first() - self.mock_policy_get.return_value = policy - self.mock_policy_update.return_value = policy + api_fwaas_v2.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + + data = {'name': 'new name', + 'description': 'new desc', + 'shared': True, + 'audited': False + } - data = { - 'name': 'new name', - 'description': 'new desc', - 'shared': True, - 'audited': False - } - expected_put_data = { - 'name': 'new name', - 'description': 'new desc', - 'audited': False, - } + api_fwaas_v2.policy_update(IsA(http.HttpRequest), policy.id, **data)\ + .AndReturn(policy) + + self.mox.ReplayAll() res = self.client.post( reverse(self.UPDATEPOLICY_PATH, args=(policy.id,)), data) @@ -585,20 +555,20 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with(helpers.IsHttpRequest(), - policy.id) - self.mock_policy_update.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **expected_put_data) - - @helpers.create_mocks({api_fwaas_v2: ('firewall_get', - 'policy_list_for_tenant')}) + @test.create_stubs({api_fwaas_v2: ('firewall_get', + 'policy_list_for_tenant')}) def test_update_firewall_group_get(self): firewall_group = self.firewall_groups_v2.first() policies = self.fw_policies_v2.list() tenant_id = self.tenant.id - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_get.return_value = firewall_group + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + api_fwaas_v2.firewall_get(IsA(http.HttpRequest), + firewall_group.id).AndReturn(firewall_group) + + self.mox.ReplayAll() res = self.client.get( reverse(self.UPDATEFIREWALLGROUP_PATH, args=(firewall_group.id,))) @@ -606,59 +576,45 @@ self.assertTemplateUsed(res, 'project/firewalls_v2/updatefirewall.html') - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), firewall_group.id) - - @helpers.create_mocks({api_fwaas_v2: ('firewall_get', - 'policy_list_for_tenant', - 'firewall_update')}) + @test.create_stubs({api_fwaas_v2: ('firewall_get', + 'policy_list_for_tenant', + 'firewall_update')}) def test_update_firewall_post(self): - fwg = self.firewall_groups_v2.first() + firewall_group = self.firewall_groups_v2.first() tenant_id = self.tenant.id + api_fwaas_v2.firewall_get(IsA(http.HttpRequest), + firewall_group.id).AndReturn(firewall_group) + + data = {'name': 'new name', + 'description': 'new desc', + 'ingress_firewall_policy_id': + firewall_group.ingress_firewall_policy_id, + 'admin_state_up': False + } + policies = self.fw_policies_v2.list() + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(policies) + + api_fwaas_v2.firewall_update( + IsA(http.HttpRequest), firewall_group.id, **data)\ + .AndReturn(firewall_group) - data = { - 'name': 'new name', - 'description': 'new desc', - 'ingress_firewall_policy_id': fwg.ingress_firewall_policy_id, - 'egress_firewall_policy_id': '', - 'admin_state_up': False, - 'shared': False, - } - - expected_put_data = { - 'name': 'new name', - 'description': 'new desc', - 'egress_firewall_policy_id': None, - 'admin_state_up': False, - } - - self.mock_firewall_get.return_value = fwg - self.mock_policy_list_for_tenant.return_value = policies - self.mock_firewall_update.return_value = fwg + self.mox.ReplayAll() res = self.client.post( reverse( self.UPDATEFIREWALLGROUP_PATH, args=( - fwg.id, + firewall_group.id, )), data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_firewall_get.assert_called_once_with( - helpers.IsHttpRequest(), fwg.id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_firewall_update.assert_called_once_with( - helpers.IsHttpRequest(), fwg.id, **expected_put_data) - - @helpers.create_mocks({api_fwaas_v2: ('policy_get', 'policy_insert_rule', - 'rule_list_for_tenant', 'rule_get')}) + @test.create_stubs({api_fwaas_v2: ('policy_get', 'policy_insert_rule', + 'rule_list_for_tenant', 'rule_get')}) def test_policy_insert_rule(self): policy = self.fw_policies_v2.first() tenant_id = self.tenant.id @@ -670,15 +626,21 @@ 'insert_before': rules[1].id, 'insert_after': rules[0].id} - self.mock_policy_get.return_value = policy + api_fwaas_v2.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) policy.firewall_rules = [rules[0].id, new_rule_id, rules[1].id] - self.mock_rule_list_for_tenant.return_value = rules - self.mock_rule_get.return_value = rules[2] - self.mock_policy_insert_rule.return_value = policy + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas_v2.rule_get( + IsA(http.HttpRequest), new_rule_id).AndReturn(rules[2]) + api_fwaas_v2.policy_insert_rule( + IsA(http.HttpRequest), policy.id, **data) .AndReturn(policy) + + self.mox.ReplayAll() res = self.client.post( reverse(self.INSERTRULE_PATH, args=(policy.id,)), data) @@ -686,17 +648,8 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with(helpers.IsHttpRequest(), - policy.id) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), new_rule_id) - self.mock_policy_insert_rule.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **data) - - @helpers.create_mocks({api_fwaas_v2: ('policy_get', 'policy_remove_rule', - 'rule_list_for_tenant', 'rule_get')}) + @test.create_stubs({api_fwaas_v2: ('policy_get', 'policy_remove_rule', + 'rule_list_for_tenant', 'rule_get')}) def test_policy_remove_rule(self): policy = self.fw_policies_v2.first() tenant_id = self.tenant.id @@ -716,10 +669,16 @@ 'shared': True} after_remove_policy = api_fwaas_v2.Policy(after_remove_policy_dict) - self.mock_policy_get.return_value = policy - self.mock_rule_list_for_tenant.return_value = rules - self.mock_rule_get.return_value = rules[0] - self.mock_policy_remove_rule.return_value = after_remove_policy + api_fwaas_v2.policy_get(IsA(http.HttpRequest), + policy.id).AndReturn(policy) + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), tenant_id).AndReturn(rules) + api_fwaas_v2.rule_get( + IsA(http.HttpRequest), remove_rule_id).AndReturn(rules[0]) + api_fwaas_v2.policy_remove_rule(IsA(http.HttpRequest), policy.id, **data)\ + .AndReturn(after_remove_policy) + + self.mox.ReplayAll() res = self.client.post( reverse(self.REMOVERULE_PATH, args=(policy.id,)), data) @@ -727,62 +686,51 @@ self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, str(self.INDEX_URL)) - self.mock_policy_get.assert_called_once_with(helpers.IsHttpRequest(), - policy.id) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id) - self.mock_rule_get.assert_called_once_with( - helpers.IsHttpRequest(), remove_rule_id) - self.mock_policy_remove_rule.assert_called_once_with( - helpers.IsHttpRequest(), policy.id, **data) - - @helpers.create_mocks({api_fwaas_v2: ('rule_list_for_tenant', - 'rule_delete')}) + @test.create_stubs({api_fwaas_v2: ('rule_list_for_tenant', + 'rule_delete'), + api_neutron: ('is_extension_supported',)}) def test_delete_rule(self): rule = self.fw_rules_v2.list()[2] - - self.mock_rule_list_for_tenant.return_value = self.fw_rules_v2.list() - self.mock_rule_delete.return_value = None + api_fwaas_v2.rule_list_for_tenant( + IsA(http.HttpRequest), + self.tenant.id).AndReturn(self.fw_rules_v2.list()) + api_fwaas_v2.rule_delete(IsA(http.HttpRequest), rule.id) + self.mox.ReplayAll() form_data = {"action": "rulestable__deleterule__%s" % rule.id} res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - self.mock_rule_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_rule_delete.assert_called_once_with( - helpers.IsHttpRequest(), rule.id) - - @helpers.create_mocks({api_fwaas_v2: ('policy_list_for_tenant', - 'policy_delete')}) + @test.create_stubs({api_fwaas_v2: ('policy_list_for_tenant', + 'policy_delete'), + api_neutron: ('is_extension_supported',)}) def test_delete_policy(self): policy = self.fw_policies_v2.first() - - self.mock_policy_list_for_tenant.return_value = \ - self.fw_policies_v2.list() - self.mock_policy_delete.return_value = None + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), + self.tenant.id).AndReturn(self.fw_policies_v2.list()) + api_fwaas_v2.policy_delete(IsA(http.HttpRequest), policy.id) + self.mox.ReplayAll() form_data = {"action": "policiestable__deletepolicy__%s" % policy.id} res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_policy_delete.assert_called_once_with( - helpers.IsHttpRequest(), policy.id) - - @helpers.create_mocks({api_fwaas_v2: ('firewall_list_for_tenant', - 'policy_list_for_tenant', - 'firewall_delete',)}) + @test.create_stubs({api_fwaas_v2: ('firewall_list_for_tenant', + 'policy_list_for_tenant', + 'firewall_delete',), + api_neutron: ('is_extension_supported',)}) def test_delete_firewall_group(self): fwl = self.firewall_groups_v2.first() - - self.mock_firewall_list_for_tenant.return_value = [fwl] - self.mock_policy_list_for_tenant.return_value = \ - self.fw_policies_v2.list() - self.mock_firewall_delete.return_value = None + api_fwaas_v2.firewall_list_for_tenant( + IsA(http.HttpRequest), self.tenant.id).AndReturn([fwl]) + api_fwaas_v2.policy_list_for_tenant( + IsA(http.HttpRequest), + self.tenant.id).AndReturn(self.fw_policies_v2.list()) + api_fwaas_v2.firewall_delete(IsA(http.HttpRequest), fwl.id) + self.mox.ReplayAll() form_data = { "action": "FirewallGroupsTable__deletefirewallgroup__%s" % @@ -790,10 +738,3 @@ res = self.client.post(self.INDEX_URL, form_data) self.assertNoFormErrors(res) - - self.mock_firewall_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_policy_list_for_tenant.assert_called_once_with( - helpers.IsHttpRequest(), self.tenant.id) - self.mock_firewall_delete.assert_called_once_with( - helpers.IsHttpRequest(), fwl.id) diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/views.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/views.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/views.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/views.py 2018-02-22 06:27:32.000000000 +0000 @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.urls import reverse -from django.urls import reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/de/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/de/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/de/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/de/LC_MESSAGES/django.po 2018-02-22 06:27:32.000000000 +0000 @@ -5,21 +5,20 @@ # Frank Kloeker , 2017. #zanata # Robert Simai , 2017. #zanata # Andreas Jaeger , 2018. #zanata -# Frank Kloeker , 2018. #zanata # Reik Keutterling , 2018. #zanata msgid "" msgstr "" "Project-Id-Version: neutron-fwaas-dashboard VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-05-02 12:02+0000\n" +"POT-Creation-Date: 2018-02-21 10:13+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-05-08 12:12+0000\n" -"Last-Translator: Frank Kloeker \n" +"PO-Revision-Date: 2018-02-21 07:55+0000\n" +"Last-Translator: Reik Keutterling \n" "Language-Team: German\n" "Language: de\n" -"X-Generator: Zanata 4.3.3\n" +"X-Generator: Zanata 3.9.6\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" msgid "-" @@ -308,9 +307,6 @@ msgid "Description" msgstr "Beschreibung" -msgid "Description:" -msgstr "Beschreibung:" - msgid "Destination IP" msgstr "Ziel-IP" diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/en_GB/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/en_GB/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/en_GB/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/en_GB/LC_MESSAGES/django.po 2018-02-22 06:27:32.000000000 +0000 @@ -4,15 +4,15 @@ msgstr "" "Project-Id-Version: neutron-fwaas-dashboard VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-02-22 06:54+0000\n" +"POT-Creation-Date: 2018-02-21 10:13+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-02-21 01:51+0000\n" +"PO-Revision-Date: 2018-02-21 01:50+0000\n" "Last-Translator: Andi Chandler \n" "Language-Team: English (United Kingdom)\n" -"Language: en_GB\n" -"X-Generator: Zanata 4.3.3\n" +"Language: en-GB\n" +"X-Generator: Zanata 3.9.6\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" msgid "-" @@ -73,9 +73,6 @@ msgid "Add Port" msgstr "Add Port" -msgid "Add Port to Firewall Group" -msgstr "Add Port to Firewall Group" - msgid "Add Router" msgstr "Add Router" @@ -121,9 +118,6 @@ msgid "Admin State" msgstr "Admin State" -msgid "Admin State Up" -msgstr "Admin State Up" - msgid "After" msgstr "After" @@ -133,50 +127,9 @@ msgid "Audited" msgstr "Audited" -msgid "Available Ports" -msgstr "Available Ports" - -msgid "Available Routers" -msgstr "Available Routers" - -msgid "Available Rules" -msgstr "Available Rules" - msgid "Before" msgstr "Before" -msgid "Choose port(s) from Available Ports. " -msgstr "Choose port(s) from Available Ports. " - -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " - -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." - -msgid "Choose the router(s) you want to add." -msgstr "Choose the router(s) you want to add." - -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." - -msgid "Choose the rule you want to remove." -msgstr "Choose the rule you want to remove." - msgid "Create Firewall" msgstr "Create Firewall" @@ -347,15 +300,9 @@ msgid "Description" msgstr "Description" -msgid "Description:" -msgstr "Description:" - msgid "Destination IP" msgstr "Destination IP" -msgid "Destination IP Address" -msgstr "Destination IP Address" - msgid "Destination IP Address/Subnet" msgstr "Destination IP Address/Subnet" @@ -406,9 +353,6 @@ msgid "Egress Policy" msgstr "Egress Policy" -msgid "Egress Policy ID" -msgstr "Egress Policy ID" - msgid "Enable Admin State" msgstr "Enable Admin State" @@ -507,9 +451,6 @@ msgid "ICMP" msgstr "ICMP" -msgid "ID" -msgstr "ID" - msgid "IP Version" msgstr "IP Version" @@ -530,9 +471,6 @@ msgid "Ingress Policy" msgstr "Ingress Policy" -msgid "Ingress Policy ID" -msgstr "Ingress Policy ID" - msgid "Insert Rule" msgstr "Insert Rule" @@ -591,12 +529,6 @@ msgid "Ports" msgstr "Ports" -msgid "Position in Policy" -msgstr "Position in Policy" - -msgid "Project ID" -msgstr "Project ID" - msgid "Protocol" msgstr "Protocol" @@ -617,9 +549,6 @@ msgid "Remove Port" msgstr "Remove Port" -msgid "Remove Port from Firewall Group" -msgstr "Remove Port from Firewall Group" - msgid "Remove Router" msgstr "Remove Router" @@ -712,24 +641,12 @@ msgid "Select rules for your policy." msgstr "Select rules for your policy." -msgid "Selected Ports" -msgstr "Selected Ports" - -msgid "Selected Routers" -msgstr "Selected Routers" - -msgid "Selected Rules" -msgstr "Selected Rules" - msgid "Shared" msgstr "Shared" msgid "Source IP" msgstr "Source IP" -msgid "Source IP Address" -msgstr "Source IP Address" - msgid "Source IP Address/Subnet" msgstr "Source IP Address/Subnet" @@ -858,38 +775,3 @@ msgid "Unselect the router(s) to be removed from firewall." msgstr "Unselect the router(s) to be removed from firewall." - -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "Unselect the routers you want to disassociate from the firewall." - -msgid "Used in Policy" -msgstr "Used in Policy" - -msgid "You may add ports to firewall group here." -msgstr "You may add ports to firewall group here." - -msgid "You may remove ports from firewall group here." -msgstr "You may remove ports from firewall group here." - -msgid "You may update firewall details here." -msgstr "You may update firewall details here." - -msgid "You may update firewall group details here." -msgstr "You may update firewall group details here." - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" -msgstr "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule." -msgstr "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule." - -msgid "You may update rule details here." -msgstr "You may update rule details here." diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/fr/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/fr/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/fr/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/fr/LC_MESSAGES/django.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,781 +0,0 @@ -# Adrien Cunin , 2016. #zanata -# Gérald LONLAS , 2016. #zanata -# Sylvie Chesneau , 2016. #zanata -# Cédric Savignan , 2017. #zanata -# JF Taltavull , 2017. #zanata -# Loic Nicolle , 2017. #zanata -# Pascal Larivée , 2017. #zanata -# Loic Nicolle , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: neutron-fwaas-dashboard VERSION\n" -"Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-03-28 00:10+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-03-27 03:11+0000\n" -"Last-Translator: Loic Nicolle \n" -"Language-Team: French\n" -"Language: fr\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" - -msgid "-" -msgstr "-" - -msgid "ALLOW" -msgstr "AUTORISER" - -msgctxt "Action Name of a Firewall Rule" -msgid "ALLOW" -msgstr "AUTORISER" - -msgctxt "Action name of a firewall rule" -msgid "ALLOW" -msgstr "AUTORISER" - -msgid "ANY" -msgstr "TOUT" - -msgid "Action" -msgstr "Action" - -msgid "Action for the firewall rule" -msgstr "Action pour la règle de pare-feu" - -msgctxt "Current status of a Firewall Group" -msgid "Active" -msgstr "Actif" - -msgctxt "Current status of a firewall" -msgid "Active" -msgstr "Actif" - -msgid "Add" -msgstr "Ajouter" - -msgid "Add Firewall" -msgstr "Ajouter un pare-feu" - -msgid "Add Firewall Group" -msgstr "Ajouter un groupe de pare-feux" - -msgid "Add New Firewall" -msgstr "Ajouter un nouveau pare-feu" - -msgid "Add New Policy" -msgstr "Ajouter une nouvelle stratégie" - -msgid "Add New Rule" -msgstr "Ajouter une nouvelle règle" - -msgid "Add Policy" -msgstr "Ajouter une stratégie" - -msgid "Add Router" -msgstr "Ajouter un routeur" - -msgid "Add Router to Firewall" -msgstr "Ajouter un routeur au pare-feu" - -msgid "Add Routers" -msgstr "Ajouter des routeurs" - -msgid "Add Rule" -msgstr "Ajouter une règle" - -msgid "Add selected router(s) to the firewall." -msgstr "Ajouter le ou les routeurs sélectionnés au pare-feu." - -#, python-format -msgid "Added Policy \"%s\"." -msgstr "Stratégie \"%s\" ajoutée." - -#, python-format -msgid "Added Rule \"%s\"." -msgstr "Règle \"%s\" ajoutée." - -#, python-format -msgid "Added firewall \"%s\"." -msgstr "Pare-feu \"%s\" ajouté." - -#, python-format -msgid "Added policy \"%s\"." -msgstr "Stratégie \"%s\" ajoutée." - -#, python-format -msgid "Added rule \"%s\"." -msgstr "Règle \"%s\" ajoutée." - -msgid "Admin State" -msgstr "État Administateur" - -msgid "Admin State Up" -msgstr "Etat Admin activé" - -msgid "After" -msgstr "Après" - -msgid "Associated Routers" -msgstr "Routeurs associés" - -msgid "Audited" -msgstr "Audité" - -msgid "Available Ports" -msgstr "Ports disponibles" - -msgid "Available Routers" -msgstr "Routeurs disponibles" - -msgid "Available Rules" -msgstr "Règles disponibles" - -msgid "Before" -msgstr "Avant" - -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"Choisir les routeur(s) en les déplaçant de Routeurs Disponibles vers les " -"Routeurs Sélectionnés en cliquant sur le bouton ou par glisser-déposer." - -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"Choisissez une ou plusieurs règles en les faisant passer des règles " -"disponibles aux règles sélectionnées en cliquant sur le bouton ou par " -"glisser-déposer. Vous pouvez aussi changer l'ordre des règles par glisser-" -"déposer." - -msgid "Choose the router(s) you want to add." -msgstr "Choisir le(s) routeur(s) que vous voulez ajouter." - -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"Choisissez la règle que vous souhaitez insérer. Spécifiez la règle qui doit " -"précéder immédiatement votre nouvelle règle, ou la règle qui doit suivre " -"immédiatement votre nouvelle règle. Si vous spécifiez les deux, le premier " -"critère est prioritaire." - -msgid "Choose the rule you want to remove." -msgstr "Choisissez la règle que vous voulez enlever." - -msgid "Create Firewall" -msgstr "Créer un pare-feu" - -msgid "Create a Firewall Group with selected ports." -msgstr "Créer un groupe de pare-feux avec les ports sélectionnés." - -msgid "" -"Create a firewall based on a policy.\n" -"\n" -"A firewall represents a logical firewall resource that a tenant can " -"instantiate and manage. A firewall must be associated with one policy, all " -"other fields are optional." -msgstr "" -"Créer un pare-feu basé sur une stratégie.\n" -"\n" -"Un pare-feu représente une ressource de pare-feu logique pouvant être " -"instanciée et gérée par un locataire. Un pare-feu doit être associé à une " -"stratégie, toutes les autres zones sont facultatives." - -msgid "" -"Create a firewall policy with an ordered list of firewall rules.\n" -"\n" -"A firewall policy is an ordered collection of firewall rules. So if the " -"traffic matches the first rule, the other rules are not executed. If the " -"traffic does not match the current rule, then the next rule is executed. A " -"firewall policy has the following attributes:\n" -"\n" -"
  • Shared: A firewall policy can be shared across tenants. Thus it can also " -"be made part of an audit workflow wherein the firewall policy can be audited " -"by the relevant entity that is authorized.
  • Audited: When audited is " -"set to True, it indicates that the firewall policy has been audited. Each " -"time the firewall policy or the associated firewall rules are changed, this " -"attribute will be set to False and will have to be explicitly set to True " -"through an update operation.
  • \n" -"The name field is required, all others are optional." -msgstr "" -"Créer une stratégie de pare-feu avec une liste ordonnée de règles de pare-" -"feu.\n" -"\n" -"Une stratégie de pare-feu est un ensemble ordonné de règles de pare-feu. Si " -"le trafic correspond à la première règle, les autres règles ne sont pas " -"exécutées. Si le trafic ne correspond pas à la règle en cours, la règle " -"suivante est exécutée. Une stratégie de pare-feu comporte les attributs " -"suivants :\n" -"\n" -"
  • Partagé (shared) : Une stratégie de pare-feu peut être partagée entre " -"locataires. Elle peut ainsi faire partie d'un flux de travaux d'audit au " -"sein duquel la stratégie de pare-feu peut être auditée par l'entité " -"appropriée autorisée.
  • Audité (audited) : Lorsque l'attribut est " -"défini sur True, la stratégie de pare-feu a été auditée. Chaque fois qu'une " -"stratégie de pare-feu ou les règles de pare-feu associées sont modifiées, " -"cet attribut est défini sur False et devra être explicitement défini avec la " -"valeur True via une opération de mise à jour.
  • \n" -"La zone de nom est obligatoire, toutes les autres sont facultatives." - -msgid "" -"Create a firewall rule.\n" -"\n" -"A Firewall rule is an association of the following attributes:\n" -"\n" -"
  • IP Addresses: The addresses from/to which the traffic filtration needs " -"to be applied.
  • IP Version: The type of IP packets (IP V4/V6) that " -"needs to be filtered.
  • Protocol: Type of packets (UDP, ICMP, TCP, " -"Any) that needs to be checked.
  • Action: Action is the type of " -"filtration required, it can be Reject/Deny/Allow data packets.
  • \n" -"The protocol and action fields are required, all others are optional." -msgstr "" -"Créer une règle de pare-feu.\n" -"\n" -"Une règle de pare-feu est une association des attributs suivants :\n" -"\n" -"
  • Adresses IP : Adresses depuis/vers lesquelles le filtrage du trafic doit " -"s'appliquer.
  • Version d'IP : Type des paquets IP (IP V4/V6) à filtrer." -"
  • Protocole : Type des paquets (UDP, ICMP, TCP, Tout) à vérifier.
  • Action : Type de filtrage requis ; Il peut s'agir de Rejeter/Refuser/" -"Autoriser les paquets de données.
  • \n" -"Les zones de protocole et d'action sont obligatoires, toutes les autres sont " -"facultatives." - -msgid "" -"Create a firewall rule.\n" -"\n" -"A firewall rule is an association of the following attributes:\n" -"\n" -"
  • IP Addresses: The addresses from/to which the traffic filtration needs " -"to be applied.
  • IP Version: The type of IP packets (IP V4/V6) that " -"needs to be filtered.
  • Protocol: Type of packets (UDP, ICMP, TCP, " -"Any) that needs to be checked.
  • Action: Action is the type of " -"filtration required, it can be Reject/Deny/Allow data packets.
  • \n" -"The protocol and action fields are required, all others are optional." -msgstr "" -"Créer une règle de pare-feu.\n" -"\n" -"Une règle de pare-feu est une association des attributs suivants :\n" -"\n" -"
  • Adresses IP : Adresses depuis/vers lesquelles le filtrage du trafic doit " -"s'appliquer.
  • Version d'IP : Type des paquets IP (IP V4/V6) à filtrer." -"
  • Protocole : Type des paquets (UDP, ICMP, TCP, Tout) à vérifier.
  • Action : Type de filtrage requis ; Il peut s'agir de Rejeter/Refuser/" -"Autoriser les paquets de données.
  • \n" -"Les zones de protocole et d'action sont obligatoires, toutes les autres sont " -"facultatives." - -msgid "Create a firewall with selected routers." -msgstr "Créer un pare-feu avec les routeurs sélectionnés." - -msgid "Create a policy with selected rules." -msgstr "Créer une stratégie avec les règles sélectionnées." - -msgctxt "Current status of a Firewall Group" -msgid "Created" -msgstr "Créé" - -msgctxt "Current status of a firewall" -msgid "Created" -msgstr "Créé" - -msgid "DENY" -msgstr "REFUSER" - -msgctxt "Action Name of a Firewall Rule" -msgid "DENY" -msgstr "REFUSER" - -msgctxt "Action name of a firewall rule" -msgid "DENY" -msgstr "REFUSER" - -msgctxt "Admin state of a Firewall Group" -msgid "DOWN" -msgstr "INACTIF" - -msgctxt "Admin state of a firewall" -msgid "DOWN" -msgstr "INACTIF" - -msgid "Delete Firewall" -msgid_plural "Delete Firewalls" -msgstr[0] "Supprimer le pare-feu" -msgstr[1] "Supprimer les pare-feux" - -msgid "Delete Policy" -msgid_plural "Delete Policies" -msgstr[0] "Supprimer la stratégie" -msgstr[1] "Supprimer les stratégies" - -msgid "Delete Rule" -msgid_plural "Delete Rules" -msgstr[0] "Supprimer la règle" -msgstr[1] "Supprimer les règles" - -msgid "Description" -msgstr "Description" - -msgid "Description:" -msgstr "Description:" - -msgid "Destination IP" -msgstr "IP de destination" - -msgid "Destination IP Address" -msgstr "Adresse IP de destination" - -msgid "Destination IP Address/Subnet" -msgstr "Adresse IP/Sous-réseau de destination" - -msgid "Destination IP address or subnet" -msgstr "Adresse IP ou sous-réseau de destination" - -msgid "Destination Port" -msgstr "Port de destination" - -msgid "Destination Port/Port Range" -msgstr "Port/Plage de ports de destination" - -msgid "Destination port (integer in [1, 65535] or range in a:b)" -msgstr "Port de destination (entier compris dans [1, 65535] ou plage a:b)" - -msgctxt "Current status of a Firewall Group" -msgid "Down" -msgstr "Inactif" - -msgctxt "Current status of a firewall" -msgid "Down" -msgstr "Inactif" - -msgid "Edit Firewall" -msgstr "Éditer le pare-feu" - -msgid "Edit Firewall {{ name }}" -msgstr "Editer le pare-feu {{ name }}" - -msgid "Edit Policy" -msgstr "Editer la stratégie" - -msgid "Edit Policy {{ name }}" -msgstr "Editer la stratégie {{ name }}" - -msgid "Edit Rule" -msgstr "Éditer la règle" - -msgid "Edit Rule {{ name }}" -msgstr "Editer la règle {{ name }}" - -msgid "Egress Policy" -msgstr "Stratégie sortante" - -msgid "Enable Admin State" -msgstr "État Administratif Actif" - -msgid "Enabled" -msgstr "Activé" - -msgctxt "Current status of a Firewall Group" -msgid "Error" -msgstr "Erreur" - -msgctxt "Current status of a firewall" -msgid "Error" -msgstr "Erreur" - -#, python-format -msgid "Failed to add router(s) to firewall %(name)s: %(reason)s" -msgstr "Echec d'ajout du ou des routeurs au pare-feu %(name)s : %(reason)s" - -#, python-format -msgid "Failed to insert rule to policy %(name)s: %(reason)s" -msgstr "Echec d'insertion de la règle dans la stratégie %(name)s : %(reason)s" - -#, python-format -msgid "Failed to remove router(s) from firewall %(name)s: %(reason)s" -msgstr "Échec à retirer routeur(s) du pare-feu %(name)s: %(reason)s" - -#, python-format -msgid "Failed to remove rule from policy %(name)s: %(reason)s" -msgstr "Echec de retrait de la règle de la stratégie %(name)s : %(reason)s" - -#, python-format -msgid "Failed to retrieve available routers: %s" -msgstr "Échec de la récupération des routeurs disponibles: %s" - -#, python-format -msgid "Failed to retrieve available rules: %s" -msgstr "Impossible de récupérer les règles disponibles : %s" - -#, python-format -msgid "Failed to retrieve current routers in firewall %(name)s: %(reason)s" -msgstr "" -"Échec de la récupération des routeurs dans le pare-feu %(name)s: %(reason)s" - -#, python-format -msgid "Failed to retrieve current rules in policy %(name)s: %(reason)s" -msgstr "" -"Échec de la récupération des règles courantes de la stratégie %(name)s : " -"%(reason)s" - -#, python-format -msgid "Failed to update firewall %(name)s: %(reason)s" -msgstr "Échec de la mise à jour du pare-feu %(name)s : %(reason)s" - -#, python-format -msgid "Failed to update policy %(name)s: %(reason)s" -msgstr "Echec de mise à jour de la stratégie %(name)s : %(reason)s" - -#, python-format -msgid "Failed to update rule %(name)s: %(reason)s" -msgstr "Échec de la mise à jour de la règle %(name)s : %(reason)s" - -msgid "Firewall" -msgstr "Pare-feu" - -#, python-format -msgid "Firewall %s was successfully updated." -msgstr "Le pare-feu %s a été mis à jour." - -msgid "Firewall Policies" -msgstr "Stratégies de pare-feu" - -msgid "Firewall Rules" -msgstr "Règles de pare-feu" - -msgid "Firewalls" -msgstr "Pare-feux" - -msgid "ICMP" -msgstr "ICMP" - -msgid "ID" -msgstr "ID" - -msgid "IP Version" -msgstr "Version d'IP" - -msgid "IP Version for Firewall Rule" -msgstr "Version d'IP pour la règle de pare-feu" - -msgid "In Policy" -msgstr "Stratégies associées" - -msgctxt "Current status of a Firewall Group" -msgid "Inactive" -msgstr "Inactif" - -msgctxt "Current status of a firewall" -msgid "Inactive" -msgstr "Inactif" - -msgid "Ingress Policy" -msgstr "Stratégie entrante" - -msgid "Insert Rule" -msgstr "Insérer une règle" - -msgid "Insert Rule to Policy" -msgstr "Insérer une règle dans la stratégie" - -msgid "Name" -msgstr "Nom" - -msgid "None" -msgstr "Aucun" - -msgctxt "Current status of a Firewall Group" -msgid "Pending Create" -msgstr "Création en attente" - -msgctxt "Current status of a firewall" -msgid "Pending Create" -msgstr "Création en attente" - -msgctxt "Current status of a Firewall Group" -msgid "Pending Delete" -msgstr "Suppression en attente" - -msgctxt "Current status of a firewall" -msgid "Pending Delete" -msgstr "Suppression en attente" - -msgctxt "Current status of a Firewall Group" -msgid "Pending Update" -msgstr "Mise à jour en attente" - -msgctxt "Current status of a firewall" -msgid "Pending Update" -msgstr "Mise à jour en attente" - -msgid "Policies" -msgstr "Stratégies" - -msgid "Policy" -msgstr "Stratégie" - -#, python-format -msgid "Policy %s was successfully updated." -msgstr "La stratégie %s a été mise à jour." - -msgid "Ports" -msgstr "Ports" - -msgid "Position in Policy" -msgstr "Position dans la stratégie" - -msgid "Project ID" -msgstr "Project ID" - -msgid "Protocol" -msgstr "Protocole" - -msgid "Protocol for the firewall rule" -msgstr "Protocole pour la règle de pare-feu" - -msgid "REJECT" -msgstr "REJETER" - -msgctxt "Action Name of a Firewall Rule" -msgid "REJECT" -msgstr "REJETER" - -msgctxt "Action name of a firewall rule" -msgid "REJECT" -msgstr "REJETER" - -msgid "Remove Port" -msgstr "Supprimer le port" - -msgid "Remove Router" -msgstr "Supprimer le routeur" - -msgid "Remove Router from Firewall" -msgstr "Retirer un routeur du pare-feu" - -msgid "Remove Rule" -msgstr "Retirer la règle" - -msgid "Remove Rule from Policy" -msgstr "Retirer une règle de la stratégie" - -#, python-format -msgid "Router(s) was successfully removed from firewall %(firewall)s." -msgstr "Le ou les routeurs ont été retirés du pare-feu %(firewall)s." - -#, python-format -msgid "Router(s) was/were successfully added to firewall %(firewall)s." -msgstr "Le ou les routeurs ont été ajoutés au pare-feu %(firewall)s." - -msgid "Routers" -msgstr "Routeurs" - -msgid "Rule" -msgstr "Règle" - -#, python-format -msgid "Rule %(rule)s was successfully inserted to policy %(policy)s." -msgstr "La règle %(rule)s a été insérée dans la stratégie %(policy)s." - -#, python-format -msgid "Rule %(rule)s was successfully removed from policy %(policy)s." -msgstr "La règle %(rule)s a été retirée de la stratégie %(policy)s." - -#, python-format -msgid "Rule %s was successfully updated." -msgstr "La règle %s a été mise à jour." - -msgid "Rules" -msgstr "Règles" - -msgid "Save Changes" -msgstr "Enregistrer les changements" - -msgid "Scheduled deletion of Policy" -msgid_plural "Scheduled deletion of Policies" -msgstr[0] "Suppression planifiée de la stratégie" -msgstr[1] "Suppression planifiée des stratégies" - -msgid "Scheduled deletion of Rule" -msgid_plural "Scheduled deletion of Rules" -msgstr[0] "Suppression planifiée de la règle" -msgstr[1] "Suppression planifiée des règles" - -#, fuzzy -msgid "Scheduled deletion of rule" -msgid_plural "Scheduled deletion of rules" -msgstr[0] "Suppression planifiée de la règle" -msgstr[1] "" - -msgid "Select a Policy" -msgstr "Sélectionner une stratégie" - -msgid "Select a policy" -msgstr "Sélectionner une stratégie" - -msgid "Select routers for your firewall." -msgstr "Sélectionnez des routeurs pour votre pare-feu." - -msgid "Select rules for your policy." -msgstr "Sélectionnez des règles pour votre stratégie." - -msgid "Selected Routers" -msgstr "Routeurs sélectionnés" - -msgid "Selected Rules" -msgstr "Règles sélectionnées" - -msgid "Shared" -msgstr "Partagé" - -msgid "Source IP" -msgstr "IP source" - -msgid "Source IP Address" -msgstr "Adresse IP source" - -msgid "Source IP Address/Subnet" -msgstr "Adresse IP/Sous-réseau source" - -msgid "Source IP address or subnet" -msgstr "Adresse IP ou sous-réseau source" - -msgid "Source Port" -msgstr "Port source" - -msgid "Source Port/Port Range" -msgstr "Port/plage de ports source" - -msgid "Source port (integer in [1, 65535] or range in a:b)" -msgstr "Port source (entier compris dans [1,65535] ou plage a:b)" - -msgid "" -"Source/Destination Network Address and IP version are inconsistent. Please " -"make them consistent." -msgstr "" -"La version d'IP et l'adresse réseau source/de destination ne sont pas " -"cohérentes. Corrigez-les en conséquence." - -msgid "Status" -msgstr "Statut" - -msgid "TCP" -msgstr "TCP" - -msgid "UDP" -msgstr "UDP" - -msgctxt "Admin state of a Firewall Group" -msgid "UP" -msgstr "ACTIF" - -msgctxt "Admin state of a firewall" -msgid "UP" -msgstr "ACTIF" - -#, python-format -msgid "Unable to add Policy \"%s\"." -msgstr "Impossible d'ajouter la stratégie \"%s\"." - -#, python-format -msgid "Unable to add Rule \"%s\"." -msgstr "Impossible d'ajouter la règle \"%s\"." - -#, python-format -msgid "Unable to add firewall \"%s\"." -msgstr "Impossible d'ajouter le pare-feu \"%s\"." - -#, python-format -msgid "Unable to add policy \"%s\"." -msgstr "Impossible d'ajouter la stratégie \"%s\"." - -#, python-format -msgid "Unable to add rule \"%s\"." -msgstr "Impossible d'ajouter la règle \"%s\"." - -#, python-format -msgid "Unable to delete firewall. %s" -msgstr "Impossible de supprimer le pare-feu %s" - -#, python-format -msgid "Unable to delete policy. %s" -msgstr "Impossible de supprimer la stratégie. %s" - -#, python-format -msgid "Unable to delete rule. %s" -msgstr "Impossible de supprimer la règle %s" - -msgid "Unable to retrieve firewall details." -msgstr "Impossible de récupérer les détails du pare-feu." - -msgid "Unable to retrieve firewall list." -msgstr "Impossible de récupérer la liste des pare-feux." - -msgid "Unable to retrieve policies list." -msgstr "Impossible de récupérer la liste des stratégies." - -msgid "Unable to retrieve policy details." -msgstr "Impossible de récupérer les détails de la stratégie." - -#, python-format -msgid "Unable to retrieve policy list (%(error)s)." -msgstr "Impossible de récupérer la liste des stratégies (%(error)s)." - -#, python-format -msgid "Unable to retrieve policy list (%s)." -msgstr "Impossible de récupérer la liste des stratégies (%s)." - -msgid "Unable to retrieve policy list." -msgstr "Impossible de récupérer la liste des stratégies." - -msgid "Unable to retrieve port list." -msgstr "Impossible de récupérer la liste des ports." - -#, python-format -msgid "Unable to retrieve ports (%s)." -msgstr "Impossible de récupérer les ports (%s)." - -#, python-format -msgid "Unable to retrieve routers (%(error)s)." -msgstr "Impossible de récupérer les routeurs (%(error)s)." - -msgid "Unable to retrieve rule details." -msgstr "Impossible de récupérer les détails de la règle." - -#, python-format -msgid "Unable to retrieve rules (%(error)s)." -msgstr "Impossible de récupérer les règles (%(error)s)." - -#, python-format -msgid "Unable to retrieve rules (%s)." -msgstr "Impossible de récupérer les règles (%s)." - -msgid "Unable to retrieve rules list." -msgstr "Impossible de récupérer la liste des règles." - -msgid "Unselect the router(s) to be removed from firewall." -msgstr "Désélectionner le ou les routeurs à retirer du pare-feu." - -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "Désélectionner les routeurs que vous voulez dissocier du pare-feu." - -msgid "Used in Policy" -msgstr "Utilisée dans la stratégie" - -msgid "You may update firewall details here." -msgstr "Ici, vous pouvez mettre à jour les détails du pare-feu." - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" -msgstr "" -"Mettez à jour les détails de la stratégie ici. Utilisez les liens 'Insérer " -"une règle' ou 'Enlever une règle' pour insérer ou enlever une règle." - -msgid "You may update rule details here." -msgstr "Ici, vous pouvez mettre à jour les détails de la règle." diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/id/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/id/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/id/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/id/LC_MESSAGES/django.po 2018-02-22 06:27:32.000000000 +0000 @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: neutron-fwaas-dashboard VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-05-10 14:05+0000\n" +"POT-Creation-Date: 2018-02-21 10:13+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-05-10 01:48+0000\n" +"PO-Revision-Date: 2018-02-21 03:59+0000\n" "Last-Translator: suhartono \n" "Language-Team: Indonesian\n" "Language: id\n" -"X-Generator: Zanata 4.3.3\n" +"X-Generator: Zanata 3.9.6\n" "Plural-Forms: nplurals=1; plural=0\n" msgid "-" @@ -76,9 +76,6 @@ msgid "Add Port" msgstr "Add Port" -msgid "Add Port to Firewall Group" -msgstr "Tambahkan Port ke Firewall Group" - msgid "Add Router" msgstr "Add Router (tambah router)" @@ -124,9 +121,6 @@ msgid "Admin State" msgstr "Admin State" -msgid "Admin State Up" -msgstr "Admin State Up" - msgid "After" msgstr "After (sesudah)" @@ -136,51 +130,9 @@ msgid "Audited" msgstr "Audited" -msgid "Available Ports" -msgstr "Available Ports" - -msgid "Available Routers" -msgstr "Available Routers" - -msgid "Available Rules" -msgstr "Available Rules" - msgid "Before" msgstr "Before (sebelum)" -msgid "Choose port(s) from Available Ports. " -msgstr "Pilih port dari Available Ports. " - -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"Pilih router dari Available Routers ke Selected Routers dengan menekan " -"tombol atau seret dan lepas (drag and drop)." - -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"Pilih aturan dari Available Rules ke Selected Rule dengan menekan tombol " -"atau seret dan lepaskan, Anda dapat mengubah pesanan mereka dengan drag dan " -"drop juga." - -msgid "Choose the router(s) you want to add." -msgstr "Pilih router yang ingin Anda tambahkan." - -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"Pilih aturan yang ingin Anda sisipkan. Tentukan baik aturan yang ingin Anda " -"masukkan segera sebelumnya, atau aturan untuk memasukkan segera setelahnya. " -"Jika keduanya ditentukan, sebelumnya diutamakan." - -msgid "Choose the rule you want to remove." -msgstr "Pilih aturan yang ingin Anda hapus." - msgid "Create Firewall" msgstr "Create Firewall (buat firewall)" @@ -351,15 +303,9 @@ msgid "Description" msgstr "Deskripsi" -msgid "Description:" -msgstr "Deskripsi:" - msgid "Destination IP" msgstr "IP Tujuan" -msgid "Destination IP Address" -msgstr "Destination IP Address" - msgid "Destination IP Address/Subnet" msgstr "Tujuan subnet/alamat IP" @@ -411,9 +357,6 @@ msgid "Egress Policy" msgstr "Egress Policy" -msgid "Egress Policy ID" -msgstr "Egress Policy ID" - msgid "Enable Admin State" msgstr "Enable Admin State" @@ -512,9 +455,6 @@ msgid "ICMP" msgstr "ICMP" -msgid "ID" -msgstr "ID" - msgid "IP Version" msgstr "IP Version" @@ -535,9 +475,6 @@ msgid "Ingress Policy" msgstr "Ingress Policy" -msgid "Ingress Policy ID" -msgstr "Ingress Policy ID" - msgid "Insert Rule" msgstr "Insert Rule (menyisipkan aturan)" @@ -595,12 +532,6 @@ msgid "Ports" msgstr "Ports" -msgid "Position in Policy" -msgstr "Position in Policy" - -msgid "Project ID" -msgstr "Project ID" - msgid "Protocol" msgstr "Protocol" @@ -621,9 +552,6 @@ msgid "Remove Port" msgstr "Remove Port" -msgid "Remove Port from Firewall Group" -msgstr "Hapus Port dari Firewall Group" - msgid "Remove Router" msgstr "Remove Router" @@ -710,24 +638,12 @@ msgid "Select rules for your policy." msgstr "Pilih aturan untuk kebijakan Anda." -msgid "Selected Ports" -msgstr "Selected Ports" - -msgid "Selected Routers" -msgstr "Selected Routers" - -msgid "Selected Rules" -msgstr "Selected Rules" - msgid "Shared" msgstr "Shared" msgid "Source IP" msgstr "Source IP (IP sumber)" -msgid "Source IP Address" -msgstr "Source IP Address" - msgid "Source IP Address/Subnet" msgstr "Source (asal) subnet/alamat IP" @@ -856,40 +772,3 @@ msgid "Unselect the router(s) to be removed from firewall." msgstr "Batalkan router untuk dihapus dari firewall." - -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "Batalkan pilihan router yang ingin Anda pisahkan dari firewall." - -msgid "Used in Policy" -msgstr "Used in Policy" - -msgid "You may add ports to firewall group here." -msgstr "Anda dapat menambahkan port ke grup firewall di sini." - -msgid "You may remove ports from firewall group here." -msgstr "Anda dapat menghapus port dari grup firewall di sini." - -msgid "You may update firewall details here." -msgstr "Anda dapat memperbarui detail firewall di sini." - -msgid "You may update firewall group details here." -msgstr "Anda dapat memperbarui rincian grup firewall di sini." - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" -msgstr "" -"Anda dapat memperbarui rincian kebijakan di sini. Gunakan tautan 'Insert " -"Rule' atau 'Remove Rule' sebagai gantinya untuk memasukkan atau menghapus " -"aturan." - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule." -msgstr "" -"Anda dapat memperbarui rincian kebijakan di sini. Gunakan tautan 'Insert " -"Rule' atau 'Remove Rule' sebagai gantinya untuk memasukkan atau menghapus " -"aturan." - -msgid "You may update rule details here." -msgstr "Anda dapat memperbarui detail aturan di sini." diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/ja/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/ja/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/ja/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/ja/LC_MESSAGES/django.po 2018-02-22 06:27:32.000000000 +0000 @@ -4,11 +4,11 @@ msgstr "" "Project-Id-Version: neutron-fwaas-dashboard VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-02-20 22:11+0000\n" +"POT-Creation-Date: 2018-02-21 10:13+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-02-21 09:01+0000\n" +"PO-Revision-Date: 2018-02-22 06:17+0000\n" "Last-Translator: Akihiro Motoki \n" "Language-Team: Japanese\n" "Language: ja\n" @@ -73,9 +73,6 @@ msgid "Add Port" msgstr "ポートの追加" -msgid "Add Port to Firewall Group" -msgstr "ファイアウォールグループへのポートの追加" - msgid "Add Router" msgstr "ルーターの追加" @@ -121,9 +118,6 @@ msgid "Admin State" msgstr "管理状態" -msgid "Admin State Up" -msgstr "管理状態有効" - msgid "After" msgstr "後に挿入" @@ -133,51 +127,9 @@ msgid "Audited" msgstr "監査対象 (Audited)" -msgid "Available Ports" -msgstr "利用可能なポート" - -msgid "Available Routers" -msgstr "利用可能なルーター" - -msgid "Available Rules" -msgstr "利用可能なルール" - msgid "Before" msgstr "前に挿入" -msgid "Choose port(s) from Available Ports. " -msgstr "以下の利用可能なポートからポートを選択してください。" - -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"ボタンを押すかドラッグアンドドロップで、「利用可能なルーター」から「選択済み" -"ルーター」にルーターを移動します。" - -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"利用可能なルールから選択済みルールに、ボタンを押すかドラッグアンドドロップす" -"ることでルールを選択します。ドラッグアンドドロップでルールの順番を変更するこ" -"ともできます。" - -msgid "Choose the router(s) you want to add." -msgstr "追加するルーターを選択してください。" - -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"挿入するルールを選択してください。ルールをどのルールの直前、または直後に挿入" -"するかを指定してください。両方指定した場合は指定したルールの直前に挿入されま" -"す。" - -msgid "Choose the rule you want to remove." -msgstr "削除するルールを選択してください。" - msgid "Create Firewall" msgstr "ファイアウォールの作成" @@ -346,15 +298,9 @@ msgid "Description" msgstr "説明" -msgid "Description:" -msgstr "説明:" - msgid "Destination IP" msgstr "宛先 IP アドレス" -msgid "Destination IP Address" -msgstr "宛先 IP アドレス" - msgid "Destination IP Address/Subnet" msgstr "宛先 IP アドレス/サブネット" @@ -405,9 +351,6 @@ msgid "Egress Policy" msgstr "送信ポリシー" -msgid "Egress Policy ID" -msgstr "送信ポリシー ID" - msgid "Enable Admin State" msgstr "管理状態有効" @@ -508,9 +451,6 @@ msgid "ICMP" msgstr "ICMP" -msgid "ID" -msgstr "ID" - msgid "IP Version" msgstr "IP バージョン" @@ -531,9 +471,6 @@ msgid "Ingress Policy" msgstr "受信ポリシー" -msgid "Ingress Policy ID" -msgstr "受信ポリシー ID" - msgid "Insert Rule" msgstr "ルールの挿入" @@ -590,12 +527,6 @@ msgid "Ports" msgstr "ポート" -msgid "Position in Policy" -msgstr "ポリシー内の位置" - -msgid "Project ID" -msgstr "プロジェクト ID" - msgid "Protocol" msgstr "プロトコル" @@ -616,9 +547,6 @@ msgid "Remove Port" msgstr "ポートの削除" -msgid "Remove Port from Firewall Group" -msgstr "ファイアウォールグループからのポートの削除" - msgid "Remove Router" msgstr "ルーターの削除" @@ -705,24 +633,12 @@ msgid "Select rules for your policy." msgstr "ポリシーに追加するルールの選択" -msgid "Selected Ports" -msgstr "選択済みポート" - -msgid "Selected Routers" -msgstr "選択されたルーター" - -msgid "Selected Rules" -msgstr "選択済みのルール" - msgid "Shared" msgstr "共有" msgid "Source IP" msgstr "送信元 IP" -msgid "Source IP Address" -msgstr "送信元 IP アドレス" - msgid "Source IP Address/Subnet" msgstr "送信元 IP アドレス/サブネット" @@ -851,38 +767,3 @@ msgid "Unselect the router(s) to be removed from firewall." msgstr "ファイアウォールの適用を解除するルーターの選択を外してください。" - -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "ファイアウォールの適用を解除するルーターの選択を外してください。" - -msgid "Used in Policy" -msgstr "利用中のポリシー" - -msgid "You may add ports to firewall group here." -msgstr "ファイアウォールグループにポートを追加できます。" - -msgid "You may remove ports from firewall group here." -msgstr "ファイアウォールグループからポートを削除できます。" - -msgid "You may update firewall details here." -msgstr "ファイアウォールの詳細をここから更新できます。" - -msgid "You may update firewall group details here." -msgstr "ファイアウォールグループの詳細をここから更新できます。" - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" -msgstr "" -"ポリシーの詳細をここから更新できます。ルールの挿入、削除はここではなく「ルー" -"ルの挿入」「ルールの削除」を使ってください。" - -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule." -msgstr "" -"ポリシーの詳細をここから更新できます。ルールの挿入、削除はここではなく「ルー" -"ルの挿入」「ルールの削除」を使ってください。" - -msgid "You may update rule details here." -msgstr "ルールの詳細をここから更新できます。" diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/ko_KR/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/ko_KR/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/ko_KR/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/ko_KR/LC_MESSAGES/django.po 2018-02-22 06:27:32.000000000 +0000 @@ -14,15 +14,15 @@ msgstr "" "Project-Id-Version: neutron-fwaas-dashboard VERSION\n" "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-03-07 18:31+0000\n" +"POT-Creation-Date: 2018-02-13 01:36+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-03-13 02:53+0000\n" +"PO-Revision-Date: 2018-02-12 10:17+0000\n" "Last-Translator: Ian Y. Choi \n" "Language-Team: Korean (South Korea)\n" -"Language: ko_KR\n" -"X-Generator: Zanata 4.3.3\n" +"Language: ko-KR\n" +"X-Generator: Zanata 3.9.6\n" "Plural-Forms: nplurals=1; plural=0\n" msgid "-" @@ -87,9 +87,6 @@ msgid "Add Port" msgstr "포트 추가" -msgid "Add Port to Firewall Group" -msgstr "방화벽 그룹에 포트 추가" - msgid "Add Router" msgstr "라우터 추가" @@ -109,10 +106,6 @@ msgstr "방화벽에서 라우터를 선택하여 추가합니다." #, python-format -msgid "Added Firewall Group\"%s\"." -msgstr "방화벽 그룹 \"%s\"를 추가하였습니다." - -#, python-format msgid "Added Policy \"%s\"." msgstr "정책 \"%s\"를 추가하였습니다.:" @@ -135,10 +128,6 @@ msgid "Admin State" msgstr "관리 상태" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Admin State Up" -msgstr "관리자 업 상태" - msgid "After" msgstr "이후" @@ -148,66 +137,12 @@ msgid "Audited" msgstr "상태 확인" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Available Ports" -msgstr "사용 가능한 포트" - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Available Routers" -msgstr "사용 가능한 라우터" - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Available Rules" -msgstr "사용 가능한 규칙" - msgid "Before" msgstr "이전" -msgid "Choose port(s) from Available Ports. " -msgstr "사용 가능한 포트에서 포트를 선택합니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"푸시 버튼이나 드래그 앤 드롭으로 선택한 라우터에서 사용가능한 라우터로 라우터" -"를 선택합니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"사용 가능한 규칙에서 선택한 규칙에 버튼을 누르거나 드래그 앤 드롭하여 규칙을 " -"선택합니다. 드래그 앤 드롭으로 규칙 순서를 변경할 수 있습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Choose the router(s) you want to add." -msgstr "추가할 라우터를 선택합니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"삽입할 규칙을 선택합니다. 바로 앞에 삽입할 규칙인지, 바로 뒤에 삽입할 규칙인" -"지를 정해야합니다. 양 쪽 모두 지정하면, 앞에 있는 것이 우선 순위가 높습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Choose the rule you want to remove." -msgstr "제거할 규칙을 선택하세요." - msgid "Create Firewall" msgstr "방화벽 생성" -msgid "Create Firewall Group" -msgstr "방화벽 그룹 생성" - -msgid "Create a Firewall Group with selected ports." -msgstr "선택한 포트와 함께 방화벽 그룹을 생성합니다." - msgid "" "Create a firewall based on a policy.\n" "\n" @@ -354,10 +289,6 @@ msgid_plural "Delete Firewalls" msgstr[0] "방화벽 삭제" -msgid "Delete Firewall Group" -msgid_plural "Delete Firewall Groups" -msgstr[0] "방화벽 그룹 삭제" - msgid "Delete Policy" msgid_plural "Delete Policies" msgstr[0] "정책 삭제" @@ -369,17 +300,9 @@ msgid "Description" msgstr "설명" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Description:" -msgstr "설명:" - msgid "Destination IP" msgstr "대상 IP" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Destination IP Address" -msgstr "대상 IP 주소" - msgid "Destination IP Address/Subnet" msgstr "대상 IP 주소/서브넷" @@ -408,9 +331,6 @@ msgid "Edit Firewall" msgstr "방화벽 편집" -msgid "Edit Firewall Group" -msgstr "방화벽 그룹 편집" - msgid "Edit Firewall {{ name }}" msgstr "방화벽 {{ name }} 편집" @@ -429,12 +349,6 @@ msgid "Edit Rule {{ name }}" msgstr "{{ name }} 규칙 편집" -msgid "Egress Policy" -msgstr "Egress 정책" - -msgid "Egress Policy ID" -msgstr "Egress 정책 ID" - msgid "Enable Admin State" msgstr "관리 상태 활성화" @@ -483,18 +397,11 @@ msgid "Failed to retrieve current rules in policy %(name)s: %(reason)s" msgstr "%(name)s 정책에서 현재 규칙을 찾지 못하였습니다.: %(reason)s" -msgid "Failed to retrieve port list of the firewall group." -msgstr "방화벽 그룹에 대한 포트 목록을 가져올 수 없습니다." - #, python-format msgid "Failed to update firewall %(name)s: %(reason)s" msgstr "방화벽 %(name)s 를 업데이트 하지 못하였습니다.: %(reason)s" #, python-format -msgid "Failed to update firewallgroup %(name)s: %(reason)s" -msgstr "firewallgroup %(name)s 을(를) 업데이트하지 못하였습니다.: %(reason)s" - -#, python-format msgid "Failed to update policy %(name)s: %(reason)s" msgstr "정책 %(name)s를 업데이트하지 못하였습니다.: %(reason)s" @@ -513,9 +420,6 @@ msgid "Firewall %s was successfully updated." msgstr "방화벽 %s를 성공적으로 업데이트하지 못하였습니다." -msgid "Firewall Groups" -msgstr "방화벽 그룹" - msgid "Firewall Policies" msgstr "방화벽 정책" @@ -525,10 +429,6 @@ msgid "FirewallGroup" msgstr "FirewallGroup" -#, python-format -msgid "FirewallGroup %s was successfully updated." -msgstr "FirewallGroup %s 을(를) 성공적으로 업데이트 하였습니다." - msgid "Firewalls" msgstr "방화벽" @@ -536,10 +436,6 @@ msgid "ICMP" msgstr "ICMP" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "ID" -msgstr "ID" - msgid "IP Version" msgstr "IP 버전" @@ -559,12 +455,6 @@ msgid "Inactive" msgstr "Inactive" -msgid "Ingress Policy" -msgstr "Ingress 정책" - -msgid "Ingress Policy ID" -msgstr "Ingress 정책 ID" - msgid "Insert Rule" msgstr "규칙 추가" @@ -627,14 +517,6 @@ msgid "Ports" msgstr "포트" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Position in Policy" -msgstr "정책 위치" - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Project ID" -msgstr "프로젝트 ID" - # auto translated by TM merge from project: zun-ui, version: master, DocId: zun_ui/locale/djangojs msgid "Protocol" msgstr "프로토콜" @@ -657,9 +539,6 @@ msgid "Remove Port" msgstr "포트 제거" -msgid "Remove Port from Firewall Group" -msgstr "방화벽 그룹에 포트 제거" - msgid "Remove Router" msgstr "라우터 제거" @@ -672,9 +551,6 @@ msgid "Remove Rule from Policy" msgstr "정책에서 규칙 제거" -msgid "Remove port from FirewallGroup {{ name }}" -msgstr "FirewallGroup {{ name }} 에서 포트 제거" - #, python-format msgid "Router(s) was successfully removed from firewall %(firewall)s." msgstr "라우터를 %(firewall)s 방화벽에서 성공적으로 제거했습니다." @@ -707,10 +583,6 @@ msgid "Save Changes" msgstr "변경사항 저장" -msgid "Scheduled deletion of Firewall Group" -msgid_plural "Scheduled deletion of Firewall Groups" -msgstr[0] "방화벽 그룹에 대한 예약된 삭제" - msgid "Scheduled deletion of Policy" msgid_plural "Scheduled deletion of Policies" msgstr[0] "정책 예약 삭제" @@ -737,26 +609,12 @@ msgid "Select a policy" msgstr "정책 선택" -msgid "Select ports for your firewall group." -msgstr "방화벽 그룹에 대한 포트를 선택합니다." - msgid "Select routers for your firewall." msgstr "방화벽에 대한 라우터를 선택합니다." msgid "Select rules for your policy." msgstr "정책을 위해 규칙을 선택합니다." -msgid "Selected Ports" -msgstr "선택한 포트" - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Selected Routers" -msgstr "선택된 라우터" - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Selected Rules" -msgstr "규칙을 선택합니다." - msgid "Shared" msgstr "공유" @@ -764,10 +622,6 @@ msgid "Source IP" msgstr "소스 IP" -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Source IP Address" -msgstr "소스 IP 주소" - msgid "Source IP Address/Subnet" msgstr "소스 IP 주소/서브넷" @@ -809,10 +663,6 @@ msgstr "UP" #, python-format -msgid "Unable to add Firewall Group \"%s\"." -msgstr "방화벽 그룹 \"%s\"를 추가할 수 없습니다." - -#, python-format msgid "Unable to add Policy \"%s\"." msgstr "정책 \"%s\"를 추가할 수 없습니다." @@ -850,9 +700,6 @@ msgid "Unable to retrieve firewall list." msgstr "방화벽 목록을 찾지 못 했습니다." -msgid "Unable to retrieve firewallgroup details." -msgstr "방화벽 그룹 세부 사항을 가져올 수 없습니다." - msgid "Unable to retrieve policies list." msgstr "정책 목록을 찾지 못 했습니다." @@ -863,20 +710,9 @@ msgid "Unable to retrieve policy list (%(error)s)." msgstr "정책 목록 (%(error)s)를 찾지 못 했습니다." -#, python-format -msgid "Unable to retrieve policy list (%s)." -msgstr "정책 목록 (%s) 을(를) 가져올 수 없습니다." - msgid "Unable to retrieve policy list." msgstr "정책 목록을 찾지 못 했습니다." -msgid "Unable to retrieve port list." -msgstr "포트 목록을 가져올 수 없습니다." - -#, python-format -msgid "Unable to retrieve ports (%s)." -msgstr "포트 (%s) 을(를) 가져올 수 없습니다." - #, python-format msgid "Unable to retrieve routers (%(error)s)." msgstr "라우터를 찾지 못 했습니다 (%(error)s)." @@ -888,54 +724,8 @@ msgid "Unable to retrieve rules (%(error)s)." msgstr "규칙을 찾지 못했습니다 (%(error)s). " -#, python-format -msgid "Unable to retrieve rules (%s)." -msgstr "규칙 (%s) 을(를) 가져올 수 없습니다." - msgid "Unable to retrieve rules list." msgstr "규칙 목록을 찾지 못 했습니다." msgid "Unselect the router(s) to be removed from firewall." msgstr "방화벽에서 라우터를 선택 취소하여 제거합니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "방화벽에서 라우터를 선택 취소하여 연결을 끊습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "Used in Policy" -msgstr "정책에서 사용됨" - -msgid "You may add ports to firewall group here." -msgstr "이 방화벽 그룹에 포트를 추가할 수 있습니다." - -msgid "You may remove ports from firewall group here." -msgstr "이 방화벽 그룹에서 포트를 제거할 수 있습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "You may update firewall details here." -msgstr "방화벽 세부 사항을 여기서 업데이트 할 수 있습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "You may update firewall group details here." -msgstr "방화벽 그룹 세부 사항을 여기서 업데이트 할 수 있습니다." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule" -msgstr "" -"여기서 정책의 세부 사항을 업데이트 할 수 있습니다. 규칙을 삽입하거나 삭제하" -"는 대신에 '규칙 삽입'나 '규칙 삭제' 링크를 사용하십시오." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "" -"You may update policy details here. Use 'Insert Rule' or 'Remove Rule' links " -"instead to insert or remove a rule." -msgstr "" -"여기서 정책의 세부 사항을 업데이트 할 수 있습니다. 규칙을 삽입하거나 삭제하" -"는 대신에 '규칙 삽입'나 '규칙 삭제' 링크를 사용하십시오." - -# auto translated by TM merge from project: neutron-fwaas-dashboard, version: stable-queens, DocId: neutron_fwaas_dashboard/locale/django -msgid "You may update rule details here." -msgstr "여기서 규칙 세부 사항을 업데이트 할 수 있습니다." diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/pt_BR/LC_MESSAGES/django.po neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/pt_BR/LC_MESSAGES/django.po --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/locale/pt_BR/LC_MESSAGES/django.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/locale/pt_BR/LC_MESSAGES/django.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,719 +0,0 @@ -# Carlos Marques , 2016. #zanata -# José Mello , 2016. #zanata -# Fernando Pimenta , 2017. #zanata -# José Mello , 2017. #zanata -# Rodrigo Loures , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: neutron-fwaas-dashboard VERSION\n" -"Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" -"POT-Creation-Date: 2018-05-02 12:02+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-05-02 12:55+0000\n" -"Last-Translator: Rodrigo Loures \n" -"Language-Team: Portuguese (Brazil)\n" -"Language: pt_BR\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -msgid "-" -msgstr "-" - -msgid "ALLOW" -msgstr "ALLOW" - -msgctxt "Action Name of a Firewall Rule" -msgid "ALLOW" -msgstr "ALLOW" - -msgctxt "Action name of a firewall rule" -msgid "ALLOW" -msgstr "PERMITIR" - -msgid "ANY" -msgstr "ANY" - -msgid "Action" -msgstr "Ação" - -msgid "Action for the firewall rule" -msgstr "Ação para a regra de firewall" - -msgctxt "Current status of a firewall" -msgid "Active" -msgstr "Ativo" - -msgid "Add" -msgstr "Adicionar" - -msgid "Add Firewall" -msgstr "Adicionar Firewall" - -msgid "Add New Firewall" -msgstr "Adicionar Novo Firewall" - -msgid "Add New Policy" -msgstr "Adicionar Nova Política" - -msgid "Add New Rule" -msgstr "Adicionar Nova Regra" - -msgid "Add Policy" -msgstr "Adicionar Política" - -msgid "Add Router" -msgstr "Adicionar Roteador " - -msgid "Add Router to Firewall" -msgstr "Adicionar Roteador ao Firewall" - -msgid "Add Routers" -msgstr "Adicionar Roteadores" - -msgid "Add Rule" -msgstr "Adicionar Regra" - -msgid "Add selected router(s) to the firewall." -msgstr "Adicionar roteadores selecionados ao firewall." - -#, python-format -msgid "Added Policy \"%s\"." -msgstr "Política Adicionada \"%s\"." - -#, python-format -msgid "Added Rule \"%s\"." -msgstr "Adicionada Regra \"%s\"." - -#, python-format -msgid "Added firewall \"%s\"." -msgstr "Firewall adicionado \"%s\"." - -#, python-format -msgid "Added policy \"%s\"." -msgstr "Política adicionada \"%s\"." - -#, python-format -msgid "Added rule \"%s\"." -msgstr "Regra adicionada \"%s\"." - -msgid "Admin State" -msgstr "Estado de Administração" - -msgid "Admin State Up" -msgstr "Estado Administrativo Ligado" - -msgid "After" -msgstr "Após" - -msgid "Associated Routers" -msgstr "Roteadores Associados" - -msgid "Audited" -msgstr "Auditado" - -msgid "Available Routers" -msgstr "Roteadores disponíveis" - -msgid "Available Rules" -msgstr "Regras Disponíveis" - -msgid "Before" -msgstr "Antes" - -msgid "" -"Choose router(s) from Available Routers to Selected Routers by push button " -"or drag and drop. " -msgstr "" -"Escolha roteador(es) a partir de roteadores disponíveis para os roteadores " -"selecionados por botão ou arrastar e soltar." - -msgid "" -"Choose rule(s) from Available Rules to Selected Rule by push button or drag " -"and drop, you may change their order by drag and drop as well." -msgstr "" -"Escolha regra(s) a partir de Regras Disponíveis para Regras Selecionadas " -"clicando no botão ou arrastando e soltando, você pode alterar sua ordem " -"arrastando e soltando também." - -msgid "Choose the router(s) you want to add." -msgstr "Escolha o(s) roteador(es) que você deseja adicionar." - -msgid "" -"Choose the rule you want to insert. Specify either the rule you want to " -"insert immediately before, or the rule to insert immediately after. If both " -"are specified, the prior takes precedence." -msgstr "" -"Escolha a regra que você deseja inserir. Especifique a regra que você deseja " -"inserir imediatamente antes, ou a regra para inserir imediatamente após. Se " -"ambos forem especificados, o anterior tem precedência." - -msgid "Choose the rule you want to remove." -msgstr "Escolha a regra que você quer remover." - -msgid "Create Firewall" -msgstr "Criar Firewall" - -msgid "" -"Create a firewall based on a policy.\n" -"\n" -"A firewall represents a logical firewall resource that a tenant can " -"instantiate and manage. A firewall must be associated with one policy, all " -"other fields are optional." -msgstr "" -"Crie um firewall baseado em política.\n" -"\n" -"Um firewall representa um recurso de firewall lógico que um locatário pode " -"instanciar e gerenciar. Um firewall deve ser associado a uma política, e " -"todos os outros campos são opcionais." - -msgid "" -"Create a firewall policy with an ordered list of firewall rules.\n" -"\n" -"A firewall policy is an ordered collection of firewall rules. So if the " -"traffic matches the first rule, the other rules are not executed. If the " -"traffic does not match the current rule, then the next rule is executed. A " -"firewall policy has the following attributes:\n" -"\n" -"
  • Shared: A firewall policy can be shared across tenants. Thus it can also " -"be made part of an audit workflow wherein the firewall policy can be audited " -"by the relevant entity that is authorized.
  • Audited: When audited is " -"set to True, it indicates that the firewall policy has been audited. Each " -"time the firewall policy or the associated firewall rules are changed, this " -"attribute will be set to False and will have to be explicitly set to True " -"through an update operation.
  • \n" -"The name field is required, all others are optional." -msgstr "" -"Crie uma política de firewall com uma lista ordenada de regras de firewall.\n" -"\n" -"Uma política de firewall é uma coleta ordenada de regras de firewall. " -"Portanto, se o tráfego corresponder à primeira regra, as outras regras não " -"serão executadas. Se o tráfego não corresponder à regra atual, então a " -"próxima regra será executada. Uma política de firewall possui os seguintes " -"atributos:\n" -"\n" -"
  • Compartilhado: Uma política de firewall pode ser compartilhada entre " -"locatários. Assim, ela também pode fazer parte de um fluxo de trabalho de " -"auditoria no qual a política de firewall pode ser auditada pela entidade " -"relevante que estiver autorizada.
  • Auditada: Quando auditada estiver " -"configurada para True, indica que a política de firewall foi auditada. " -"Sempre que a política de firewall ou as regras de firewall associadas forem " -"alteradas, esse atributo será configurado para False e precisará ser " -"configurado explicitamente para True por meio de uma operação de atualização." -"
  • \n" -"O campo de nome é obrigatório, e todos os outros são opcionais." - -msgid "" -"Create a firewall rule.\n" -"\n" -"A Firewall rule is an association of the following attributes:\n" -"\n" -"
  • IP Addresses: The addresses from/to which the traffic filtration needs " -"to be applied.
  • IP Version: The type of IP packets (IP V4/V6) that " -"needs to be filtered.
  • Protocol: Type of packets (UDP, ICMP, TCP, " -"Any) that needs to be checked.
  • Action: Action is the type of " -"filtration required, it can be Reject/Deny/Allow data packets.
  • \n" -"The protocol and action fields are required, all others are optional." -msgstr "" -"Crie uma regra de firewall.\n" -"\n" -"Uma regra de Firewall é uma associação dos seguintes atributos:\n" -"\n" -"
  • Endereços IP: Os endereços a partir dos quais a filtragem de tráfego " -"precisa ser aplicada
  • Versão do IP: O tipo de pacotes de IP (IP V4/" -"V6) que precisa ser filtrado.
  • Protocolo: O tipo de pacotes (UDP, " -"ICMP, TCP, Any) que precisa ser verificado.
  • Ação: Ação é o tipo de " -"filtragem necessário, que pode ser Rejeitar/Negar/Permitir pacotes de dados." -"
  • \n" -"Os campos de protocolo e de ação são obrigatórios, e todos os outros são " -"opcionais." - -msgid "" -"Create a firewall rule.\n" -"\n" -"A firewall rule is an association of the following attributes:\n" -"\n" -"
  • IP Addresses: The addresses from/to which the traffic filtration needs " -"to be applied.
  • IP Version: The type of IP packets (IP V4/V6) that " -"needs to be filtered.
  • Protocol: Type of packets (UDP, ICMP, TCP, " -"Any) that needs to be checked.
  • Action: Action is the type of " -"filtration required, it can be Reject/Deny/Allow data packets.
  • \n" -"The protocol and action fields are required, all others are optional." -msgstr "" -"Criar uma regra de firewall.\n" -"\n" -"Um regra de firewall é uma associação dos seguintes atributos:\n" -"\n" -"
  • Endereços IP: Os endereços de/para os quais a filtragem de tráfego " -"precisa ser aplicada.
  • Versão do IP: O tipo dos pacotes IP (IP V4/V6) " -"que precisam ser filtrados.
  • Protocolo: Tipos de pacotes (UDP, ICMP, " -"TCP, Any) que precisam ser verificados.
  • Ação: Ação é o tipo de " -"filtragem necessária, que pode ser Rejeitar/Negar/Permitir pacotes de dados." -"
  • \n" -"Os campos protocolo e ação são obrigatórios, todos os outros são opcionais." - -msgid "Create a firewall with selected routers." -msgstr "Criar um firewall com os roteadores selecionados." - -msgid "Create a policy with selected rules." -msgstr "Criar uma política com as regras selecionadas." - -msgctxt "Current status of a firewall" -msgid "Created" -msgstr "Criado" - -msgid "DENY" -msgstr "DENY" - -msgctxt "Action Name of a Firewall Rule" -msgid "DENY" -msgstr "DENY" - -msgctxt "Action name of a firewall rule" -msgid "DENY" -msgstr "NEGAR" - -msgctxt "Admin state of a firewall" -msgid "DOWN" -msgstr "Abaixo" - -msgid "Delete Firewall" -msgid_plural "Delete Firewalls" -msgstr[0] "Excluir Firewall" -msgstr[1] "Excluir Firewalls" - -msgid "Delete Policy" -msgid_plural "Delete Policies" -msgstr[0] "Excluir Política" -msgstr[1] "Excluir Políticas" - -msgid "Delete Rule" -msgid_plural "Delete Rules" -msgstr[0] "Excluir Regra" -msgstr[1] "Excluir Regras" - -# #-#-#-#-# app_reserved_uids.pot (Installation Guide 0.1) #-#-#-#-# -# #-#-#-#-# basic_environment.pot (Installation Guide 0.1) #-#-#-#-# -# #-#-#-#-# overview.pot (Installation Guide 0.1) #-#-#-#-# -msgid "Description" -msgstr "Descrição" - -msgid "Description:" -msgstr "Descrição:" - -msgid "Destination IP" -msgstr "IP de Destino" - -msgid "Destination IP Address" -msgstr "Endereço IP de Destino" - -msgid "Destination IP Address/Subnet" -msgstr "Endereço IP/Sub-rede de Destino" - -msgid "Destination IP address or subnet" -msgstr "Endereço IP ou sub-rede de destino" - -msgid "Destination Port" -msgstr "Porta de Destino" - -msgid "Destination Port/Port Range" -msgstr "Porta destino/Faixa de Porta" - -msgid "Destination port (integer in [1, 65535] or range in a:b)" -msgstr "Porta de destino (número inteiro em [1, 65535] ou faixa em a:b)" - -msgctxt "Current status of a firewall" -msgid "Down" -msgstr "Desligado" - -msgid "Edit Firewall" -msgstr "Editar Firewall" - -msgid "Edit Firewall {{ name }}" -msgstr "Editar Firewall {{ name }}" - -msgid "Edit Policy" -msgstr "Editar Política" - -msgid "Edit Policy {{ name }}" -msgstr "Editar política {{ name }}" - -msgid "Edit Rule" -msgstr "Editar Regra" - -msgid "Edit Rule {{ name }}" -msgstr "Editar Regra {{ name }}" - -msgid "Enable Admin State" -msgstr "Ativar Estado Administrativo" - -msgid "Enabled" -msgstr "Habilitado" - -msgctxt "Current status of a firewall" -msgid "Error" -msgstr "Erro" - -#, python-format -msgid "Failed to add router(s) to firewall %(name)s: %(reason)s" -msgstr "Falha ao adicionar roteadores ao firewall %(name)s: %(reason)s" - -#, python-format -msgid "Failed to insert rule to policy %(name)s: %(reason)s" -msgstr "Falha ao inserir regra na política %(name)s: %(reason)s" - -#, python-format -msgid "Failed to remove router(s) from firewall %(name)s: %(reason)s" -msgstr "Falha ao remover os roteadores do firewall %(name)s: %(reason)s" - -#, python-format -msgid "Failed to remove rule from policy %(name)s: %(reason)s" -msgstr "Falha ao remover regra da política %(name)s: %(reason)s" - -#, python-format -msgid "Failed to retrieve available routers: %s" -msgstr "Falha ao recuperar roteadores disponíveis: %s" - -#, python-format -msgid "Failed to retrieve available rules: %s" -msgstr "Falha ao recuperar as regras disponíveis: %s" - -#, python-format -msgid "Failed to retrieve current routers in firewall %(name)s: %(reason)s" -msgstr "" -"Falha ao recuperar os roteadores atuais no firewall %(name)s: %(reason)s" - -#, python-format -msgid "Failed to retrieve current rules in policy %(name)s: %(reason)s" -msgstr "Falha ao recuperar as regras atuais na política %(name)s: %(reason)s" - -#, python-format -msgid "Failed to update firewall %(name)s: %(reason)s" -msgstr "Falha ao atualizar o firewall %(name)s: %(reason)s" - -#, python-format -msgid "Failed to update policy %(name)s: %(reason)s" -msgstr "Falha para atualizar a política %(name)s: %(reason)s" - -#, python-format -msgid "Failed to update rule %(name)s: %(reason)s" -msgstr "Falha ao atualizar a regra %(name)s: %(reason)s" - -#, python-format -msgid "Failed to verify extension support %s" -msgstr "Falha ao verificar o suporte de extensão %s" - -msgid "Firewall" -msgstr "Firewall" - -#, python-format -msgid "Firewall %s was successfully updated." -msgstr "O firewall %s foi atualizado com sucesso." - -msgid "Firewall Policies" -msgstr "Políticas de Firewall" - -msgid "Firewall Rules" -msgstr "Regras de Firewall" - -msgid "Firewalls" -msgstr "Firewalls" - -msgid "ICMP" -msgstr "ICMP" - -msgid "ID" -msgstr "ID" - -msgid "IP Version" -msgstr "Versão do IP" - -msgid "IP Version for Firewall Rule" -msgstr "Versão do IP para Regra de Firewall" - -msgid "In Policy" -msgstr "Na Política" - -msgctxt "Current status of a firewall" -msgid "Inactive" -msgstr "Inativo" - -msgid "Insert Rule" -msgstr "Inserir Regra" - -msgid "Insert Rule to Policy" -msgstr "Inserir regra na Política" - -msgid "Name" -msgstr "Nome" - -msgid "" -"Non admin users are not allowed to set the shared property of the policy." -msgstr "" -"Usuários que não sejam administradores não tem permissão para definir a " -"propriedade de compartilhamento da política." - -msgid "Non admin users are not allowed to set the shared property of the rule." -msgstr "" -"Usuários que não sejam administradores não tem permissão para definir a " -"propriedade de compartilhamento da regra." - -msgid "None" -msgstr "Nenhum" - -msgctxt "Current status of a firewall" -msgid "Pending Create" -msgstr "Criação pendente" - -msgctxt "Current status of a firewall" -msgid "Pending Delete" -msgstr "Exclusão pendente" - -msgctxt "Current status of a firewall" -msgid "Pending Update" -msgstr "Atualização pendente" - -msgid "Policies" -msgstr "Políticas" - -msgid "Policy" -msgstr "Política" - -#, python-format -msgid "Policy %s was successfully updated." -msgstr "A política %s foi atualizada com sucesso." - -msgid "Ports" -msgstr "Portas" - -msgid "Position in Policy" -msgstr "Posição na Política" - -msgid "Project ID" -msgstr "ID do projeto" - -msgid "Protocol" -msgstr "Protocolo" - -msgid "Protocol for the firewall rule" -msgstr "Protocolo para a regra de firewall" - -msgid "REJECT" -msgstr "REJECT" - -msgctxt "Action Name of a Firewall Rule" -msgid "REJECT" -msgstr "REJECT" - -msgctxt "Action name of a firewall rule" -msgid "REJECT" -msgstr "REJEITAR" - -msgid "Remove Router" -msgstr "Remover Roteaor" - -msgid "Remove Router from Firewall" -msgstr "Remover Roteador do Firewall" - -msgid "Remove Rule" -msgstr "Remover Regra" - -msgid "Remove Rule from Policy" -msgstr "Remover Regra da Política" - -#, python-format -msgid "Router(s) was successfully removed from firewall %(firewall)s." -msgstr "Roteadores foram removidos com sucesso do firewall %(firewall)s." - -#, python-format -msgid "Router(s) was/were successfully added to firewall %(firewall)s." -msgstr "Roteadores foram adicionados ao firewall %(firewall)s." - -msgid "Routers" -msgstr "Roteadores" - -msgid "Rule" -msgstr "Regra" - -#, python-format -msgid "Rule %(rule)s was successfully inserted to policy %(policy)s." -msgstr "A regra %(rule)s foi adicionada com sucesso na política %(policy)s." - -#, python-format -msgid "Rule %(rule)s was successfully removed from policy %(policy)s." -msgstr "A regra %(rule)s foi removida com sucesso da política %(policy)s." - -#, python-format -msgid "Rule %s was successfully updated." -msgstr "A regra %s foi atualizada com sucesso." - -msgid "Rules" -msgstr "Regras" - -msgid "Save Changes" -msgstr "Salvar Alterações" - -msgid "Scheduled deletion of Policy" -msgid_plural "Scheduled deletion of Policies" -msgstr[0] "Exclusão agendada de Política" -msgstr[1] "Exclusão agendada de Políticas" - -msgid "Scheduled deletion of Rule" -msgid_plural "Scheduled deletion of Rules" -msgstr[0] "Exclusão agendada de Regra" -msgstr[1] "Exclusão agendada de Regras" - -msgid "Scheduled deletion of firewall" -msgid_plural "Scheduled deletion of firewalls" -msgstr[0] "Exclusão agendada do firewall" -msgstr[1] "Exclusão agendada dos firewalls" - -msgid "Scheduled deletion of policy" -msgid_plural "Scheduled deletion of policies" -msgstr[0] "Exclusão agendada da política" -msgstr[1] "Exclusão agendada das políticas" - -msgid "Scheduled deletion of rule" -msgid_plural "Scheduled deletion of rules" -msgstr[0] "Agendada exclusão de regra." -msgstr[1] "Agendadas exclusões de regras." - -msgid "Select a Policy" -msgstr "Selecione uma Política" - -msgid "Select a policy" -msgstr "Selecione a política" - -msgid "Select routers for your firewall." -msgstr "Selecione os roteadores para o seu firewall." - -msgid "Select rules for your policy." -msgstr "Selecionar regras para a sua política." - -msgid "Selected Routers" -msgstr "Roteadores Selecionados" - -msgid "Selected Rules" -msgstr "Regras Selecionadas" - -msgid "Shared" -msgstr "Compartilhado" - -msgid "Source IP" -msgstr "IP de origem" - -msgid "Source IP Address" -msgstr "Endereço IP de Origem" - -msgid "Source IP Address/Subnet" -msgstr "Endereço IP/Sub-rede de Origem" - -msgid "Source IP address or subnet" -msgstr "Endereço IP ou sub-rede de origem" - -msgid "Source Port" -msgstr "Porta de Origem" - -msgid "Source Port/Port Range" -msgstr "Porta de Origem/Faixa de Porta" - -msgid "Source port (integer in [1, 65535] or range in a:b)" -msgstr "Porta de origem (número inteiro em [1, 65535] ou faixa em a:b)" - -msgid "" -"Source/Destination Network Address and IP version are inconsistent. Please " -"make them consistent." -msgstr "" -"O Endereço de Rede de Origem/Destino e a Versão do IP estão inconsistentes. " -"Torne-os consistentes" - -msgid "Status" -msgstr "Status" - -msgid "TCP" -msgstr "TCP" - -msgid "UDP" -msgstr "UDP" - -msgctxt "Admin state of a firewall" -msgid "UP" -msgstr "Acima" - -#, python-format -msgid "Unable to add Policy \"%s\"." -msgstr "Não é possível adicionar a Política \"%s\"." - -#, python-format -msgid "Unable to add Rule \"%s\"." -msgstr "Não é possível adicionar a Regra \"%s\"." - -#, python-format -msgid "Unable to add firewall \"%s\"." -msgstr "Não é possível adicionar o firewall \"%s\"." - -#, python-format -msgid "Unable to add policy \"%s\"." -msgstr "Não é possível adicionar a política \"%s\"." - -#, python-format -msgid "Unable to add rule \"%s\"." -msgstr "Não é possível adicionar a regra \"%s\"." - -#, python-format -msgid "Unable to delete firewall. %s" -msgstr "Não é possível excluir o firewall. %s" - -#, python-format -msgid "Unable to delete policy. %s" -msgstr "Não é possível excluir a política. %s" - -#, python-format -msgid "Unable to delete rule. %s" -msgstr "Não é possível excluir regra. %s" - -msgid "Unable to retrieve firewall details." -msgstr "Não é possível recuperar detalhes do firewall." - -msgid "Unable to retrieve firewall list." -msgstr "Não é possível recuperar a lista do firewall." - -msgid "Unable to retrieve policies list." -msgstr "Não é possível recuperar a lista de políticas." - -msgid "Unable to retrieve policy details." -msgstr "Não é possível recuperar detalhes da política." - -#, python-format -msgid "Unable to retrieve policy list (%(error)s)." -msgstr "Não é possível recuperar a lista de políticas (%(error)s)." - -msgid "Unable to retrieve policy list." -msgstr "Não é possível recuperar a lista de políticas." - -#, python-format -msgid "Unable to retrieve routers (%(error)s)." -msgstr "Não é possível recuperar roteadores (%(error)s)." - -msgid "Unable to retrieve rule details." -msgstr "Não é possível recuperar detalhes da regra." - -#, python-format -msgid "Unable to retrieve rules (%(error)s)." -msgstr "Não é possível recuperar as regras (%(error)s)." - -msgid "Unable to retrieve rules list." -msgstr "Não é possível recuperar lista de regras." - -msgid "Unselect the router(s) to be removed from firewall." -msgstr "Desmarque os roteadores para serem removidos do firewall." - -msgid "Unselect the routers you want to disassociate from the firewall." -msgstr "Desmarcar o roteador que você deseja desassociar do firewall." - -msgid "Used in Policy" -msgstr "Utilizado na Política." - -msgid "You may update firewall details here." -msgstr "Você pode atualizar os detalhes do firewall aqui." diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/static/neutron_fwaas_dashboard/scss/firewalls.scss neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/static/neutron_fwaas_dashboard/scss/firewalls.scss --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/static/neutron_fwaas_dashboard/scss/firewalls.scss 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/static/neutron_fwaas_dashboard/scss/firewalls.scss 2018-02-22 06:27:32.000000000 +0000 @@ -1,16 +1,7 @@ @import "/dashboard/scss/components/resource_topology"; .sort-container { - /* FWaaS v2 and v1 */ - #selected_port { - @include common_box_list_selected("rule"); - } - /* FWaaS v2 */ #selected_port { @include common_box_list_selected("port"); } - /* FWaaS v1 */ - #selected_port { - @include common_box_list_selected("router"); - } } diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/fwaas_tests.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/fwaas_tests.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/fwaas_tests.py 1970-01-01 00:00:00.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/fwaas_tests.py 2018-02-22 06:27:32.000000000 +0000 @@ -0,0 +1,455 @@ +# Copyright 2013, Big Switch Networks, Inc. +# +# 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. + +from django import http +from mox3 import mox +from neutronclient.v2_0.client import Client as neutronclient +from openstack_dashboard.api import neutron as api_neutron + +from neutron_fwaas_dashboard.api import fwaas as api_fwaas +from neutron_fwaas_dashboard.test import helpers as test + + +class FwaasApiTests(test.APITestCase): + @test.create_stubs({neutronclient: ('create_firewall_rule',)}) + def test_rule_create(self): + rule1 = self.fw_rules.first() + rule1_dict = self.api_fw_rules.first() + form_data = {'name': rule1.name, + 'description': rule1.description, + 'protocol': rule1.protocol, + 'action': rule1.action, + 'source_ip_address': rule1.source_ip_address, + 'source_port': rule1.source_port, + 'destination_ip_address': rule1.destination_ip_address, + 'destination_port': rule1.destination_port, + 'shared': rule1.shared, + 'enabled': rule1.enabled + } + form_dict = {'firewall_rule': form_data} + ret_dict = {'firewall_rule': rule1_dict} + neutronclient.create_firewall_rule(form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.rule_create(self.request, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Rule) + self.assertEqual(rule1.name, ret_val.name) + self.assertTrue(ret_val.id) + + def _assert_rule_return_value(self, ret_val, exp_rule): + self.assertIsInstance(ret_val, api_fwaas.Rule) + self.assertEqual(exp_rule.name, ret_val.name) + self.assertTrue(ret_val.id) + if exp_rule.policy: + self.assertEqual(exp_rule.firewall_policy_id, ret_val.policy.id) + self.assertEqual(exp_rule.policy.name, ret_val.policy.name) + else: + self.assertIsNone(ret_val.policy) + + @test.create_stubs({neutronclient: ('list_firewall_rules', + 'list_firewall_policies')}) + def test_rule_list(self): + exp_rules = self.fw_rules.list() + api_rules = {'firewall_rules': self.api_fw_rules.list()} + api_policies = {'firewall_policies': self.api_fw_policies.list()} + + neutronclient.list_firewall_rules().AndReturn(api_rules) + neutronclient.list_firewall_policies().AndReturn(api_policies) + self.mox.ReplayAll() + + ret_val = api_fwaas.rule_list(self.request) + for (v, d) in zip(ret_val, exp_rules): + self._assert_rule_return_value(v, d) + + @test.create_stubs({neutronclient: ('list_firewall_rules', + 'list_firewall_policies')}) + def test_rule_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_rules = self.fw_rules.list() + api_rules = {'firewall_rules': self.api_fw_rules.list()} + api_policies = {'firewall_policies': self.api_fw_policies.list()} + + neutronclient.list_firewall_rules( + tenant_id=tenant_id, + shared=False).AndReturn({'firewall_rules': []}) + neutronclient.list_firewall_rules(shared=True) \ + .AndReturn(api_rules) + neutronclient.list_firewall_policies().AndReturn(api_policies) + self.mox.ReplayAll() + + ret_val = api_fwaas.rule_list_for_tenant(self.request, tenant_id) + for (v, d) in zip(ret_val, exp_rules): + self._assert_rule_return_value(v, d) + + @test.create_stubs({neutronclient: ('show_firewall_rule', + 'show_firewall_policy')}) + def test_rule_get(self): + exp_rule = self.fw_rules.first() + ret_dict = {'firewall_rule': self.api_fw_rules.first()} + policy_dict = {'firewall_policy': self.api_fw_policies.first()} + + neutronclient.show_firewall_rule(exp_rule.id).AndReturn(ret_dict) + neutronclient.show_firewall_policy( + exp_rule.firewall_policy_id).AndReturn(policy_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.rule_get(self.request, exp_rule.id) + self._assert_rule_return_value(ret_val, exp_rule) + + @test.create_stubs({neutronclient: ('update_firewall_rule',)}) + def test_rule_update(self): + rule = self.fw_rules.first() + rule_dict = self.api_fw_rules.first() + + rule.name = 'new name' + rule.description = 'new desc' + rule.protocol = 'icmp' + rule.action = 'deny' + rule.shared = True + rule.enabled = False + + rule_dict['name'] = 'new name' + rule_dict['description'] = 'new desc' + rule_dict['protocol'] = 'icmp' + rule_dict['action'] = 'deny' + rule_dict['shared'] = True + rule_dict['enabled'] = False + + form_data = {'name': rule.name, + 'description': rule.description, + 'protocol': rule.protocol, + 'action': rule.action, + 'shared': rule.shared, + 'enabled': rule.enabled + } + form_dict = {'firewall_rule': form_data} + ret_dict = {'firewall_rule': rule_dict} + + neutronclient.update_firewall_rule( + rule.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.rule_update(self.request, + rule.id, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Rule) + self.assertEqual(rule.name, ret_val.name) + self.assertTrue(ret_val.id) + + @test.create_stubs({neutronclient: ('create_firewall_policy', )}) + def test_policy_create(self): + policy1 = self.fw_policies.first() + policy1_dict = self.api_fw_policies.first() + + form_data = {'name': policy1.name, + 'description': policy1.description, + 'firewall_rules': policy1.firewall_rules, + 'shared': policy1.shared, + 'audited': policy1.audited + } + form_dict = {'firewall_policy': form_data} + ret_dict = {'firewall_policy': policy1_dict} + + neutronclient.create_firewall_policy(form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_create(self.request, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Policy) + self.assertEqual(policy1.name, ret_val.name) + self.assertTrue(ret_val.id) + + def _assert_policy_return_value(self, ret_val, exp_policy): + self.assertIsInstance(ret_val, api_fwaas.Policy) + self.assertEqual(exp_policy.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertEqual(len(exp_policy.firewall_rules), len(ret_val.rules)) + self.assertEqual(len(exp_policy.firewall_rules), + len(ret_val.firewall_rules)) + for (r, exp_r) in zip(ret_val.rules, exp_policy.rules): + self.assertEqual(exp_r.id, r.id) + + @test.create_stubs({neutronclient: ('list_firewall_policies', + 'list_firewall_rules')}) + def test_policy_list(self): + exp_policies = self.fw_policies.list() + policies_dict = {'firewall_policies': self.api_fw_policies.list()} + rules_dict = {'firewall_rules': self.api_fw_rules.list()} + + neutronclient.list_firewall_policies().AndReturn(policies_dict) + neutronclient.list_firewall_rules().AndReturn(rules_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_list(self.request) + for (v, d) in zip(ret_val, exp_policies): + self._assert_policy_return_value(v, d) + + @test.create_stubs({neutronclient: ('list_firewall_policies', + 'list_firewall_rules')}) + def test_policy_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_policies = self.fw_policies.list() + policies_dict = {'firewall_policies': self.api_fw_policies.list()} + rules_dict = {'firewall_rules': self.api_fw_rules.list()} + + neutronclient.list_firewall_policies( + tenant_id=tenant_id, + shared=False).AndReturn({'firewall_policies': []}) + neutronclient.list_firewall_policies( + shared=True).AndReturn(policies_dict) + neutronclient.list_firewall_rules().AndReturn(rules_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_list_for_tenant(self.request, tenant_id) + for (v, d) in zip(ret_val, exp_policies): + self._assert_policy_return_value(v, d) + + @test.create_stubs({neutronclient: ('show_firewall_policy', + 'list_firewall_rules')}) + def test_policy_get(self): + exp_policy = self.fw_policies.first() + policy_dict = self.api_fw_policies.first() + # The first two rules are associated with the first policy. + api_rules = self.api_fw_rules.list()[:2] + + ret_dict = {'firewall_policy': policy_dict} + neutronclient.show_firewall_policy(exp_policy.id).AndReturn(ret_dict) + filters = {'firewall_policy_id': exp_policy.id} + ret_dict = {'firewall_rules': api_rules} + neutronclient.list_firewall_rules(**filters).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_get(self.request, exp_policy.id) + self._assert_policy_return_value(ret_val, exp_policy) + + @test.create_stubs({neutronclient: ('show_firewall_policy',)}) + def test_policy_get_no_rule(self): + # 2nd policy is not associated with any rules. + exp_policy = self.fw_policies.list()[1] + policy_dict = self.api_fw_policies.list()[1] + + ret_dict = {'firewall_policy': policy_dict} + neutronclient.show_firewall_policy(exp_policy.id).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_get(self.request, exp_policy.id) + self.assertIsInstance(ret_val, api_fwaas.Policy) + self.assertEqual(exp_policy.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertFalse(len(ret_val.rules)) + + @test.create_stubs({neutronclient: ('update_firewall_policy',)}) + def test_policy_update(self): + policy = self.fw_policies.first() + policy_dict = self.api_fw_policies.first() + + policy.name = 'new name' + policy.description = 'new desc' + policy.shared = True + policy.audited = False + + policy_dict['name'] = 'new name' + policy_dict['description'] = 'new desc' + policy_dict['shared'] = True + policy_dict['audited'] = False + + form_data = {'name': policy.name, + 'description': policy.description, + 'shared': policy.shared, + 'audited': policy.audited + } + + form_dict = {'firewall_policy': form_data} + ret_dict = {'firewall_policy': policy_dict} + + neutronclient.update_firewall_policy( + policy.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_update(self.request, + policy.id, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Policy) + self.assertEqual(policy.name, ret_val.name) + self.assertTrue(ret_val.id) + + @test.create_stubs({neutronclient: ('firewall_policy_insert_rule',)}) + def test_policy_insert_rule(self): + policy = self.fw_policies.first() + policy_dict = self.api_fw_policies.first() + + new_rule_id = 'h0881d38-c3eb-4fee-9763-12de3338041d' + policy.firewall_rules.append(new_rule_id) + policy_dict['firewall_rules'].append(new_rule_id) + + body = {'firewall_rule_id': new_rule_id, + 'insert_before': policy.firewall_rules[1], + 'insert_after': policy.firewall_rules[0]} + + neutronclient.firewall_policy_insert_rule( + policy.id, body).AndReturn(policy_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_insert_rule(self.request, + policy.id, **body) + self.assertIn(new_rule_id, ret_val.firewall_rules) + + @test.create_stubs({neutronclient: ('firewall_policy_remove_rule',)}) + def test_policy_remove_rule(self): + policy = self.fw_policies.first() + policy_dict = self.api_fw_policies.first() + + remove_rule_id = policy.firewall_rules[0] + policy_dict['firewall_rules'].remove(remove_rule_id) + + body = {'firewall_rule_id': remove_rule_id} + + neutronclient.firewall_policy_remove_rule( + policy.id, body).AndReturn(policy_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.policy_remove_rule(self.request, + policy.id, **body) + self.assertNotIn(remove_rule_id, ret_val.firewall_rules) + + @test.create_stubs({neutronclient: ('create_firewall', )}) + def test_firewall_create(self): + firewall = self.firewalls.first() + firewall_dict = self.api_firewalls.first() + + form_data = {'name': firewall.name, + 'description': firewall.description, + 'firewall_policy_id': firewall.firewall_policy_id, + 'admin_state_up': firewall.admin_state_up + } + + form_dict = {'firewall': form_data} + ret_dict = {'firewall': firewall_dict} + neutronclient.create_firewall(form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.firewall_create(self.request, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Firewall) + self.assertEqual(firewall.name, ret_val.name) + self.assertTrue(ret_val.id) + + def _assert_firewall_return_value(self, ret_val, exp_firewall): + self.assertIsInstance(ret_val, api_fwaas.Firewall) + self.assertEqual(exp_firewall.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertEqual(exp_firewall.firewall_policy_id, ret_val.policy.id) + self.assertEqual(exp_firewall.policy.name, ret_val.policy.name) + + # TODO(absubram) : Add API tests for firewall_create with routers, + # add router to firewall and remove router from fw. + + @test.create_stubs({neutronclient: ('list_firewalls', + 'list_firewall_policies'), + api_neutron: ('is_extension_supported', + 'router_list')}) + def test_firewall_list(self): + exp_firewalls = self.firewalls.list() + firewalls_dict = {'firewalls': self.api_firewalls.list()} + policies_dict = {'firewall_policies': self.api_fw_policies.list()} + + neutronclient.list_firewalls().AndReturn(firewalls_dict) + neutronclient.list_firewall_policies().AndReturn(policies_dict) + api_neutron.is_extension_supported( + mox.IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) + api_neutron.router_list(mox.IsA(http.HttpRequest)) \ + .AndReturn(self.routers.list()) + self.mox.ReplayAll() + + ret_val = api_fwaas.firewall_list(self.request) + for (v, d) in zip(ret_val, exp_firewalls): + self._assert_firewall_return_value(v, d) + + @test.create_stubs({neutronclient: ('list_firewalls', + 'list_firewall_policies'), + api_neutron: ('is_extension_supported', + 'router_list')}) + def test_firewall_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_firewalls = self.firewalls.list() + firewalls_dict = {'firewalls': self.api_firewalls.list()} + policies_dict = {'firewall_policies': self.api_fw_policies.list()} + + neutronclient.list_firewalls(tenant_id=tenant_id) \ + .AndReturn(firewalls_dict) + neutronclient.list_firewall_policies().AndReturn(policies_dict) + api_neutron.is_extension_supported( + mox.IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) + api_neutron.router_list(mox.IsA(http.HttpRequest), + tenant_id=self.request.user.project_id) \ + .AndReturn(self.routers.list()) + self.mox.ReplayAll() + + ret_val = api_fwaas.firewall_list_for_tenant(self.request, tenant_id) + for (v, d) in zip(ret_val, exp_firewalls): + self._assert_firewall_return_value(v, d) + + @test.create_stubs({neutronclient: ('show_firewall', + 'show_firewall_policy'), + api_neutron: ('is_extension_supported', + 'router_list')}) + def test_firewall_get(self): + exp_firewall = self.firewalls.first() + ret_dict = {'firewall': self.api_firewalls.first()} + policy_dict = {'firewall_policy': self.api_fw_policies.first()} + + neutronclient.show_firewall(exp_firewall.id).AndReturn(ret_dict) + neutronclient.show_firewall_policy( + exp_firewall.firewall_policy_id).AndReturn(policy_dict) + api_neutron.is_extension_supported( + mox.IsA(http.HttpRequest), 'fwaasrouterinsertion').AndReturn(True) + api_neutron.router_list( + mox.IsA(http.HttpRequest), + id=exp_firewall.router_ids).AndReturn(exp_firewall.routers) + self.mox.ReplayAll() + + ret_val = api_fwaas.firewall_get(self.request, exp_firewall.id) + self._assert_firewall_return_value(ret_val, exp_firewall) + self.assertEqual(exp_firewall.router_ids, ret_val.router_ids) + self.assertEqual(exp_firewall.router_ids, + [r.id for r in ret_val.routers]) + self.assertEqual([r.name for r in exp_firewall.routers], + [r.name for r in ret_val.routers]) + + @test.create_stubs({neutronclient: ('update_firewall',)}) + def test_firewall_update(self): + firewall = self.firewalls.first() + firewall_dict = self.api_firewalls.first() + + firewall.name = 'new name' + firewall.description = 'new desc' + firewall.admin_state_up = False + + firewall_dict['name'] = 'new name' + firewall_dict['description'] = 'new desc' + firewall_dict['admin_state_up'] = False + + form_data = {'name': firewall.name, + 'description': firewall.description, + 'admin_state_up': firewall.admin_state_up + } + + form_dict = {'firewall': form_data} + ret_dict = {'firewall': firewall_dict} + + neutronclient.update_firewall( + firewall.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas.firewall_update(self.request, + firewall.id, **form_data) + self.assertIsInstance(ret_val, api_fwaas.Firewall) + self.assertEqual(firewall.name, ret_val.name) + self.assertTrue(ret_val.id) diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/fwaas_v2_tests.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/fwaas_v2_tests.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/fwaas_v2_tests.py 1970-01-01 00:00:00.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/fwaas_v2_tests.py 2018-02-22 06:27:32.000000000 +0000 @@ -0,0 +1,554 @@ +# Copyright 2017, Juniper Networks. +# +# 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. + +from neutronclient.v2_0.client import Client as neutronclient + +from neutron_fwaas_dashboard.api import fwaas_v2 as api_fwaas_v2 +from neutron_fwaas_dashboard.test import helpers as test + + +class FwaasV2ApiTests(test.APITestCase): + @test.create_stubs({neutronclient: ('create_fwaas_firewall_rule',)}) + def test_rule_create(self): + rule1 = self.fw_rules_v2.first() + rule1_dict = self.api_fw_rules_v2.first() + form_data = {'name': rule1.name, + 'description': rule1.description, + 'protocol': rule1.protocol, + 'action': rule1.action, + 'source_ip_address': rule1.source_ip_address, + 'source_port': rule1.source_port, + 'destination_ip_address': rule1.destination_ip_address, + 'destination_port': rule1.destination_port, + 'shared': rule1.shared, + 'enabled': rule1.enabled + } + form_dict = {'firewall_rule': form_data} + ret_dict = {'firewall_rule': rule1_dict} + neutronclient.create_fwaas_firewall_rule(form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.rule_create(self.request, **form_data) + self._assert_rule_return_value(ret_val, rule1) + + def _assert_rule_return_value(self, ret_val, exp_rule): + self.assertIsInstance(ret_val, api_fwaas_v2.Rule) + self.assertEqual(exp_rule.name, ret_val.name) + self.assertTrue(ret_val.id) + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_rules',)}) + def test_rule_list(self): + exp_rules = self.fw_rules_v2.list() + api_rules = {'firewall_rules': self.api_fw_rules_v2.list()} + + neutronclient.list_fwaas_firewall_rules().AndReturn(api_rules) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.rule_list(self.request) + for (v, d) in zip(ret_val, exp_rules): + self._assert_rule_return_value(v, d) + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_rules',)}) + def test_rule_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_rules = self.fw_rules_v2.list() + api_rules = {'firewall_rules': self.api_fw_rules_v2.list()} + + neutronclient.list_fwaas_firewall_rules( + tenant_id=tenant_id, + shared=False).AndReturn({'firewall_rules': []}) + neutronclient.list_fwaas_firewall_rules(shared=True) \ + .AndReturn(api_rules) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.rule_list_for_tenant(self.request, tenant_id) + for (v, d) in zip(ret_val, exp_rules): + self._assert_rule_return_value(v, d) + + @test.create_stubs({neutronclient: ('show_fwaas_firewall_rule',)}) + def test_rule_get(self): + exp_rule = self.fw_rules_v2.first() + ret_dict = {'firewall_rule': self.api_fw_rules_v2.first()} + + neutronclient.show_fwaas_firewall_rule(exp_rule.id).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.rule_get(self.request, exp_rule.id) + self._assert_rule_return_value(ret_val, exp_rule) + + @test.create_stubs({neutronclient: ('update_fwaas_firewall_rule',)}) + def test_rule_update(self): + rule = self.fw_rules_v2.first() + rule_dict = self.api_fw_rules_v2.first() + + rule.name = 'new name' + rule.description = 'new desc' + rule.protocol = 'icmp' + rule.action = 'deny' + rule.shared = True + rule.enabled = False + + rule_dict['name'] = 'new name' + rule_dict['description'] = 'new desc' + rule_dict['protocol'] = 'icmp' + rule_dict['action'] = 'deny' + rule_dict['shared'] = True + rule_dict['enabled'] = False + + form_data = {'name': rule.name, + 'description': rule.description, + 'protocol': rule.protocol, + 'action': rule.action, + 'shared': rule.shared, + 'enabled': rule.enabled + } + form_dict = {'firewall_rule': form_data} + ret_dict = {'firewall_rule': rule_dict} + + neutronclient.update_fwaas_firewall_rule( + rule.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.rule_update(self.request, + rule.id, **form_data) + self._assert_rule_return_value(ret_val, rule) + + @test.create_stubs({neutronclient: ('create_fwaas_firewall_policy', )}) + def test_policy_create(self): + policy1 = self.fw_policies_v2.first() + policy1_dict = self.api_fw_policies_v2.first() + + form_data = {'name': policy1.name, + 'description': policy1.description, + 'firewall_rules': policy1.firewall_rules, + 'shared': policy1.shared, + 'audited': policy1.audited + } + form_dict = {'firewall_policy': form_data} + ret_dict = {'firewall_policy': policy1_dict} + + neutronclient.create_fwaas_firewall_policy(form_dict).\ + AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_create(self.request, **form_data) + self.assertIsInstance(ret_val, api_fwaas_v2.Policy) + self.assertEqual(policy1.name, ret_val.name) + self.assertTrue(ret_val.id) + + def _assert_policy_return_value(self, ret_val, exp_policy): + self.assertIsInstance(ret_val, api_fwaas_v2.Policy) + self.assertEqual(exp_policy.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertEqual(len(exp_policy.firewall_rules), len(ret_val.rules)) + self.assertEqual(len(exp_policy.firewall_rules), + len(ret_val.firewall_rules)) + for (r, exp_r) in zip(ret_val.rules, exp_policy.rules): + self.assertEqual(exp_r.id, r.id) + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_policies', + 'list_fwaas_firewall_rules')}) + def test_policy_list(self): + exp_policies = self.fw_policies_v2.list() + policies_dict = {'firewall_policies': self.api_fw_policies_v2.list()} + rules_dict = {'firewall_rules': self.api_fw_rules_v2.list()} + + neutronclient.list_fwaas_firewall_policies().AndReturn(policies_dict) + neutronclient.list_fwaas_firewall_rules().AndReturn(rules_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_list(self.request) + for (v, d) in zip(ret_val, exp_policies): + self._assert_policy_return_value(v, d) + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_policies', + 'list_fwaas_firewall_rules')}) + def test_policy_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_policies = self.fw_policies_v2.list() + policies_dict = {'firewall_policies': self.api_fw_policies_v2.list()} + rules_dict = {'firewall_rules': self.api_fw_rules_v2.list()} + + neutronclient.list_fwaas_firewall_policies( + tenant_id=tenant_id, + shared=False).AndReturn({'firewall_policies': []}) + neutronclient.list_fwaas_firewall_policies( + shared=True).AndReturn(policies_dict) + neutronclient.list_fwaas_firewall_rules().AndReturn(rules_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_list_for_tenant(self.request, tenant_id) + for (v, d) in zip(ret_val, exp_policies): + self._assert_policy_return_value(v, d) + + @test.create_stubs({neutronclient: ('show_fwaas_firewall_policy', + 'list_fwaas_firewall_rules')}) + def test_policy_get(self): + exp_policy = self.fw_policies_v2.first() + policy_dict = self.api_fw_policies_v2.first() + # The first two rules are associated with the first policy. + api_rules = self.api_fw_rules_v2.list()[:2] + + ret_dict = {'firewall_policy': policy_dict} + neutronclient.show_fwaas_firewall_policy( + exp_policy.id).AndReturn(ret_dict) + filters = {'firewall_policy_id': exp_policy.id} + ret_dict = {'firewall_rules': api_rules} + neutronclient.list_fwaas_firewall_rules(**filters).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_get(self.request, exp_policy.id) + self._assert_policy_return_value(ret_val, exp_policy) + + @test.create_stubs({neutronclient: ('show_fwaas_firewall_policy',)}) + def test_policy_get_no_rule(self): + # 2nd policy is not associated with any rules. + exp_policy = self.fw_policies_v2.list()[1] + policy_dict = self.api_fw_policies_v2.list()[1] + + ret_dict = {'firewall_policy': policy_dict} + neutronclient.show_fwaas_firewall_policy( + exp_policy.id).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_get(self.request, exp_policy.id) + self.assertIsInstance(ret_val, api_fwaas_v2.Policy) + self.assertEqual(exp_policy.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertFalse(len(ret_val.rules)) + + @test.create_stubs({neutronclient: ('update_fwaas_firewall_policy',)}) + def test_policy_update(self): + policy = self.fw_policies_v2.first() + policy_dict = self.api_fw_policies_v2.first() + + policy.name = 'new name' + policy.description = 'new desc' + policy.shared = True + policy.audited = False + + policy_dict['name'] = 'new name' + policy_dict['description'] = 'new desc' + policy_dict['shared'] = True + policy_dict['audited'] = False + + form_data = {'name': policy.name, + 'description': policy.description, + 'shared': policy.shared, + 'audited': policy.audited + } + + form_dict = {'firewall_policy': form_data} + ret_dict = {'firewall_policy': policy_dict} + + neutronclient.update_fwaas_firewall_policy( + policy.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_update(self.request, + policy.id, **form_data) + self.assertIsInstance(ret_val, api_fwaas_v2.Policy) + self.assertEqual(policy.name, ret_val.name) + self.assertTrue(ret_val.id) + + @test.create_stubs({neutronclient: ('insert_rule_fwaas_firewall_policy',)}) + def test_policy_insert_rule(self): + policy = self.fw_policies_v2.first() + policy_dict = self.api_fw_policies_v2.first() + + new_rule_id = 'h0881d38-c3eb-4fee-9763-12de3338041d' + policy.firewall_rules.append(new_rule_id) + policy_dict['firewall_rules'].append(new_rule_id) + + body = {'firewall_rule_id': new_rule_id, + 'insert_before': policy.firewall_rules[1], + 'insert_after': policy.firewall_rules[0]} + + neutronclient.insert_rule_fwaas_firewall_policy( + policy.id, body).AndReturn(policy_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_insert_rule(self.request, + policy.id, **body) + self.assertIn(new_rule_id, ret_val.firewall_rules) + + @test.create_stubs({neutronclient: ('remove_rule_fwaas_firewall_policy',)}) + def test_policy_remove_rule(self): + policy = self.fw_policies_v2.first() + policy_dict = self.api_fw_policies_v2.first() + + remove_rule_id = policy.firewall_rules[0] + policy_dict['firewall_rules'].remove(remove_rule_id) + + body = {'firewall_rule_id': remove_rule_id} + + neutronclient.remove_rule_fwaas_firewall_policy( + policy.id, body).AndReturn(policy_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.policy_remove_rule(self.request, + policy.id, **body) + self.assertNotIn(remove_rule_id, ret_val.firewall_rules) + + @test.create_stubs({neutronclient: ('create_fwaas_firewall_group', )}) + def test_firewall_group_create(self): + firewall_group = self.firewall_groups_v2.first() + firewall_group_dict = self.api_firewall_groups_v2.first() + + form_data = { + 'name': firewall_group.name, + 'description': firewall_group.description, + 'ingress_firewall_policy_id': + firewall_group.ingress_firewall_policy_id, + 'egress_firewall_policy_id': + firewall_group.egress_firewall_policy_id, + 'admin_state_up': firewall_group.admin_state_up + } + + form_dict = {'firewall_group': form_data} + ret_dict = {'firewall_group': firewall_group_dict} + neutronclient.create_fwaas_firewall_group( + form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.firewall_group_create(self.request, **form_data) + self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) + self.assertEqual(firewall_group.name, ret_val.name) + self.assertEqual(firewall_group.id, ret_val.id) + + def _assert_firewall_return_value(self, ret_val, exp_firewall, + expand_policy=True): + self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) + self.assertEqual(exp_firewall.name, ret_val.name) + self.assertTrue(ret_val.id) + self.assertEqual(exp_firewall.ingress_firewall_policy_id, + ret_val.ingress_firewall_policy_id) + if expand_policy: + if exp_firewall.ingress_firewall_policy_id: + self.assertEqual(exp_firewall.ingress_firewall_policy_id, + ret_val.ingress_policy.id) + self.assertEqual(exp_firewall.ingress_policy.name, + ret_val.ingress_policy.name) + else: + self.assertIsNone(ret_val.ingress_policy) + if exp_firewall.egress_firewall_policy_id: + self.assertEqual(exp_firewall.egress_firewall_policy_id, + ret_val.egress_policy.id) + self.assertEqual(exp_firewall.egress_policy.name, + ret_val.egress_policy.name) + else: + self.assertIsNone(ret_val.egress_policy) + + # TODO(Sarath Mekala) : Add API tests for firewall_group_create with ports, + # add port to firewall and remove port from fw. + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_groups', + 'list_fwaas_firewall_policies')}) + def test_firewall_list(self): + exp_firewalls = self.firewall_groups_v2.list() + firewalls_dict = { + 'firewall_groups': self.api_firewall_groups_v2.list()} + + neutronclient.list_fwaas_firewall_groups().AndReturn(firewalls_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.firewall_list(self.request) + for (v, d) in zip(ret_val, exp_firewalls): + self._assert_firewall_return_value(v, d, expand_policy=False) + + @test.create_stubs({neutronclient: ('list_fwaas_firewall_groups', + 'list_fwaas_firewall_policies')}) + def test_firewall_list_for_tenant(self): + tenant_id = self.request.user.project_id + exp_firewalls = self.firewall_groups_v2.list() + firewalls_dict = { + 'firewall_groups': self.api_firewall_groups_v2.list()} + + neutronclient.list_fwaas_firewall_groups(shared=False, tenant_id=tenant_id) \ + .AndReturn(firewalls_dict) + neutronclient.list_fwaas_firewall_groups(shared=True) \ + .AndReturn(firewalls_dict) + self.mox.ReplayAll() + ret_val = api_fwaas_v2.firewall_list_for_tenant( + self.request, tenant_id) + for (v, d) in zip(ret_val, exp_firewalls): + self._assert_firewall_return_value(v, d, expand_policy=False) + + @test.create_stubs({neutronclient: ('list_ports', + 'list_fwaas_firewall_groups')}) + def test_fwg_port_list_for_tenant(self): + tenant_id = self.request.user.project_id + router_port = { + 'id': 'id-1', + 'name': 'port-1', + 'device_owner': 'network:router_interface' + } + vm_port1 = { + 'id': 'id-vm_port-1', + 'name': 'port-2', + 'device_owner': 'compute:nova' + } + vm_port2 = { + 'id': 'id-vm_port-2', + 'name': 'port-2', + 'device_owner': 'compute:nova' + } + gateway_port = { + 'id': 'id-3', + 'name': 'port-3', + 'device_owner': 'network:router_gateway' + } + dhcp_port = { + 'id': 'id-4', + 'name': 'port-4', + 'device_owner': 'network:dhcp' + } + dummy_ports = {'ports': [ + router_port, + vm_port1, + vm_port2, + gateway_port, + dhcp_port, + ]} + + neutronclient.list_ports(tenant_id=tenant_id).AndReturn(dummy_ports) + neutronclient.list_fwaas_firewall_groups( + tenant_id=tenant_id).AndReturn({'firewall_groups': []}) + self.mox.ReplayAll() + ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) + self.assertEqual(router_port['id'], ports[0]['id']) + self.assertEqual(vm_port1['id'], ports[1]['id']) + self.assertEqual(vm_port2['id'], ports[2]['id']) + + @test.create_stubs({neutronclient: ('list_ports', + 'list_fwaas_firewall_groups')}) + def test_fwg_port_list_for_tenant_with_used_port(self): + tenant_id = self.request.user.project_id + router_port = { + 'id': 'id-1', + 'name': 'port-1', + 'device_owner': 'network:router_interface' + } + vm_port1 = { + 'id': 'id-vm_port-1', + 'name': 'port-2', + 'device_owner': 'compute:nova' + } + gateway_port = { + 'id': 'id-3', + 'name': 'port-3', + 'device_owner': 'network:router_gateway' + } + dhcp_port = { + 'id': 'id-4', + 'name': 'port-4', + 'device_owner': 'network:dhcp' + } + dummy_ports = {'ports': [ + router_port, + vm_port1, + gateway_port, + dhcp_port, + ]} + + used_ports = {'firewall_groups': [{'ports': [router_port['id']]}]} + + neutronclient.list_ports(tenant_id=tenant_id).AndReturn(dummy_ports) + neutronclient.list_fwaas_firewall_groups( + tenant_id=tenant_id).AndReturn(used_ports) + self.mox.ReplayAll() + ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) + self.assertEqual(vm_port1['id'], ports[0]['id']) + + @test.create_stubs({neutronclient: ('list_ports', + 'list_fwaas_firewall_groups')}) + def test_fwg_port_list_for_tenant_no_match(self): + tenant_id = self.request.user.project_id + dummy_ports = {'ports': [ + {'name': 'port-3', 'device_owner': 'network:router_gateway'}, + {'name': 'port-4', 'device_owner': 'network:dhcp'}, + ]} + neutronclient.list_ports(tenant_id=tenant_id).AndReturn(dummy_ports) + neutronclient.list_fwaas_firewall_groups( + tenant_id=tenant_id).AndReturn({'firewall_groups': []}) + self.mox.ReplayAll() + ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) + self.assertEqual([], ports) + + @test.create_stubs({neutronclient: ('list_ports', + 'list_fwaas_firewall_groups')}) + def test_fwg_port_list_for_tenant_no_ports(self): + tenant_id = self.request.user.project_id + neutronclient.list_ports(tenant_id=tenant_id).AndReturn({'ports': []}) + neutronclient.list_fwaas_firewall_groups( + tenant_id=tenant_id).AndReturn({'firewall_groups': []}) + self.mox.ReplayAll() + ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) + self.assertEqual([], ports) + + @test.create_stubs({neutronclient: ('show_fwaas_firewall_group', + 'show_fwaas_firewall_policy')}) + def test_firewall_get(self): + exp_firewall = self.firewall_groups_v2.first() + ret_dict = {'firewall_group': self.api_firewall_groups_v2.first()} + + ingress_policy_id = exp_firewall.ingress_firewall_policy_id + ingress_policy = [p for p in self.api_fw_policies_v2.list() + if p['id'] == ingress_policy_id][0] + + egress_policy_id = exp_firewall.egress_firewall_policy_id + egress_policy = [p for p in self.api_fw_policies_v2.list() + if p['id'] == egress_policy_id][0] + + neutronclient.show_fwaas_firewall_group( + exp_firewall.id).AndReturn(ret_dict) + neutronclient.show_fwaas_firewall_policy(ingress_policy_id)\ + .AndReturn({'firewall_policy': ingress_policy}) + neutronclient.show_fwaas_firewall_policy(egress_policy_id)\ + .AndReturn({'firewall_policy': egress_policy}) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.firewall_get(self.request, exp_firewall.id) + self._assert_firewall_return_value(ret_val, exp_firewall) + + @test.create_stubs({neutronclient: ('update_fwaas_firewall_group',)}) + def test_firewall_update(self): + firewall = self.firewall_groups_v2.first() + firewall_dict = self.api_firewall_groups_v2.first() + + firewall.name = 'new name' + firewall.description = 'new desc' + firewall.admin_state_up = False + + firewall_dict['name'] = 'new name' + firewall_dict['description'] = 'new desc' + firewall_dict['admin_state_up'] = False + + form_data = {'name': firewall.name, + 'description': firewall.description, + 'admin_state_up': firewall.admin_state_up + } + + form_dict = {'firewall_group': form_data} + ret_dict = {'firewall_group': firewall_dict} + + neutronclient.update_fwaas_firewall_group( + firewall.id, form_dict).AndReturn(ret_dict) + self.mox.ReplayAll() + + ret_val = api_fwaas_v2.firewall_update(self.request, + firewall.id, **form_data) + self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) + self.assertEqual(firewall.name, ret_val.name) + self.assertTrue(ret_val.id) diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,480 +0,0 @@ -# Copyright 2013, Big Switch Networks, Inc. -# -# 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. - -import mock -from neutronclient.v2_0.client import Client as neutronclient -from openstack_dashboard.api import neutron as api_neutron -from openstack_dashboard.test import helpers - -from neutron_fwaas_dashboard.api import fwaas as api_fwaas -from neutron_fwaas_dashboard.test import helpers as test - - -class FwaasApiTests(test.APITestCase): - - use_mox = False - - @helpers.create_mocks({neutronclient: ('create_firewall_rule',)}) - def test_rule_create(self): - rule1 = self.fw_rules.first() - rule1_dict = self.api_fw_rules.first() - form_data = {'name': rule1.name, - 'description': rule1.description, - 'protocol': rule1.protocol, - 'action': rule1.action, - 'source_ip_address': rule1.source_ip_address, - 'source_port': rule1.source_port, - 'destination_ip_address': rule1.destination_ip_address, - 'destination_port': rule1.destination_port, - 'shared': rule1.shared, - 'enabled': rule1.enabled - } - form_dict = {'firewall_rule': form_data} - ret_dict = {'firewall_rule': rule1_dict} - self.mock_create_firewall_rule.return_value = ret_dict - - ret_val = api_fwaas.rule_create(self.request, **form_data) - - self.assertIsInstance(ret_val, api_fwaas.Rule) - self.assertEqual(rule1.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_create_firewall_rule.assert_called_once_with(form_dict) - - def _assert_rule_return_value(self, ret_val, exp_rule): - self.assertIsInstance(ret_val, api_fwaas.Rule) - self.assertEqual(exp_rule.name, ret_val.name) - self.assertTrue(ret_val.id) - if exp_rule.policy: - self.assertEqual(exp_rule.firewall_policy_id, ret_val.policy.id) - self.assertEqual(exp_rule.policy.name, ret_val.policy.name) - else: - self.assertIsNone(ret_val.policy) - - @helpers.create_mocks({neutronclient: ('list_firewall_rules', - 'list_firewall_policies')}) - def test_rule_list(self): - exp_rules = self.fw_rules.list() - api_rules = {'firewall_rules': self.api_fw_rules.list()} - api_policies = {'firewall_policies': self.api_fw_policies.list()} - - self.mock_list_firewall_rules.return_value = api_rules - self.mock_list_firewall_policies.return_value = api_policies - - ret_val = api_fwaas.rule_list(self.request) - for (v, d) in zip(ret_val, exp_rules): - self._assert_rule_return_value(v, d) - self.mock_list_firewall_rules.assert_called_once_with() - self.mock_list_firewall_policies.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('list_firewall_rules', - 'list_firewall_policies')}) - def test_rule_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_rules = self.fw_rules.list() - api_rules = {'firewall_rules': self.api_fw_rules.list()} - api_policies = {'firewall_policies': self.api_fw_policies.list()} - - self.mock_list_firewall_rules.side_effect = [ - {'firewall_rules': []}, - api_rules, - ] - self.mock_list_firewall_policies.return_value = api_policies - - ret_val = api_fwaas.rule_list_for_tenant(self.request, tenant_id) - - for (v, d) in zip(ret_val, exp_rules): - self._assert_rule_return_value(v, d) - self.assertEqual(2, self.mock_list_firewall_rules.call_count) - self.mock_list_firewall_rules.assert_has_calls([ - mock.call(tenant_id=tenant_id, shared=False), - mock.call(shared=True), - ]) - self.mock_list_firewall_policies.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('show_firewall_rule', - 'show_firewall_policy')}) - def test_rule_get(self): - exp_rule = self.fw_rules.first() - ret_dict = {'firewall_rule': self.api_fw_rules.first()} - policy_dict = {'firewall_policy': self.api_fw_policies.first()} - - self.mock_show_firewall_rule.return_value = ret_dict - self.mock_show_firewall_policy.return_value = policy_dict - - ret_val = api_fwaas.rule_get(self.request, exp_rule.id) - - self._assert_rule_return_value(ret_val, exp_rule) - self.mock_show_firewall_rule.assert_called_once_with(exp_rule.id) - self.mock_show_firewall_policy.assert_called_once_with( - exp_rule.firewall_policy_id) - - @helpers.create_mocks({neutronclient: ('update_firewall_rule',)}) - def test_rule_update(self): - rule = self.fw_rules.first() - rule_dict = self.api_fw_rules.first() - - rule.name = 'new name' - rule.description = 'new desc' - rule.protocol = 'icmp' - rule.action = 'deny' - rule.shared = True - rule.enabled = False - - rule_dict['name'] = 'new name' - rule_dict['description'] = 'new desc' - rule_dict['protocol'] = 'icmp' - rule_dict['action'] = 'deny' - rule_dict['shared'] = True - rule_dict['enabled'] = False - - form_data = {'name': rule.name, - 'description': rule.description, - 'protocol': rule.protocol, - 'action': rule.action, - 'shared': rule.shared, - 'enabled': rule.enabled - } - form_dict = {'firewall_rule': form_data} - ret_dict = {'firewall_rule': rule_dict} - - self.mock_update_firewall_rule.return_value = ret_dict - - ret_val = api_fwaas.rule_update(self.request, - rule.id, **form_data) - self.assertIsInstance(ret_val, api_fwaas.Rule) - self.assertEqual(rule.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_update_firewall_rule.assert_called_once_with(rule.id, - form_dict) - - @helpers.create_mocks({neutronclient: ('create_firewall_policy', )}) - def test_policy_create(self): - policy1 = self.fw_policies.first() - policy1_dict = self.api_fw_policies.first() - - form_data = {'name': policy1.name, - 'description': policy1.description, - 'firewall_rules': policy1.firewall_rules, - 'shared': policy1.shared, - 'audited': policy1.audited - } - form_dict = {'firewall_policy': form_data} - ret_dict = {'firewall_policy': policy1_dict} - - self.mock_create_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas.policy_create(self.request, **form_data) - self.assertIsInstance(ret_val, api_fwaas.Policy) - self.assertEqual(policy1.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_create_firewall_policy.assert_called_once_with(form_dict) - - def _assert_policy_return_value(self, ret_val, exp_policy): - self.assertIsInstance(ret_val, api_fwaas.Policy) - self.assertEqual(exp_policy.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertEqual(len(exp_policy.firewall_rules), len(ret_val.rules)) - self.assertEqual(len(exp_policy.firewall_rules), - len(ret_val.firewall_rules)) - for (r, exp_r) in zip(ret_val.rules, exp_policy.rules): - self.assertEqual(exp_r.id, r.id) - - @helpers.create_mocks({neutronclient: ('list_firewall_policies', - 'list_firewall_rules')}) - def test_policy_list(self): - exp_policies = self.fw_policies.list() - policies_dict = {'firewall_policies': self.api_fw_policies.list()} - rules_dict = {'firewall_rules': self.api_fw_rules.list()} - - self.mock_list_firewall_policies.return_value = policies_dict - self.mock_list_firewall_rules.return_value = rules_dict - - ret_val = api_fwaas.policy_list(self.request) - for (v, d) in zip(ret_val, exp_policies): - self._assert_policy_return_value(v, d) - self.mock_list_firewall_policies.assert_called_once_with() - self.mock_list_firewall_rules.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('list_firewall_policies', - 'list_firewall_rules')}) - def test_policy_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_policies = self.fw_policies.list() - policies_dict = {'firewall_policies': self.api_fw_policies.list()} - rules_dict = {'firewall_rules': self.api_fw_rules.list()} - - self.mock_list_firewall_policies.side_effect = [ - {'firewall_policies': []}, - policies_dict, - ] - self.mock_list_firewall_rules.return_value = rules_dict - - ret_val = api_fwaas.policy_list_for_tenant(self.request, tenant_id) - for (v, d) in zip(ret_val, exp_policies): - self._assert_policy_return_value(v, d) - self.assertEqual(2, self.mock_list_firewall_policies.call_count) - self.mock_list_firewall_policies.assert_has_calls([ - mock.call(tenant_id=tenant_id, shared=False), - mock.call(shared=True), - ]) - self.mock_list_firewall_rules.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('show_firewall_policy', - 'list_firewall_rules')}) - def test_policy_get(self): - exp_policy = self.fw_policies.first() - policy_dict = self.api_fw_policies.first() - # The first two rules are associated with the first policy. - api_rules = self.api_fw_rules.list()[:2] - - ret_dict = {'firewall_policy': policy_dict} - self.mock_show_firewall_policy.return_value = ret_dict - filters = {'firewall_policy_id': exp_policy.id} - ret_dict = {'firewall_rules': api_rules} - self.mock_list_firewall_rules.return_value = ret_dict - - ret_val = api_fwaas.policy_get(self.request, exp_policy.id) - self._assert_policy_return_value(ret_val, exp_policy) - self.mock_show_firewall_policy.assert_called_once_with(exp_policy.id) - self.mock_list_firewall_rules.assert_called_once_with(**filters) - - @helpers.create_mocks({neutronclient: ('show_firewall_policy',)}) - def test_policy_get_no_rule(self): - # 2nd policy is not associated with any rules. - exp_policy = self.fw_policies.list()[1] - policy_dict = self.api_fw_policies.list()[1] - - ret_dict = {'firewall_policy': policy_dict} - self.mock_show_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas.policy_get(self.request, exp_policy.id) - self.assertIsInstance(ret_val, api_fwaas.Policy) - self.assertEqual(exp_policy.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertFalse(len(ret_val.rules)) - self.mock_show_firewall_policy.assert_called_once_with(exp_policy.id) - - @helpers.create_mocks({neutronclient: ('update_firewall_policy',)}) - def test_policy_update(self): - policy = self.fw_policies.first() - policy_dict = self.api_fw_policies.first() - - policy.name = 'new name' - policy.description = 'new desc' - policy.shared = True - policy.audited = False - - policy_dict['name'] = 'new name' - policy_dict['description'] = 'new desc' - policy_dict['shared'] = True - policy_dict['audited'] = False - - form_data = {'name': policy.name, - 'description': policy.description, - 'shared': policy.shared, - 'audited': policy.audited - } - - form_dict = {'firewall_policy': form_data} - ret_dict = {'firewall_policy': policy_dict} - - self.mock_update_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas.policy_update(self.request, - policy.id, **form_data) - self.assertIsInstance(ret_val, api_fwaas.Policy) - self.assertEqual(policy.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_update_firewall_policy.assert_called_once_with( - policy.id, form_dict) - - @helpers.create_mocks({neutronclient: ('firewall_policy_insert_rule',)}) - def test_policy_insert_rule(self): - policy = self.fw_policies.first() - policy_dict = self.api_fw_policies.first() - - new_rule_id = 'h0881d38-c3eb-4fee-9763-12de3338041d' - policy.firewall_rules.append(new_rule_id) - policy_dict['firewall_rules'].append(new_rule_id) - - body = {'firewall_rule_id': new_rule_id, - 'insert_before': policy.firewall_rules[1], - 'insert_after': policy.firewall_rules[0]} - - self.mock_firewall_policy_insert_rule.return_value = policy_dict - - ret_val = api_fwaas.policy_insert_rule(self.request, - policy.id, **body) - self.assertIn(new_rule_id, ret_val.firewall_rules) - self.mock_firewall_policy_insert_rule.assert_called_once_with( - policy.id, body) - - @helpers.create_mocks({neutronclient: ('firewall_policy_remove_rule',)}) - def test_policy_remove_rule(self): - policy = self.fw_policies.first() - policy_dict = self.api_fw_policies.first() - - remove_rule_id = policy.firewall_rules[0] - policy_dict['firewall_rules'].remove(remove_rule_id) - - body = {'firewall_rule_id': remove_rule_id} - - self.mock_firewall_policy_remove_rule.return_value = policy_dict - - ret_val = api_fwaas.policy_remove_rule(self.request, - policy.id, **body) - self.assertNotIn(remove_rule_id, ret_val.firewall_rules) - self.mock_firewall_policy_remove_rule.assert_called_once_with( - policy.id, body) - - @helpers.create_mocks({neutronclient: ('create_firewall', )}) - def test_firewall_create(self): - firewall = self.firewalls.first() - firewall_dict = self.api_firewalls.first() - - form_data = {'name': firewall.name, - 'description': firewall.description, - 'firewall_policy_id': firewall.firewall_policy_id, - 'admin_state_up': firewall.admin_state_up - } - - form_dict = {'firewall': form_data} - ret_dict = {'firewall': firewall_dict} - self.mock_create_firewall.return_value = ret_dict - - ret_val = api_fwaas.firewall_create(self.request, **form_data) - self.assertIsInstance(ret_val, api_fwaas.Firewall) - self.assertEqual(firewall.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_create_firewall.assert_called_once_with(form_dict) - - def _assert_firewall_return_value(self, ret_val, exp_firewall): - self.assertIsInstance(ret_val, api_fwaas.Firewall) - self.assertEqual(exp_firewall.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertEqual(exp_firewall.firewall_policy_id, ret_val.policy.id) - self.assertEqual(exp_firewall.policy.name, ret_val.policy.name) - - # TODO(absubram) : Add API tests for firewall_create with routers, - # add router to firewall and remove router from fw. - - @helpers.create_mocks({neutronclient: ('list_firewalls', - 'list_firewall_policies'), - api_neutron: ('is_extension_supported', - 'router_list')}) - def test_firewall_list(self): - exp_firewalls = self.firewalls.list() - firewalls_dict = {'firewalls': self.api_firewalls.list()} - policies_dict = {'firewall_policies': self.api_fw_policies.list()} - - self.mock_list_firewalls.return_value = firewalls_dict - self.mock_list_firewall_policies.return_value = policies_dict - self.mock_is_extension_supported.return_value = True - self.mock_router_list.return_value = self.routers.list() - - ret_val = api_fwaas.firewall_list(self.request) - for (v, d) in zip(ret_val, exp_firewalls): - self._assert_firewall_return_value(v, d) - self.mock_list_firewalls.assert_called_once_with() - self.mock_list_firewall_policies.assert_called_once_with() - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_router_list.assert_called_once_with( - helpers.IsHttpRequest()) - - @helpers.create_mocks({neutronclient: ('list_firewalls', - 'list_firewall_policies'), - api_neutron: ('is_extension_supported', - 'router_list')}) - def test_firewall_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_firewalls = self.firewalls.list() - firewalls_dict = {'firewalls': self.api_firewalls.list()} - policies_dict = {'firewall_policies': self.api_fw_policies.list()} - - self.mock_list_firewalls.return_value = firewalls_dict - self.mock_list_firewall_policies.return_value = policies_dict - self.mock_is_extension_supported.return_value = True - self.mock_router_list.return_value = self.routers.list() - - ret_val = api_fwaas.firewall_list_for_tenant(self.request, tenant_id) - for (v, d) in zip(ret_val, exp_firewalls): - self._assert_firewall_return_value(v, d) - - self.mock_list_firewalls.assert_called_once_with(tenant_id=tenant_id) - self.mock_list_firewall_policies.assert_called_once_with() - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_router_list.assert_called_once_with( - helpers.IsHttpRequest(), tenant_id=self.request.user.project_id) - - @helpers.create_mocks({neutronclient: ('show_firewall', - 'show_firewall_policy'), - api_neutron: ('is_extension_supported', - 'router_list')}) - def test_firewall_get(self): - exp_firewall = self.firewalls.first() - ret_dict = {'firewall': self.api_firewalls.first()} - policy_dict = {'firewall_policy': self.api_fw_policies.first()} - - self.mock_show_firewall.return_value = ret_dict - self.mock_show_firewall_policy.return_value = policy_dict - self.mock_is_extension_supported.return_value = True - self.mock_router_list.return_value = exp_firewall.routers - - ret_val = api_fwaas.firewall_get(self.request, exp_firewall.id) - self._assert_firewall_return_value(ret_val, exp_firewall) - self.assertEqual(exp_firewall.router_ids, ret_val.router_ids) - self.assertEqual(exp_firewall.router_ids, - [r.id for r in ret_val.routers]) - self.assertEqual([r.name for r in exp_firewall.routers], - [r.name for r in ret_val.routers]) - self.mock_show_firewall.assert_called_once_with(exp_firewall.id) - self.mock_show_firewall_policy.assert_called_once_with( - exp_firewall.firewall_policy_id) - self.mock_is_extension_supported.assert_called_once_with( - helpers.IsHttpRequest(), 'fwaasrouterinsertion') - self.mock_router_list.assert_called_once_with( - helpers.IsHttpRequest(), id=exp_firewall.router_ids) - - @helpers.create_mocks({neutronclient: ('update_firewall',)}) - def test_firewall_update(self): - firewall = self.firewalls.first() - firewall_dict = self.api_firewalls.first() - - firewall.name = 'new name' - firewall.description = 'new desc' - firewall.admin_state_up = False - - firewall_dict['name'] = 'new name' - firewall_dict['description'] = 'new desc' - firewall_dict['admin_state_up'] = False - - form_data = {'name': firewall.name, - 'description': firewall.description, - 'admin_state_up': firewall.admin_state_up - } - - form_dict = {'firewall': form_data} - ret_dict = {'firewall': firewall_dict} - - self.mock_update_firewall.return_value = ret_dict - - ret_val = api_fwaas.firewall_update(self.request, - firewall.id, **form_data) - self.assertIsInstance(ret_val, api_fwaas.Firewall) - self.assertEqual(firewall.name, ret_val.name) - self.assertTrue(ret_val.id) - self.mock_update_firewall.assert_called_once_with(firewall.id, - form_dict) diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas_v2.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas_v2.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas_v2.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/api_tests/test_fwaas_v2.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,612 +0,0 @@ -# Copyright 2017, Juniper Networks. -# -# 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. - -import mock -from neutronclient.v2_0.client import Client as neutronclient - -from openstack_dashboard.test import helpers - -from neutron_fwaas_dashboard.api import fwaas_v2 as api_fwaas_v2 -from neutron_fwaas_dashboard.test import helpers as test - - -class FwaasV2ApiTests(test.APITestCase): - - use_mox = False - - @helpers.create_mocks({neutronclient: ('create_fwaas_firewall_rule',)}) - def test_rule_create(self): - rule1 = self.fw_rules_v2.first() - rule1_dict = self.api_fw_rules_v2.first() - form_data = {'name': rule1.name, - 'description': rule1.description, - 'protocol': rule1.protocol, - 'action': rule1.action, - 'source_ip_address': rule1.source_ip_address, - 'source_port': rule1.source_port, - 'destination_ip_address': rule1.destination_ip_address, - 'destination_port': rule1.destination_port, - 'shared': rule1.shared, - 'enabled': rule1.enabled - } - form_dict = {'firewall_rule': form_data} - ret_dict = {'firewall_rule': rule1_dict} - self.mock_create_fwaas_firewall_rule.return_value = ret_dict - - ret_val = api_fwaas_v2.rule_create(self.request, **form_data) - self._assert_rule_return_value(ret_val, rule1) - - self.mock_create_fwaas_firewall_rule.assert_called_once_with(form_dict) - - def _assert_rule_return_value(self, ret_val, exp_rule): - self.assertIsInstance(ret_val, api_fwaas_v2.Rule) - self.assertEqual(exp_rule.name, ret_val.name) - self.assertTrue(ret_val.id) - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_rules',)}) - def test_rule_list(self): - exp_rules = self.fw_rules_v2.list() - api_rules = {'firewall_rules': self.api_fw_rules_v2.list()} - - self.mock_list_fwaas_firewall_rules.return_value = api_rules - - ret_val = api_fwaas_v2.rule_list(self.request) - for (v, d) in zip(ret_val, exp_rules): - self._assert_rule_return_value(v, d) - self.mock_list_fwaas_firewall_rules.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_rules',)}) - def test_rule_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_rules = self.fw_rules_v2.list() - api_rules = {'firewall_rules': self.api_fw_rules_v2.list()} - - self.mock_list_fwaas_firewall_rules.side_effect = [ - {'firewall_rules': []}, - api_rules, - ] - - ret_val = api_fwaas_v2.rule_list_for_tenant(self.request, tenant_id) - for (v, d) in zip(ret_val, exp_rules): - self._assert_rule_return_value(v, d) - - self.assertEqual(2, self.mock_list_fwaas_firewall_rules.call_count) - self.mock_list_fwaas_firewall_rules.assert_has_calls([ - mock.call(tenant_id=tenant_id, shared=False), - mock.call(shared=True), - ]) - - @helpers.create_mocks({neutronclient: ('show_fwaas_firewall_rule',)}) - def test_rule_get(self): - exp_rule = self.fw_rules_v2.first() - ret_dict = {'firewall_rule': self.api_fw_rules_v2.first()} - - self.mock_show_fwaas_firewall_rule.return_value = ret_dict - - ret_val = api_fwaas_v2.rule_get(self.request, exp_rule.id) - self._assert_rule_return_value(ret_val, exp_rule) - - self.mock_show_fwaas_firewall_rule.assert_called_once_with(exp_rule.id) - - @helpers.create_mocks({neutronclient: ('update_fwaas_firewall_rule',)}) - def test_rule_update(self): - rule = self.fw_rules_v2.first() - rule_dict = self.api_fw_rules_v2.first() - - rule.name = 'new name' - rule.description = 'new desc' - rule.protocol = 'icmp' - rule.action = 'deny' - rule.shared = True - rule.enabled = False - - rule_dict['name'] = 'new name' - rule_dict['description'] = 'new desc' - rule_dict['protocol'] = 'icmp' - rule_dict['action'] = 'deny' - rule_dict['shared'] = True - rule_dict['enabled'] = False - - form_data = {'name': rule.name, - 'description': rule.description, - 'protocol': rule.protocol, - 'action': rule.action, - 'shared': rule.shared, - 'enabled': rule.enabled - } - form_dict = {'firewall_rule': form_data} - ret_dict = {'firewall_rule': rule_dict} - - self.mock_update_fwaas_firewall_rule.return_value = ret_dict - - ret_val = api_fwaas_v2.rule_update(self.request, - rule.id, **form_data) - self._assert_rule_return_value(ret_val, rule) - - self.mock_update_fwaas_firewall_rule.assert_called_once_with( - rule.id, form_dict) - - @helpers.create_mocks({neutronclient: ('create_fwaas_firewall_policy', )}) - def test_policy_create(self): - policy1 = self.fw_policies_v2.first() - policy1_dict = self.api_fw_policies_v2.first() - - form_data = {'name': policy1.name, - 'description': policy1.description, - 'firewall_rules': policy1.firewall_rules, - 'shared': policy1.shared, - 'audited': policy1.audited - } - form_dict = {'firewall_policy': form_data} - ret_dict = {'firewall_policy': policy1_dict} - - self.mock_create_fwaas_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas_v2.policy_create(self.request, **form_data) - self.assertIsInstance(ret_val, api_fwaas_v2.Policy) - self.assertEqual(policy1.name, ret_val.name) - self.assertTrue(ret_val.id) - - self.mock_create_fwaas_firewall_policy.assert_called_once_with( - form_dict) - - def _assert_policy_return_value(self, ret_val, exp_policy): - self.assertIsInstance(ret_val, api_fwaas_v2.Policy) - self.assertEqual(exp_policy.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertEqual(len(exp_policy.firewall_rules), len(ret_val.rules)) - self.assertEqual(len(exp_policy.firewall_rules), - len(ret_val.firewall_rules)) - for (r, exp_r) in zip(ret_val.rules, exp_policy.rules): - self.assertEqual(exp_r.id, r.id) - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_policies', - 'list_fwaas_firewall_rules')}) - def test_policy_list(self): - exp_policies = self.fw_policies_v2.list() - policies_dict = {'firewall_policies': self.api_fw_policies_v2.list()} - rules_dict = {'firewall_rules': self.api_fw_rules_v2.list()} - - self.mock_list_fwaas_firewall_policies.return_value = policies_dict - self.mock_list_fwaas_firewall_rules.return_value = rules_dict - - ret_val = api_fwaas_v2.policy_list(self.request) - for (v, d) in zip(ret_val, exp_policies): - self._assert_policy_return_value(v, d) - - self.mock_list_fwaas_firewall_policies.assert_called_once_with() - self.mock_list_fwaas_firewall_rules.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_policies', - 'list_fwaas_firewall_rules')}) - def test_policy_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_policies = self.fw_policies_v2.list() - policies_dict = {'firewall_policies': self.api_fw_policies_v2.list()} - rules_dict = {'firewall_rules': self.api_fw_rules_v2.list()} - - self.mock_list_fwaas_firewall_policies.side_effect = [ - {'firewall_policies': []}, - policies_dict, - ] - self.mock_list_fwaas_firewall_rules.return_value = rules_dict - - ret_val = api_fwaas_v2.policy_list_for_tenant(self.request, tenant_id) - for (v, d) in zip(ret_val, exp_policies): - self._assert_policy_return_value(v, d) - - self.assertEqual(2, self.mock_list_fwaas_firewall_policies.call_count) - self.mock_list_fwaas_firewall_policies.assert_has_calls([ - mock.call(tenant_id=tenant_id, shared=False), - mock.call(shared=True), - ]) - self.mock_list_fwaas_firewall_rules.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('show_fwaas_firewall_policy', - 'list_fwaas_firewall_rules')}) - def test_policy_get(self): - exp_policy = self.fw_policies_v2.first() - policy_dict = self.api_fw_policies_v2.first() - # The first two rules are associated with the first policy. - api_rules = self.api_fw_rules_v2.list()[:2] - - ret_dict = {'firewall_policy': policy_dict} - self.mock_show_fwaas_firewall_policy.return_value = ret_dict - filters = {'firewall_policy_id': exp_policy.id} - ret_dict = {'firewall_rules': api_rules} - - self.mock_list_fwaas_firewall_rules.return_value = ret_dict - - ret_val = api_fwaas_v2.policy_get(self.request, exp_policy.id) - self._assert_policy_return_value(ret_val, exp_policy) - - self.mock_show_fwaas_firewall_policy.assert_called_once_with( - exp_policy.id) - self.mock_list_fwaas_firewall_rules.assert_called_once_with(**filters) - - @helpers.create_mocks({neutronclient: ('show_fwaas_firewall_policy',)}) - def test_policy_get_no_rule(self): - # 2nd policy is not associated with any rules. - exp_policy = self.fw_policies_v2.list()[1] - policy_dict = self.api_fw_policies_v2.list()[1] - - ret_dict = {'firewall_policy': policy_dict} - self.mock_show_fwaas_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas_v2.policy_get(self.request, exp_policy.id) - self.assertIsInstance(ret_val, api_fwaas_v2.Policy) - self.assertEqual(exp_policy.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertFalse(len(ret_val.rules)) - - self.mock_show_fwaas_firewall_policy.assert_called_once_with( - exp_policy.id) - - @helpers.create_mocks({neutronclient: ('update_fwaas_firewall_policy',)}) - def test_policy_update(self): - policy = self.fw_policies_v2.first() - policy_dict = self.api_fw_policies_v2.first() - - policy.name = 'new name' - policy.description = 'new desc' - policy.shared = True - policy.audited = False - - policy_dict['name'] = 'new name' - policy_dict['description'] = 'new desc' - policy_dict['shared'] = True - policy_dict['audited'] = False - - form_data = {'name': policy.name, - 'description': policy.description, - 'shared': policy.shared, - 'audited': policy.audited - } - - form_dict = {'firewall_policy': form_data} - ret_dict = {'firewall_policy': policy_dict} - - self.mock_update_fwaas_firewall_policy.return_value = ret_dict - - ret_val = api_fwaas_v2.policy_update(self.request, - policy.id, **form_data) - self.assertIsInstance(ret_val, api_fwaas_v2.Policy) - self.assertEqual(policy.name, ret_val.name) - self.assertTrue(ret_val.id) - - self.mock_update_fwaas_firewall_policy.assert_called_once_with( - policy.id, form_dict) - - @helpers.create_mocks( - {neutronclient: ('insert_rule_fwaas_firewall_policy',)}) - def test_policy_insert_rule(self): - policy = self.fw_policies_v2.first() - policy_dict = self.api_fw_policies_v2.first() - - new_rule_id = 'h0881d38-c3eb-4fee-9763-12de3338041d' - policy.firewall_rules.append(new_rule_id) - policy_dict['firewall_rules'].append(new_rule_id) - - body = {'firewall_rule_id': new_rule_id, - 'insert_before': policy.firewall_rules[1], - 'insert_after': policy.firewall_rules[0]} - - self.mock_insert_rule_fwaas_firewall_policy.return_value = policy_dict - - ret_val = api_fwaas_v2.policy_insert_rule(self.request, - policy.id, **body) - self.assertIn(new_rule_id, ret_val.firewall_rules) - self.mock_insert_rule_fwaas_firewall_policy.assert_called_once_with( - policy.id, body) - - @helpers.create_mocks( - {neutronclient: ('remove_rule_fwaas_firewall_policy',)}) - def test_policy_remove_rule(self): - policy = self.fw_policies_v2.first() - policy_dict = self.api_fw_policies_v2.first() - - remove_rule_id = policy.firewall_rules[0] - policy_dict['firewall_rules'].remove(remove_rule_id) - - body = {'firewall_rule_id': remove_rule_id} - - self.mock_remove_rule_fwaas_firewall_policy.return_value = policy_dict - - ret_val = api_fwaas_v2.policy_remove_rule(self.request, - policy.id, **body) - self.assertNotIn(remove_rule_id, ret_val.firewall_rules) - self.mock_remove_rule_fwaas_firewall_policy.assert_called_once_with( - policy.id, body) - - @helpers.create_mocks({neutronclient: ('create_fwaas_firewall_group', )}) - def test_firewall_group_create(self): - firewall_group = self.firewall_groups_v2.first() - firewall_group_dict = self.api_firewall_groups_v2.first() - - form_data = { - 'name': firewall_group.name, - 'description': firewall_group.description, - 'ingress_firewall_policy_id': - firewall_group.ingress_firewall_policy_id, - 'egress_firewall_policy_id': - firewall_group.egress_firewall_policy_id, - 'admin_state_up': firewall_group.admin_state_up - } - - form_dict = {'firewall_group': form_data} - ret_dict = {'firewall_group': firewall_group_dict} - self.mock_create_fwaas_firewall_group.return_value = ret_dict - - ret_val = api_fwaas_v2.firewall_group_create(self.request, **form_data) - self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) - self.assertEqual(firewall_group.name, ret_val.name) - self.assertEqual(firewall_group.id, ret_val.id) - - self.mock_create_fwaas_firewall_group.assert_called_once_with( - form_dict) - - def _assert_firewall_return_value(self, ret_val, exp_firewall, - expand_policy=True): - self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) - self.assertEqual(exp_firewall.name, ret_val.name) - self.assertTrue(ret_val.id) - self.assertEqual(exp_firewall.ingress_firewall_policy_id, - ret_val.ingress_firewall_policy_id) - if expand_policy: - if exp_firewall.ingress_firewall_policy_id: - self.assertEqual(exp_firewall.ingress_firewall_policy_id, - ret_val.ingress_policy.id) - self.assertEqual(exp_firewall.ingress_policy.name, - ret_val.ingress_policy.name) - else: - self.assertIsNone(ret_val.ingress_policy) - if exp_firewall.egress_firewall_policy_id: - self.assertEqual(exp_firewall.egress_firewall_policy_id, - ret_val.egress_policy.id) - self.assertEqual(exp_firewall.egress_policy.name, - ret_val.egress_policy.name) - else: - self.assertIsNone(ret_val.egress_policy) - - # TODO(Sarath Mekala) : Add API tests for firewall_group_create with ports, - # add port to firewall and remove port from fw. - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_groups', - 'list_fwaas_firewall_policies')}) - def test_firewall_list(self): - exp_firewalls = self.firewall_groups_v2.list() - firewalls_dict = { - 'firewall_groups': self.api_firewall_groups_v2.list()} - - self.mock_list_fwaas_firewall_groups.return_value = firewalls_dict - - ret_val = api_fwaas_v2.firewall_list(self.request) - for (v, d) in zip(ret_val, exp_firewalls): - self._assert_firewall_return_value(v, d, expand_policy=False) - self.mock_list_fwaas_firewall_groups.assert_called_once_with() - - @helpers.create_mocks({neutronclient: ('list_fwaas_firewall_groups', - 'list_fwaas_firewall_policies')}) - def test_firewall_list_for_tenant(self): - tenant_id = self.request.user.project_id - exp_firewalls = self.firewall_groups_v2.list() - firewalls_dict = { - 'firewall_groups': self.api_firewall_groups_v2.list()} - - self.mock_list_fwaas_firewall_groups.side_effect = [ - firewalls_dict, - firewalls_dict, - ] - - ret_val = api_fwaas_v2.firewall_list_for_tenant( - self.request, tenant_id) - for (v, d) in zip(ret_val, exp_firewalls): - self._assert_firewall_return_value(v, d, expand_policy=False) - - self.assertEqual(2, self.mock_list_fwaas_firewall_groups.call_count) - self.mock_list_fwaas_firewall_groups.assert_has_calls([ - mock.call(shared=False, tenant_id=tenant_id), - mock.call(shared=True), - ]) - - @helpers.create_mocks({neutronclient: ('list_ports', - 'list_fwaas_firewall_groups')}) - def test_fwg_port_list_for_tenant(self): - tenant_id = self.request.user.project_id - router_port = { - 'id': 'id-1', - 'name': 'port-1', - 'device_owner': 'network:router_interface' - } - vm_port1 = { - 'id': 'id-vm_port-1', - 'name': 'port-2', - 'device_owner': 'compute:nova' - } - vm_port2 = { - 'id': 'id-vm_port-2', - 'name': 'port-2', - 'device_owner': 'compute:nova' - } - gateway_port = { - 'id': 'id-3', - 'name': 'port-3', - 'device_owner': 'network:router_gateway' - } - dhcp_port = { - 'id': 'id-4', - 'name': 'port-4', - 'device_owner': 'network:dhcp' - } - dummy_ports = {'ports': [ - router_port, - vm_port1, - vm_port2, - gateway_port, - dhcp_port, - ]} - - self.mock_list_ports.return_value = dummy_ports - self.mock_list_fwaas_firewall_groups.return_value = \ - {'firewall_groups': []} - - ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) - self.assertEqual(router_port['id'], ports[0]['id']) - self.assertEqual(vm_port1['id'], ports[1]['id']) - self.assertEqual(vm_port2['id'], ports[2]['id']) - - self.mock_list_ports.assert_called_once_with(tenant_id=tenant_id) - self.mock_list_fwaas_firewall_groups.assert_called_once_with( - tenant_id=tenant_id) - - @helpers.create_mocks({neutronclient: ('list_ports', - 'list_fwaas_firewall_groups')}) - def test_fwg_port_list_for_tenant_with_used_port(self): - tenant_id = self.request.user.project_id - router_port = { - 'id': 'id-1', - 'name': 'port-1', - 'device_owner': 'network:router_interface' - } - vm_port1 = { - 'id': 'id-vm_port-1', - 'name': 'port-2', - 'device_owner': 'compute:nova' - } - gateway_port = { - 'id': 'id-3', - 'name': 'port-3', - 'device_owner': 'network:router_gateway' - } - dhcp_port = { - 'id': 'id-4', - 'name': 'port-4', - 'device_owner': 'network:dhcp' - } - dummy_ports = {'ports': [ - router_port, - vm_port1, - gateway_port, - dhcp_port, - ]} - - used_ports = {'firewall_groups': [{'ports': [router_port['id']]}]} - - self.mock_list_ports.return_value = dummy_ports - self.mock_list_fwaas_firewall_groups.return_value = used_ports - - ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) - self.assertEqual(vm_port1['id'], ports[0]['id']) - - self.mock_list_ports.assert_called_once_with(tenant_id=tenant_id) - self.mock_list_fwaas_firewall_groups.assert_called_once_with( - tenant_id=tenant_id) - - @helpers.create_mocks({neutronclient: ('list_ports', - 'list_fwaas_firewall_groups')}) - def test_fwg_port_list_for_tenant_no_match(self): - tenant_id = self.request.user.project_id - dummy_ports = {'ports': [ - {'name': 'port-3', 'device_owner': 'network:router_gateway'}, - {'name': 'port-4', 'device_owner': 'network:dhcp'}, - ]} - - self.mock_list_ports.return_value = dummy_ports - self.mock_list_fwaas_firewall_groups.return_value = \ - {'firewall_groups': []} - - ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) - self.assertEqual([], ports) - - self.mock_list_ports.assert_called_once_with(tenant_id=tenant_id) - self.mock_list_fwaas_firewall_groups.assert_called_once_with( - tenant_id=tenant_id) - - @helpers.create_mocks({neutronclient: ('list_ports', - 'list_fwaas_firewall_groups')}) - def test_fwg_port_list_for_tenant_no_ports(self): - tenant_id = self.request.user.project_id - self.mock_list_ports.return_value = {'ports': []} - self.mock_list_fwaas_firewall_groups.return_value = \ - {'firewall_groups': []} - - ports = api_fwaas_v2.fwg_port_list_for_tenant(self.request, tenant_id) - self.assertEqual([], ports) - - self.mock_list_ports.assert_called_once_with(tenant_id=tenant_id) - self.mock_list_fwaas_firewall_groups.assert_called_once_with( - tenant_id=tenant_id) - - @helpers.create_mocks({neutronclient: ('show_fwaas_firewall_group', - 'show_fwaas_firewall_policy')}) - def test_firewall_get(self): - exp_firewall = self.firewall_groups_v2.first() - ret_dict = {'firewall_group': self.api_firewall_groups_v2.first()} - - ingress_policy_id = exp_firewall.ingress_firewall_policy_id - ingress_policy = [p for p in self.api_fw_policies_v2.list() - if p['id'] == ingress_policy_id][0] - - egress_policy_id = exp_firewall.egress_firewall_policy_id - egress_policy = [p for p in self.api_fw_policies_v2.list() - if p['id'] == egress_policy_id][0] - - self.mock_show_fwaas_firewall_group.return_value = ret_dict - self.mock_show_fwaas_firewall_policy.side_effect = [ - {'firewall_policy': ingress_policy}, - {'firewall_policy': egress_policy} - ] - - ret_val = api_fwaas_v2.firewall_get(self.request, exp_firewall.id) - self._assert_firewall_return_value(ret_val, exp_firewall) - - self.mock_show_fwaas_firewall_group.assert_called_once_with( - exp_firewall.id) - self.assertEqual(2, self.mock_show_fwaas_firewall_policy.call_count) - self.mock_show_fwaas_firewall_policy.assert_has_calls([ - mock.call(ingress_policy_id), - mock.call(egress_policy_id), - ]) - - @helpers.create_mocks({neutronclient: ('update_fwaas_firewall_group',)}) - def test_firewall_update(self): - firewall = self.firewall_groups_v2.first() - firewall_dict = self.api_firewall_groups_v2.first() - - firewall.name = 'new name' - firewall.description = 'new desc' - firewall.admin_state_up = False - - firewall_dict['name'] = 'new name' - firewall_dict['description'] = 'new desc' - firewall_dict['admin_state_up'] = False - - form_data = {'name': firewall.name, - 'description': firewall.description, - 'admin_state_up': firewall.admin_state_up - } - - form_dict = {'firewall_group': form_data} - ret_dict = {'firewall_group': firewall_dict} - - self.mock_update_fwaas_firewall_group.return_value = ret_dict - - ret_val = api_fwaas_v2.firewall_update(self.request, - firewall.id, **form_data) - self.assertIsInstance(ret_val, api_fwaas_v2.FirewallGroup) - self.assertEqual(firewall.name, ret_val.name) - self.assertTrue(ret_val.id) - - self.mock_update_fwaas_firewall_group.assert_called_once_with( - firewall.id, form_dict) diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/helpers.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/helpers.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/helpers.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/helpers.py 2018-02-22 06:27:32.000000000 +0000 @@ -15,6 +15,9 @@ from neutron_fwaas_dashboard.test.test_data import utils +create_stubs = helpers.create_stubs + + class TestDataLoaderMixin(object): def _setup_test_data(self): super(TestDataLoaderMixin, self)._setup_test_data() diff -Nru neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/settings.py neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/settings.py --- neutron-fwaas-dashboard-1.5.0/neutron_fwaas_dashboard/test/settings.py 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/neutron_fwaas_dashboard/test/settings.py 2018-02-22 06:27:32.000000000 +0000 @@ -14,17 +14,17 @@ from horizon.test.settings import * # noqa from openstack_dashboard.test.settings import * # noqa -import openstack_dashboard.enabled -from openstack_dashboard.utils import settings - -import neutron_fwaas_dashboard.enabled - # pop these keys to avoid log warnings about deprecation # update_dashboards will populate them anyway HORIZON_CONFIG.pop('dashboards', None) HORIZON_CONFIG.pop('default_dashboard', None) # Update the dashboards with neutron_fwaas_dashboard +import openstack_dashboard.enabled +from openstack_dashboard.utils import settings + +import neutron_fwaas_dashboard.enabled + settings.update_dashboards( [ openstack_dashboard.enabled, diff -Nru neutron-fwaas-dashboard-1.5.0/README.rst neutron-fwaas-dashboard-1.3.0/README.rst --- neutron-fwaas-dashboard-1.5.0/README.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/README.rst 2018-02-22 06:27:32.000000000 +0000 @@ -7,4 +7,3 @@ * Documentation: https://docs.openstack.org/neutron-fwaas-dashboard/latest/ * Source: http://git.openstack.org/cgit/openstack/neutron-fwaas-dashboard * Bugs: http://bugs.launchpad.net/neutron-fwaas-dashboard -* Release Notes: https://docs.openstack.org/releasenotes/neutron-fwaas-dashboard/ diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/index.rst neutron-fwaas-dashboard-1.3.0/releasenotes/source/index.rst --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/index.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/index.rst 2018-02-22 06:27:32.000000000 +0000 @@ -6,5 +6,4 @@ :maxdepth: 1 unreleased - queens pike diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/cs/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/cs/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/cs/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/cs/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# Lenka Husáková , 2016. #zanata -# Zbyněk Schwarz , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-28 19:29+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-11-17 09:06+0000\n" -"Last-Translator: Zbyněk Schwarz \n" -"Language-Team: Czech\n" -"Language: cs\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" - -msgid "Bug Fixes" -msgstr "Opravy chyb" - -msgid "Current Series Release Notes" -msgstr "Poznámky k vydání současné verze" - -msgid "Pike Series Release Notes" -msgstr "Poznámky k vydání verze Pike" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/de/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/de/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/de/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/de/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -# Frank Kloeker , 2017. #zanata -# Robert Simai , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-28 19:29+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-11-17 09:16+0000\n" -"Last-Translator: Robert Simai \n" -"Language-Team: German\n" -"Language: de\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "Bug Fixes" -msgstr "Fehlerkorrekturen" - -msgid "Current Series Release Notes" -msgstr "Aktuelle Serie Releasenotes" - -msgid "New Features" -msgstr "Neue Funktionen" - -msgid "Pike Series Release Notes" -msgstr "Pike Serie Release Notes" - -msgid "Prelude" -msgstr "Einleitung" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -# Andi Chandler , 2017. #zanata -# Andi Chandler , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-22 06:54+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-01-26 04:48+0000\n" -"Last-Translator: Andi Chandler \n" -"Language-Team: English (United Kingdom)\n" -"Language: en_GB\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -msgid "" -"\"Add Router\" and \"Remove Router\" operations are now controlled by " -"``update_firewall`` rule in the policy.json file. Previously they were " -"controlled by ``get_firewall`` rule and non-existing rules like " -"``add_router`` and ``remove_router``. If operators define their custom " -"policy rules for ``add_router`` and ``remove_router``, such policy rules " -"need to updated accordingly. [`bug 1703952 `__]" -msgstr "" -"\"Add Router\" and \"Remove Router\" operations are now controlled by " -"``update_firewall`` rule in the policy.json file. Previously they were " -"controlled by ``get_firewall`` rule and non-existing rules like " -"``add_router`` and ``remove_router``. If operators define their custom " -"policy rules for ``add_router`` and ``remove_router``, such policy rules " -"need to updated accordingly. [`bug 1703952 `__]" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "1.1.0" -msgstr "1.1.0" - -msgid "" -"A panel for FWaaS v2 is newly added. There is no specific installation " -"process. After installing the new release of neutron-fwaas-dashboard, if " -"FWaaS v2 API is available on your neutron deployment, the panel for FWaaS v2 " -"will be displayed." -msgstr "" -"A panel for FWaaS v2 is newly added. There is no specific installation " -"process. After installing the new release of neutron-fwaas-dashboard, if " -"FWaaS v2 API is available on your Neutron deployment, the panel for FWaaS v2 " -"will be displayed." - -msgid "Bug Fixes" -msgstr "Bug Fixes" - -msgid "Current Series Release Notes" -msgstr "Current Series Release Notes" - -msgid "" -"Handling a shared rule or policy is now controlled by the policy mechanism. " -"Only admin users (by default) can set ``shared`` attribute when creating or " -"updating a firewall rule or policy. The checkbox on ``shared`` attribute is " -"now disabled if a user has no sufficient permission. [`bug 1699717 `__]" -msgstr "" -"Handling a shared rule or policy is now controlled by the policy mechanism. " -"Only admin users (by default) can set ``shared`` attribute when creating or " -"updating a firewall rule or policy. The checkbox on ``shared`` attribute is " -"now disabled if a user has no sufficient permission. [`bug 1699717 `__]" - -msgid "Neutron FWaaS Dashboard Release Notes" -msgstr "Neutron FWaaS Dashboard Release Notes" - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate package ``neutron-fwaas-dashboard``. You need to install ``neutron-" -"fwaas-dashboard`` after upgrading the OpenStack Dashboard to Pike release " -"and add ``enabled`` file for Neutron FWaaS dashboard. For detail " -"information, see https://docs.openstack.org/neutron-fwaas-dashboard/latest/." -msgstr "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate package ``neutron-fwaas-dashboard``. You need to install ``neutron-" -"fwaas-dashboard`` after upgrading the OpenStack Dashboard to Pike release " -"and add ``enabled`` file for Neutron FWaaS dashboard. For detail " -"information, see https://docs.openstack.org/neutron-fwaas-dashboard/latest/." - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate python package." -msgstr "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate python package." - -msgid "New Features" -msgstr "New Features" - -msgid "Pike Series Release Notes" -msgstr "Pike Series Release Notes" - -msgid "Prelude" -msgstr "Prelude" - -msgid "Queens Series Release Notes" -msgstr "Queens Series Release Notes" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/es/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/es/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/es/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/es/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# Jose Porrua , 2016. #zanata -# Eduardo Gonzalez Gutierrez , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-28 19:29+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-09-27 03:49+0000\n" -"Last-Translator: Eduardo Gonzalez Gutierrez \n" -"Language-Team: Spanish\n" -"Language: es\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -msgid "Bug Fixes" -msgstr "Corrección de errores" - -msgid "Current Series Release Notes" -msgstr "Notas de la versión actual" - -msgid "New Features" -msgstr "Nuevas Funcionalidades" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/fr/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/fr/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/fr/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/fr/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -# Gérald LONLAS , 2016. #zanata -# Gaelle , 2017. #zanata -# Loic Nicolle , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-28 19:29+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-11-14 07:50+0000\n" -"Last-Translator: Gaelle \n" -"Language-Team: French\n" -"Language: fr\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "Bug Fixes" -msgstr "Corrections de bugs" - -msgid "Current Series Release Notes" -msgstr "Notes sur la Release Actuelle" - -msgid "New Features" -msgstr "Nouvelles fonctionnalités" - -msgid "Pike Series Release Notes" -msgstr "Note de release pour Pike" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/id/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/id/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/id/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/id/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -# suhartono , 2017. #zanata -# suhartono , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: neutron-fwaas-dashboard\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-10 14:05+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-05-10 01:48+0000\n" -"Last-Translator: suhartono \n" -"Language-Team: Indonesian\n" -"Language: id\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=1; plural=0\n" - -msgid "" -"\"Add Router\" and \"Remove Router\" operations are now controlled by " -"``update_firewall`` rule in the policy.json file. Previously they were " -"controlled by ``get_firewall`` rule and non-existing rules like " -"``add_router`` and ``remove_router``. If operators define their custom " -"policy rules for ``add_router`` and ``remove_router``, such policy rules " -"need to updated accordingly. [`bug 1703952 `__]" -msgstr "" -"Operasi \"Add Router\" dan \"Remove Router\" sekarang dikendalikan oleh " -"aturan ``update_firewall`` dalam file policy.json. Sebelumnya mereka " -"dikontrol oleh aturan ``get_firewall`` dan aturan non-existing seperti " -"``add_router`` dan ``remove_router``. Jika operator menentukan aturan " -"kebijakan kustom mereka untuk ``add_router`` dan ``remove_router``, aturan " -"kebijakan tersebut perlu diperbarui sesuai. [`bug 1703952 ` __]" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "1.1.0" -msgstr "1.1.0" - -msgid "" -"A panel for FWaaS v2 is newly added. There is no specific installation " -"process. After installing the new release of neutron-fwaas-dashboard, if " -"FWaaS v2 API is available on your neutron deployment, the panel for FWaaS v2 " -"will be displayed." -msgstr "" -"Panel untuk FWaaS v2 baru ditambahkan. Tidak ada proses instalasi khusus. " -"Setelah menginstal rilis baru neutron-fwaas-dashboard, dan jika FWaaS v2 API " -"tersedia pada penyebaran neutron Anda, maka panel untuk FWaaS v2 akan " -"ditampilkan." - -msgid "Bug Fixes" -msgstr "Perbaikan bug" - -msgid "Current Series Release Notes" -msgstr "Catatan rilis seri saat ini" - -msgid "" -"Handling a shared rule or policy is now controlled by the policy mechanism. " -"Only admin users (by default) can set ``shared`` attribute when creating or " -"updating a firewall rule or policy. The checkbox on ``shared`` attribute is " -"now disabled if a user has no sufficient permission. [`bug 1699717 `__]" -msgstr "" -"Menangani aturan atau kebijakan bersama sekarang dikendalikan oleh mekanisme " -"kebijakan. Hanya pengguna admin (secara default) yang dapat mengatur atribut " -"``shared`` saat membuat atau memperbarui aturan atau kebijakan firewall. " -"Kotak centang pada atribut ``shared`` sekarang dinonaktifkan jika pengguna " -"tidak memiliki izin yang memadai. [`bug 1699717 ` __]" - -msgid "Neutron FWaaS Dashboard Release Notes" -msgstr "Catatan Rilis Dashboard FWaaS Neutron" - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate package ``neutron-fwaas-dashboard``. You need to install ``neutron-" -"fwaas-dashboard`` after upgrading the OpenStack Dashboard to Pike release " -"and add ``enabled`` file for Neutron FWaaS dashboard. For detail " -"information, see https://docs.openstack.org/neutron-fwaas-dashboard/latest/." -msgstr "" -"Dukungan Neutron FWaaS di Dasbor OpenStack kini dipisah menjadi paket " -"terpisah ``neutron-fwaas-dashboard``. Anda perlu menginstal ``neutron-fwaas-" -"dashboard`` setelah memutakhirkan OpenStack Dashboard ke rilis Pike dan " -"menambahkan ``enabled`` file untuk dasbor Neutron FWaaS. Untuk informasi " -"detail, lihat https://docs.openstack.org/neutron-fwaas-dashboard/latest/." - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate python package." -msgstr "" -"Dukungan Neutron FWaaS di Dasbor OpenStack kini dipisah menjadi paket python " -"terpisah." - -msgid "New Features" -msgstr "Fitur baru" - -msgid "Pike Series Release Notes" -msgstr "Catatan Rilis Seri Pike" - -msgid "Prelude" -msgstr "Prelude" - -msgid "Queens Series Release Notes" -msgstr "Catatan Rilis Seri Queens" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ja/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ja/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ja/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ja/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -# Akihiro Motoki , 2017. #zanata -# Hidekazu Nakamura , 2017. #zanata -# Yuko Fukuda , 2017. #zanata -# Akihiro Motoki , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-07 04:59+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-02-06 09:35+0000\n" -"Last-Translator: Akihiro Motoki \n" -"Language-Team: Japanese\n" -"Language: ja\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=1; plural=0\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "1.1.0" -msgstr "1.1.0" - -msgid "" -"A panel for FWaaS v2 is newly added. There is no specific installation " -"process. After installing the new release of neutron-fwaas-dashboard, if " -"FWaaS v2 API is available on your neutron deployment, the panel for FWaaS v2 " -"will be displayed." -msgstr "" -"FWaaS v2 用のパネルが新たに追加されました。 neutron-fwaas-dashboard の新リ" -"リースをインストールすると、お使いの環境の neutron で FWaaS v2 API が利用可能" -"であれば、 FWaaS v2 用のパネルが表示されます、" - -msgid "Bug Fixes" -msgstr "バグ修正" - -msgid "Current Series Release Notes" -msgstr "開発中バージョンのリリースノート" - -msgid "Neutron FWaaS Dashboard Release Notes" -msgstr "Neutron FWaaS Dashboard リリースノート" - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate package ``neutron-fwaas-dashboard``. You need to install ``neutron-" -"fwaas-dashboard`` after upgrading the OpenStack Dashboard to Pike release " -"and add ``enabled`` file for Neutron FWaaS dashboard. For detail " -"information, see https://docs.openstack.org/neutron-fwaas-dashboard/latest/." -msgstr "" -"OpenStack Dashboard の Neutron FWaaS 対応は、別のパッケージ ``neutron-fwaas-" -"dashboard`` として分離されました。 OpenStack Dashboard を Pike リリースにアッ" -"プグレードした後で、 ``neutron-fwaas-dashboard`` をインストールし、 Neutron " -"FWaaS ダッシュボード用の ``enabled`` ファイルを追加する必要があります。詳しく" -"は https://docs.openstack.org/neutron-fwaas-dashboard/latest/ を参照してくだ" -"さい。" - -msgid "" -"Neutron FWaaS support in the OpenStack Dashboard is now split out into a " -"separate python package." -msgstr "" -"OpenStack Dashboard の Neutron FWaaS 対応は、別の Python パッケージに分離され" -"ました。" - -msgid "New Features" -msgstr "新機能" - -msgid "Pike Series Release Notes" -msgstr "Pike バージョンのリリースノート" - -msgid "Prelude" -msgstr "前置" - -msgid "Queens Series Release Notes" -msgstr "Queens バージョンのリリースノート" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ko_KR/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ko_KR/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ko_KR/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ko_KR/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -# ByungYeol Woo , 2017. #zanata -# SEOKJAE BARK , 2017. #zanata -# Sungjin Kang , 2017. #zanata -# minwook-shin , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-22 06:54+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-12-27 02:31+0000\n" -"Last-Translator: ByungYeol Woo \n" -"Language-Team: Korean (South Korea)\n" -"Language: ko_KR\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=1; plural=0\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "1.1.0" -msgstr "1.1.0" - -msgid "Bug Fixes" -msgstr "버그 수정" - -msgid "Current Series Release Notes" -msgstr "최신 시리즈에 대한 릴리즈 노트" - -msgid "New Features" -msgstr "새로운 기능" - -msgid "Pike Series Release Notes" -msgstr "Pike 시리즈 릴리즈 노트" - -msgid "Prelude" -msgstr "서문" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/pt_BR/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/pt_BR/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/pt_BR/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/pt_BR/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -# Rodrigo Loures , 2018. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-22 06:54+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-01-25 10:14+0000\n" -"Last-Translator: Rodrigo Loures \n" -"Language-Team: Portuguese (Brazil)\n" -"Language: pt_BR\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -msgid "Bug Fixes" -msgstr "Correção de erros" - -msgid "Current Series Release Notes" -msgstr "Atual - Séries de Notas de Versão" - -msgid "New Features" -msgstr "Novos recursos" - -msgid "Pike Series Release Notes" -msgstr "Pike - Série de Notas de Versão" - -msgid "Prelude" -msgstr "Prelúdio" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ru/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ru/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/ru/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/ru/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -# Alexander , 2016. #zanata -# Artem , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-28 19:29+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-02-09 07:02+0000\n" -"Last-Translator: Artem \n" -"Language-Team: Russian\n" -"Language: ru\n" -"X-Generator: Zanata 3.9.6\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "Bug Fixes" -msgstr "Исправленные ошибки" - -msgid "Current Series Release Notes" -msgstr "Примечания к текущему релизу" - -msgid "New Features" -msgstr "Новые особенности" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/zh_CN/LC_MESSAGES/releasenotes.po neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/zh_CN/LC_MESSAGES/releasenotes.po --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/locale/zh_CN/LC_MESSAGES/releasenotes.po 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/locale/zh_CN/LC_MESSAGES/releasenotes.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -# Bin , 2017. #zanata -# TigerFang , 2017. #zanata -msgid "" -msgstr "" -"Project-Id-Version: Neutron FWaaS Dashboard Release Notes\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-22 06:54+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-12-28 02:43+0000\n" -"Last-Translator: TigerFang \n" -"Language-Team: Chinese (China)\n" -"Language: zh_CN\n" -"X-Generator: Zanata 4.3.3\n" -"Plural-Forms: nplurals=1; plural=0\n" - -msgid "0.1.0" -msgstr "0.1.0" - -msgid "Bug Fixes" -msgstr "修复的问题" - -msgid "Current Series Release Notes" -msgstr "当前版本发布声明" - -msgid "New Features" -msgstr "新功能" - -msgid "Pike Series Release Notes" -msgstr "Pike版本发布声明" - -msgid "Prelude" -msgstr "前奏" diff -Nru neutron-fwaas-dashboard-1.5.0/releasenotes/source/queens.rst neutron-fwaas-dashboard-1.3.0/releasenotes/source/queens.rst --- neutron-fwaas-dashboard-1.5.0/releasenotes/source/queens.rst 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/releasenotes/source/queens.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -=================================== - Queens Series Release Notes -=================================== - -.. release-notes:: - :branch: stable/queens diff -Nru neutron-fwaas-dashboard-1.5.0/requirements.txt neutron-fwaas-dashboard-1.3.0/requirements.txt --- neutron-fwaas-dashboard-1.5.0/requirements.txt 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/requirements.txt 2018-02-22 06:27:32.000000000 +0000 @@ -3,5 +3,5 @@ # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 -horizon>=13.0.0 # Apache-2.0 -python-neutronclient>=6.7.0 # Apache-2.0 +Django<2.0,>=1.8 # BSD +python-neutronclient>=6.3.0 # Apache-2.0 diff -Nru neutron-fwaas-dashboard-1.5.0/test-requirements.txt neutron-fwaas-dashboard-1.3.0/test-requirements.txt --- neutron-fwaas-dashboard-1.5.0/test-requirements.txt 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/test-requirements.txt 2018-02-22 06:27:32.000000000 +0000 @@ -9,7 +9,8 @@ django-nose>=1.4.4 # BSD flake8-import-order==0.13 # LGPLv3 mock>=2.0.0 # BSD +mox3>=0.20.0 # Apache-2.0 nosehtmloutput>=0.0.3 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinx!=1.6.6,>=1.6.2 # BSD openstackdocstheme>=1.18.1 # Apache-2.0 reno>=2.5.0 # Apache-2.0 diff -Nru neutron-fwaas-dashboard-1.5.0/tools/tox_install.sh neutron-fwaas-dashboard-1.3.0/tools/tox_install.sh --- neutron-fwaas-dashboard-1.5.0/tools/tox_install.sh 1970-01-01 00:00:00.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/tools/tox_install.sh 2018-02-22 06:27:32.000000000 +0000 @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +# Many of neutron's repos suffer from the problem of depending on neutron, +# but it not existing on pypi. + +# This wrapper for tox's package installer will use the existing package +# if it exists, else use zuul-cloner if that program exists, else grab it +# from neutron master via a hard-coded URL. That last case should only +# happen with devs running unit tests locally. + +# From the tox.ini config page: +# install_command=ARGV +# default: +# pip install {opts} {packages} + +ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner +BRANCH_NAME=stable/queens +GIT_BASE=${GIT_BASE:-https://git.openstack.org/} + +install_project() { + local project=$1 + local branch=${2:-$BRANCH_NAME} + local module_name=${project//-/_} + + set +e + project_installed=$(echo "import $module_name" | python 2>/dev/null ; echo $?) + set -e + + if [ $project_installed -eq 0 ]; then + echo "ALREADY INSTALLED" > /tmp/tox_install.txt + echo "$project already installed; using existing package" + elif [ -x "$ZUUL_CLONER" ]; then + echo "ZUUL CLONER" > /tmp/tox_install.txt + # Make this relative to current working directory so that + # git clean can remove it. We cannot remove the directory directly + # since it is referenced after $install_cmd -e + mkdir -p .tmp + PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp) + pushd $PROJECT_DIR + $ZUUL_CLONER --cache-dir \ + /opt/git \ + --branch $branch \ + http://git.openstack.org \ + openstack/$project + cd openstack/$project + $install_cmd -e . + popd + else + echo "PIP HARDCODE" > /tmp/tox_install.txt + local GIT_REPO="$GIT_BASE/openstack/$project" + SRC_DIR="$VIRTUAL_ENV/src/$project" + git clone --depth 1 --branch $branch $GIT_REPO $SRC_DIR + $install_cmd -U -e $SRC_DIR + fi +} + +set -e + +install_cmd="pip install -c$1" +shift + +install_project horizon + +$install_cmd -U $* +exit $? diff -Nru neutron-fwaas-dashboard-1.5.0/tox.ini neutron-fwaas-dashboard-1.3.0/tox.ini --- neutron-fwaas-dashboard-1.5.0/tox.ini 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/tox.ini 2018-02-22 06:27:32.000000000 +0000 @@ -5,51 +5,45 @@ [testenv] usedevelop = True +install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens} {opts} {packages} setenv = VIRTUAL_ENV={envdir} NOSE_WITH_OPENSTACK=1 NOSE_OPENSTACK_COLOR=1 NOSE_OPENSTACK_RED=0.05 NOSE_OPENSTACK_YELLOW=0.025 NOSE_OPENSTACK_SHOW_ELAPSED=1 -deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} - -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands = {[unit_tests]commands} [unit_tests] commands = python manage.py test {posargs} --settings=neutron_fwaas_dashboard.test.settings [testenv:pep8] -basepython = python3 commands = flake8 {posargs} {envpython} {toxinidir}/manage.py extract_messages --module neutron_fwaas_dashboard --verbosity 0 --check-only [testenv:venv] -basepython = python3 commands = {posargs} [testenv:cover] -basepython = python3 commands = coverage erase coverage run {toxinidir}/manage.py test neutron_fwaas_dashboard --settings=neutron_fwaas_dashboard.test.settings {posargs} coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml' coverage html --omit '.tox/cover/*' -d 'cover/htmlcov' -[testenv:py3-dj111] -basepython = python3 +[testenv:py27dj110] +basepython = python2.7 commands = - pip install django>=1.11,<2 + pip install django>=1.10,<1.11 {[unit_tests]commands} [testenv:docs] -basepython = python3 commands = python setup.py build_sphinx [testenv:releasenotes] -basepython = python3 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] @@ -66,10 +60,3 @@ [hacking] local-check-factory = horizon.hacking.checks.factory - -[testenv:lower-constraints] -basepython = python3 -deps = - -c{toxinidir}/lower-constraints.txt - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/requirements.txt diff -Nru neutron-fwaas-dashboard-1.5.0/.zuul.yaml neutron-fwaas-dashboard-1.3.0/.zuul.yaml --- neutron-fwaas-dashboard-1.5.0/.zuul.yaml 2018-08-07 03:44:59.000000000 +0000 +++ neutron-fwaas-dashboard-1.3.0/.zuul.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -- project: - check: - jobs: - - openstack-tox-lower-constraints: - required-projects: - - openstack/horizon - - horizon-openstack-tox-python3-django111 - gate: - jobs: - - openstack-tox-lower-constraints: - required-projects: - - openstack/horizon - - horizon-openstack-tox-python3-django111