Fix requirements for Queens branch
Change-Id: Ifff24bcf1c8fffbb37fb6efbaea0d8316fe5934c
This commit is contained in:
parent
ef2e1aaa60
commit
a064a02fba
|
@ -94,7 +94,8 @@ disable=
|
||||||
too-many-statements,
|
too-many-statements,
|
||||||
cyclic-import,
|
cyclic-import,
|
||||||
no-name-in-module,
|
no-name-in-module,
|
||||||
bad-super-call
|
bad-super-call,
|
||||||
|
inconsistent-return-statements
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
# Variable names can be 1 to 31 characters long, with lowercase and underscores
|
# Variable names can be 1 to 31 characters long, with lowercase and underscores
|
||||||
|
|
17
.zuul.yaml
17
.zuul.yaml
|
@ -5,7 +5,6 @@
|
||||||
- openstack-python35-jobs-neutron
|
- openstack-python35-jobs-neutron
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- vmware-tox-lower-constraints
|
|
||||||
- openstack-tox-pep8:
|
- openstack-tox-pep8:
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/neutron
|
- openstack/neutron
|
||||||
|
@ -44,7 +43,6 @@
|
||||||
gate:
|
gate:
|
||||||
queue: vmware-nsx
|
queue: vmware-nsx
|
||||||
jobs:
|
jobs:
|
||||||
- vmware-tox-lower-constraints
|
|
||||||
- openstack-tox-pep8:
|
- openstack-tox-pep8:
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/neutron
|
- openstack/neutron
|
||||||
|
@ -80,18 +78,3 @@
|
||||||
- openstack/neutron-dynamic-routing
|
- openstack/neutron-dynamic-routing
|
||||||
- openstack/neutron-vpnaas
|
- openstack/neutron-vpnaas
|
||||||
- x/tap-as-a-service
|
- x/tap-as-a-service
|
||||||
|
|
||||||
- job:
|
|
||||||
name: vmware-tox-lower-constraints
|
|
||||||
parent: openstack-tox-lower-constraints
|
|
||||||
timeout: 5400
|
|
||||||
required-projects:
|
|
||||||
- openstack/neutron
|
|
||||||
- x/networking-l2gw
|
|
||||||
- openstack/networking-sfc
|
|
||||||
- openstack/neutron-lbaas
|
|
||||||
- x/vmware-nsxlib
|
|
||||||
- openstack/neutron-fwaas
|
|
||||||
- openstack/neutron-dynamic-routing
|
|
||||||
- openstack/neutron-vpnaas
|
|
||||||
- x/tap-as-a-service
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ class VSMClient(object):
|
||||||
# Query all firewall sections
|
# Query all firewall sections
|
||||||
response = self.get()
|
response = self.get()
|
||||||
# Get layer3 sections related to security group
|
# Get layer3 sections related to security group
|
||||||
if response.status_code is 200:
|
if response.status_code == 200:
|
||||||
l3_sections = response.json()['layer3Sections']['layer3Sections']
|
l3_sections = response.json()['layer3Sections']['layer3Sections']
|
||||||
# do not delete the default section, or sections created by the
|
# do not delete the default section, or sections created by the
|
||||||
# service composer
|
# service composer
|
||||||
|
@ -289,7 +289,7 @@ class VSMClient(object):
|
||||||
self.__set_endpoint("/services/securitygroup/scope/globalroot-0")
|
self.__set_endpoint("/services/securitygroup/scope/globalroot-0")
|
||||||
# Query all security groups
|
# Query all security groups
|
||||||
response = self.get()
|
response = self.get()
|
||||||
if response.status_code is 200:
|
if response.status_code == 200:
|
||||||
sg_all = response.json()
|
sg_all = response.json()
|
||||||
else:
|
else:
|
||||||
print("ERROR: wrong response status code! Exiting...")
|
print("ERROR: wrong response status code! Exiting...")
|
||||||
|
@ -323,7 +323,7 @@ class VSMClient(object):
|
||||||
self.__set_endpoint("/services/spoofguard/policies/")
|
self.__set_endpoint("/services/spoofguard/policies/")
|
||||||
# Query all spoofguard policies
|
# Query all spoofguard policies
|
||||||
response = self.get()
|
response = self.get()
|
||||||
if response.status_code is not 200:
|
if response.status_code == 200:
|
||||||
print("ERROR: Faield to get spoofguard policies")
|
print("ERROR: Faield to get spoofguard policies")
|
||||||
return
|
return
|
||||||
sgp_all = response.json()
|
sgp_all = response.json()
|
||||||
|
@ -395,7 +395,7 @@ def ceil(a, b):
|
||||||
if b == 0:
|
if b == 0:
|
||||||
return 0
|
return 0
|
||||||
div = a / b
|
div = a / b
|
||||||
mod = 0 if a % b is 0 else 1
|
mod = 0 if a % b == 0 else 1
|
||||||
return int(div + mod)
|
return int(div + mod)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
sphinx!=1.6.6,>=1.6.2 # BSD
|
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
|
||||||
|
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
|
||||||
oslosphinx>=4.7.0 # Apache-2.0
|
oslosphinx>=4.7.0 # Apache-2.0
|
||||||
|
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||||
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
reno>=2.5.0 # Apache-2.0
|
reno>=2.5.0 # Apache-2.0
|
||||||
|
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
testresources>=2.0.0 # Apache-2.0/BSD
|
testresources>=2.0.0 # Apache-2.0/BSD
|
||||||
testscenarios>=0.4 # Apache-2.0/BSD
|
testscenarios>=0.4 # Apache-2.0/BSD
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
|
|
@ -1,154 +1,50 @@
|
||||||
alabaster==0.7.10
|
amqp==2.5.0
|
||||||
alembic==0.8.10
|
|
||||||
amqp==2.1.1
|
|
||||||
appdirs==1.4.3
|
|
||||||
asn1crypto==0.23.0
|
|
||||||
Babel==2.3.4
|
|
||||||
beautifulsoup4==4.6.0
|
|
||||||
cachetools==2.0.0
|
|
||||||
cffi==1.8.2
|
|
||||||
cliff==2.8.0
|
|
||||||
cmd2==0.8.0
|
|
||||||
contextlib2==0.4.0
|
|
||||||
coverage==4.0
|
coverage==4.0
|
||||||
debtcollector==1.2.0
|
|
||||||
decorator==3.4.0
|
decorator==3.4.0
|
||||||
deprecation==1.0
|
|
||||||
docutils==0.11
|
|
||||||
dogpile.cache==0.6.2
|
|
||||||
dulwich==0.15.0
|
|
||||||
eventlet==0.18.2
|
eventlet==0.18.2
|
||||||
extras==1.0.0
|
|
||||||
fasteners==0.7.0
|
|
||||||
fixtures==3.0.0
|
fixtures==3.0.0
|
||||||
flake8==2.5.5
|
flake8-import-order==0.15
|
||||||
flake8-import-order==0.12
|
hacking==2.0.0
|
||||||
future==0.16.0
|
|
||||||
futurist==1.2.0
|
|
||||||
greenlet==0.4.10
|
|
||||||
hacking==0.12.0
|
|
||||||
httplib2==0.9.1
|
httplib2==0.9.1
|
||||||
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
|
|
||||||
keystonemiddleware==4.17.0
|
|
||||||
kombu==4.0.0
|
kombu==4.0.0
|
||||||
linecache2==1.0.0
|
|
||||||
logilab-common==1.4.1
|
|
||||||
logutils==0.3.5
|
|
||||||
Mako==0.4.0
|
|
||||||
MarkupSafe==1.0
|
|
||||||
mccabe==0.2.1
|
|
||||||
mock==2.0.0
|
|
||||||
monotonic==0.6
|
|
||||||
mox3==0.20.0
|
|
||||||
msgpack-python==0.4.0
|
|
||||||
munch==2.1.0
|
|
||||||
netaddr==0.7.18
|
netaddr==0.7.18
|
||||||
netifaces==0.10.4
|
|
||||||
neutron-lib==1.13.0
|
neutron-lib==1.13.0
|
||||||
neutron-lbaas===12.0.0
|
neutron-lbaas===12.0.0
|
||||||
openstackdocstheme==1.18.1
|
openstackdocstheme==1.18.1
|
||||||
openstacksdk==0.11.2
|
oslo.concurrency==3.25.0
|
||||||
os-client-config==1.28.0
|
oslo.config==5.1.0
|
||||||
os-service-types==1.2.0
|
|
||||||
os-testr==1.0.0
|
|
||||||
os-xenapi==0.3.1
|
|
||||||
osc-lib==1.8.0
|
|
||||||
oslo.cache==1.26.0
|
|
||||||
oslo.concurrency==3.26.0
|
|
||||||
oslo.config==5.2.0
|
|
||||||
oslo.context==2.19.2
|
oslo.context==2.19.2
|
||||||
oslo.db==4.27.0
|
oslo.db==4.27.0
|
||||||
oslo.i18n==3.15.3
|
oslo.i18n==3.15.3
|
||||||
oslo.log==3.36.0
|
oslo.log==3.36.0
|
||||||
oslo.messaging==5.29.0
|
|
||||||
oslo.middleware==3.31.0
|
|
||||||
oslo.policy==1.30.0
|
oslo.policy==1.30.0
|
||||||
oslo.privsep==1.23.0
|
|
||||||
oslo.reports==1.18.0
|
|
||||||
oslo.rootwrap==5.8.0
|
|
||||||
oslo.serialization==2.18.0
|
oslo.serialization==2.18.0
|
||||||
oslo.service==1.24.0
|
oslo.service==1.24.0
|
||||||
oslo.utils==3.33.0
|
oslo.utils==3.33.0
|
||||||
oslo.versionedobjects==1.31.2
|
|
||||||
oslo.vmware==2.17.0
|
oslo.vmware==2.17.0
|
||||||
oslotest==3.2.0
|
oslotest==3.2.0
|
||||||
osprofiler==1.4.0
|
paramiko==2.4.3
|
||||||
ovs==2.8.0
|
|
||||||
ovsdbapp==0.10.0
|
|
||||||
paramiko==2.0.0
|
|
||||||
Paste==2.0.2
|
|
||||||
PasteDeploy==1.5.0
|
|
||||||
pbr==2.0.0
|
pbr==2.0.0
|
||||||
pecan==1.0.0
|
|
||||||
pep8==1.5.7
|
|
||||||
pika==0.10.0
|
pika==0.10.0
|
||||||
pika-pool==0.1.3
|
pika-pool==0.1.3
|
||||||
positional==1.2.1
|
prettytable==0.7.2
|
||||||
prettytable==0.7.1
|
psycopg2==2.8
|
||||||
psycopg2==2.6.2
|
PyMySQL==0.7.10
|
||||||
psutil==3.2.2
|
|
||||||
pycadf==1.1.0
|
|
||||||
pycodestyle==2.3.1
|
|
||||||
pycparser==2.18
|
|
||||||
pyflakes==0.8.1
|
|
||||||
Pygments==2.2.0
|
|
||||||
pyinotify==0.9.6
|
|
||||||
pylint==1.7.1
|
|
||||||
pyparsing==2.1.0
|
|
||||||
pyperclip==1.5.27
|
|
||||||
python-dateutil==2.5.3
|
|
||||||
python-designateclient==2.7.0
|
|
||||||
python-editor==1.0.3
|
|
||||||
python-keystoneclient==3.8.0
|
|
||||||
python-mimeparse==1.6.0
|
|
||||||
python-neutronclient==6.7.0
|
|
||||||
python-novaclient==9.1.0
|
|
||||||
python-openstackclient==3.12.0
|
|
||||||
python-subunit==1.0.0
|
|
||||||
pytz==2013.6
|
|
||||||
PyMySQL==0.7.6
|
|
||||||
PyYAML==3.12
|
|
||||||
reno==2.5.0
|
reno==2.5.0
|
||||||
repoze.lru==0.7
|
|
||||||
requests==2.14.2
|
requests==2.14.2
|
||||||
requests-mock==1.2.0
|
Sphinx==1.6.2
|
||||||
requestsexceptions==1.2.0
|
SQLAlchemy==1.0.19
|
||||||
rfc3986==0.3.1
|
|
||||||
Routes==2.3.1
|
|
||||||
ryu==4.14
|
|
||||||
simplejson==3.5.1
|
|
||||||
six==1.10.0
|
|
||||||
snowballstemmer==1.2.1
|
|
||||||
Sphinx==1.6.5
|
|
||||||
sphinxcontrib-websupport==1.0.1
|
|
||||||
SQLAlchemy==1.0.10
|
|
||||||
sqlalchemy-migrate==0.11.0
|
|
||||||
sqlparse==0.2.2
|
|
||||||
statsd==3.2.1
|
|
||||||
stestr==1.0.0
|
stestr==1.0.0
|
||||||
stevedore==1.20.0
|
stevedore==1.20.0
|
||||||
tempest==17.1.0
|
|
||||||
Tempita==0.5.2
|
|
||||||
tenacity==4.4.0
|
tenacity==4.4.0
|
||||||
testrepository==0.0.18
|
|
||||||
testresources==2.0.0
|
|
||||||
testscenarios==0.4
|
|
||||||
testtools==2.2.0
|
testtools==2.2.0
|
||||||
tinyrpc==0.6
|
|
||||||
traceback2==1.4.0
|
|
||||||
tooz==1.58.0
|
tooz==1.58.0
|
||||||
unittest2==1.1.0
|
|
||||||
urllib3==1.21.1
|
|
||||||
vine==1.1.4
|
vine==1.1.4
|
||||||
vmware-nsxlib==13.1.0
|
# Neutron related projects
|
||||||
waitress==1.1.0
|
vmware-nsxlib==12.0.4
|
||||||
WebOb==1.7.1
|
neutron==12.0.6
|
||||||
WebTest==2.0.27
|
networking-l2gw==12.0.1
|
||||||
wrapt==1.7.0
|
networking-sfc==6.0.0
|
||||||
|
neutron-fwaas==12.0.2
|
||||||
|
neutron-vpnaas==12.0.1
|
||||||
|
neutron-dynamic-routing==12.0.1
|
||||||
|
|
|
@ -7,7 +7,7 @@ enum34>=1.0.4;python_version=='2.7' or python_version=='2.6' or python_version==
|
||||||
eventlet!=0.18.3,!=0.20.1,<0.21.0,>=0.18.2 # MIT
|
eventlet!=0.18.3,!=0.20.1,<0.21.0,>=0.18.2 # MIT
|
||||||
httplib2>=0.9.1 # MIT
|
httplib2>=0.9.1 # MIT
|
||||||
netaddr>=0.7.18 # BSD
|
netaddr>=0.7.18 # BSD
|
||||||
tenacity>=3.2.1 # Apache-2.0
|
tenacity>=4.4.0 # Apache-2.0
|
||||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||||
six>=1.10.0 # MIT
|
six>=1.10.0 # MIT
|
||||||
stevedore>=1.20.0 # Apache-2.0
|
stevedore>=1.20.0 # Apache-2.0
|
||||||
|
@ -24,7 +24,7 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
|
||||||
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
|
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
|
||||||
oslo.utils>=3.33.0 # Apache-2.0
|
oslo.utils>=3.33.0 # Apache-2.0
|
||||||
oslo.vmware>=2.17.0 # Apache-2.0
|
oslo.vmware>=2.17.0 # Apache-2.0
|
||||||
PrettyTable<0.8,>=0.7.1 # BSD
|
PrettyTable<0.8,>=0.7.2 # BSD
|
||||||
tooz>=1.58.0 # Apache-2.0
|
tooz>=1.58.0 # Apache-2.0
|
||||||
decorator>=3.4.0 # BSD
|
decorator>=3.4.0 # BSD
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
|
@ -32,11 +32,11 @@ mock>=2.0.0 # BSD
|
||||||
|
|
||||||
# These repos are installed from git in OpenStack CI if the job
|
# These repos are installed from git in OpenStack CI if the job
|
||||||
# configures them as required-projects
|
# configures them as required-projects
|
||||||
neutron<13.0.0 # Apache-2.0
|
neutron>=12.0.6,<13.0.0 # Apache-2.0
|
||||||
networking-l2gw<13.0.0 # Apache-2.0
|
networking-l2gw>=12.0.1,<13.0.0 # Apache-2.0
|
||||||
networking-sfc<7.0.0 # Apache-2.0
|
networking-sfc>=6.0.0,<7.0.0 # Apache-2.0
|
||||||
neutron-lbaas<13.0.0 # Apache-2.0
|
neutron-lbaas>=12.0.0,<13.0.0 # Apache-2.0
|
||||||
neutron-fwaas<13.0.0 # Apache-2.0
|
neutron-fwaas>=12.0.2,<13.0.0 # Apache-2.0
|
||||||
neutron-vpnaas<13.0.0 # Apache-2.0
|
neutron-vpnaas>=12.0.1,<13.0.0 # Apache-2.0
|
||||||
neutron-dynamic-routing<13.0.0 # Apache-2.0
|
neutron-dynamic-routing>=12.0.1,<13.0.0 # Apache-2.0
|
||||||
vmware-nsxlib<14.0.0 # Apache-2.0
|
vmware-nsxlib>=12.0.4,<14.0.0 # Apache-2.0
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
hacking>=2.0.0,<3.0.0 # Apache-2.0
|
||||||
|
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
flake8-import-order==0.12 # LGPLv3
|
flake8-import-order==0.15,<0.17.1 # LGPLv3
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
|
|
||||||
psycopg2>=2.6.2 # LGPL/ZPL
|
psycopg2>=2.6.2 # LGPL/ZPL
|
||||||
|
@ -18,8 +18,8 @@ testresources>=2.0.0 # Apache-2.0/BSD
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
testscenarios>=0.4 # Apache-2.0/BSD
|
testscenarios>=0.4 # Apache-2.0/BSD
|
||||||
WebTest>=2.0.27 # MIT
|
WebTest>=2.0.27 # MIT
|
||||||
bandit>=1.1.0 # Apache-2.0
|
|
||||||
tempest>=17.1.0 # Apache-2.0
|
tempest>=17.1.0 # Apache-2.0
|
||||||
pylint==1.7.6 # GPLv2
|
pylint==1.9.2 # GPLv2
|
||||||
|
isort>=4.2.5,<=4.3.0
|
||||||
python-openstackclient>=3.12.0 # Apache-2.0
|
python-openstackclient>=3.12.0 # Apache-2.0
|
||||||
requests-mock>=1.1.0 # Apache-2.0
|
requests-mock>=1.1.0 # Apache-2.0
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -5,6 +5,7 @@ skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
EDITOR=vi
|
||||||
PYTHONWARNINGS=default::DeprecationWarning
|
PYTHONWARNINGS=default::DeprecationWarning
|
||||||
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
@ -144,11 +145,13 @@ commands = sphinx-build -b html doc/source doc/build/html
|
||||||
# H404 multi line docstring should start with a summary
|
# H404 multi line docstring should start with a summary
|
||||||
# H405 multi line docstring summary not separated with an empty line
|
# H405 multi line docstring summary not separated with an empty line
|
||||||
# H904 Wrap long lines in parentheses instead of a backslash
|
# H904 Wrap long lines in parentheses instead of a backslash
|
||||||
|
# I202 Additional newline in a group of imports
|
||||||
|
# W504 line break after binary operator
|
||||||
# TODO(dougwig) -- uncomment this to test for remaining linkages
|
# TODO(dougwig) -- uncomment this to test for remaining linkages
|
||||||
# N530 direct neutron imports not allowed
|
# N530 direct neutron imports not allowed
|
||||||
# N531 translations hints
|
# N531 translations hints
|
||||||
# TODO(boden): fix warnings for W503,E731,E266,E402
|
# TODO(boden): fix warnings for W503,E731,E266,E402
|
||||||
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W503,E731,E266,E402
|
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W503,E731,E266,E402,I202,W504
|
||||||
show-source = true
|
show-source = true
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
|
||||||
|
|
|
@ -151,5 +151,6 @@ class EventletApiClient(base.ApiClientBase):
|
||||||
|
|
||||||
return cookie
|
return cookie
|
||||||
|
|
||||||
|
|
||||||
# Register as subclass.
|
# Register as subclass.
|
||||||
base.ApiClientBase.register(EventletApiClient)
|
base.ApiClientBase.register(EventletApiClient)
|
||||||
|
|
|
@ -48,8 +48,8 @@ class DhcpAgentNotifyAPI(dhcp_rpc_agent_api.DhcpAgentNotifyAPI):
|
||||||
const.DEVICE_OWNER_DHCP not in plugin.port_special_owners):
|
const.DEVICE_OWNER_DHCP not in plugin.port_special_owners):
|
||||||
# network/subnet provisioned in the new model have a plain
|
# network/subnet provisioned in the new model have a plain
|
||||||
# nsx lswitch port, no vif attachment
|
# nsx lswitch port, no vif attachment
|
||||||
plugin.port_special_owners.append(const.DEVICE_OWNER_DHCP)
|
plugin.port_special_owners.append(const.DEVICE_OWNER_DHCP)
|
||||||
treat_dhcp_owner_specially = True
|
treat_dhcp_owner_specially = True
|
||||||
if (resource == 'port' and action == 'update' or
|
if (resource == 'port' and action == 'update' or
|
||||||
resource == 'subnet'):
|
resource == 'subnet'):
|
||||||
self.agentless_notifier.notify(context, data, methodname)
|
self.agentless_notifier.notify(context, data, methodname)
|
||||||
|
|
|
@ -49,6 +49,7 @@ class NetworkTypes(object):
|
||||||
VLAN = 'vlan'
|
VLAN = 'vlan'
|
||||||
BRIDGE = 'bridge'
|
BRIDGE = 'bridge'
|
||||||
|
|
||||||
|
|
||||||
# Attribute Map for Network Gateway Resource
|
# Attribute Map for Network Gateway Resource
|
||||||
# TODO(salvatore-orlando): add admin state as other neutron resources
|
# TODO(salvatore-orlando): add admin state as other neutron resources
|
||||||
RESOURCE_ATTRIBUTE_MAP = {
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
|
|
@ -108,6 +108,7 @@ def convert_to_unsigned_int_or_none_max_63(val):
|
||||||
# compatibility perspective to change the default value for DSCP in order to
|
# compatibility perspective to change the default value for DSCP in order to
|
||||||
# avoid this peculiar behaviour
|
# avoid this peculiar behaviour
|
||||||
|
|
||||||
|
|
||||||
RESOURCE_ATTRIBUTE_MAP = {
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'qos_queues': {
|
'qos_queues': {
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
|
|
|
@ -84,9 +84,9 @@ def format_exception(etype, e, exception_locals):
|
||||||
"""
|
"""
|
||||||
msg = [_("Error. %(type)s exception: %(exc)s.") %
|
msg = [_("Error. %(type)s exception: %(exc)s.") %
|
||||||
{'type': etype, 'exc': e}]
|
{'type': etype, 'exc': e}]
|
||||||
l = dict((k, v) for k, v in six.iteritems(exception_locals)
|
data = dict((k, v) for k, v in six.iteritems(exception_locals)
|
||||||
if k != 'request')
|
if k != 'request')
|
||||||
msg.append(_("locals=[%s]") % str(l))
|
msg.append(_("locals=[%s]") % str(data))
|
||||||
return ' '.join(msg)
|
return ' '.join(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -254,14 +254,14 @@ class ErrorDhcpEdgeJob(base_job.BaseJob):
|
||||||
|
|
||||||
if vnic['type'] != 'trunk':
|
if vnic['type'] != 'trunk':
|
||||||
# reinitialize the interface as it is missing config
|
# reinitialize the interface as it is missing config
|
||||||
vnic['name'] = (vcns_const.INTERNAL_VNIC_NAME +
|
vnic['name'] = (vcns_const.INTERNAL_VNIC_NAME +
|
||||||
str(vnic['index']))
|
str(vnic['index']))
|
||||||
vnic['type'] = 'trunk'
|
vnic['type'] = 'trunk'
|
||||||
vnic['portgroupId'] = port_group_id
|
vnic['portgroupId'] = port_group_id
|
||||||
vnic['mtu'] = 1500
|
vnic['mtu'] = 1500
|
||||||
vnic['enableProxyArp'] = False
|
vnic['enableProxyArp'] = False
|
||||||
vnic['enableSendRedirects'] = True
|
vnic['enableSendRedirects'] = True
|
||||||
vnic['isConnected'] = True
|
vnic['isConnected'] = True
|
||||||
|
|
||||||
def _update_router_bindings(self, context, edge_id):
|
def _update_router_bindings(self, context, edge_id):
|
||||||
edge_router_binds = nsxv_db.get_nsxv_router_bindings_by_edge(
|
edge_router_binds = nsxv_db.get_nsxv_router_bindings_by_edge(
|
||||||
|
|
|
@ -933,7 +933,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||||
if self._vcm:
|
if self._vcm:
|
||||||
try:
|
try:
|
||||||
h, switch = self.nsx_v.vcns.get_vdn_switch(dvs_id)
|
h, switch = self.nsx_v.vcns.get_vdn_switch(dvs_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
LOG.warning('DVS %s not registered on NSX. Unable to '
|
LOG.warning('DVS %s not registered on NSX. Unable to '
|
||||||
'update teaming for network %s',
|
'update teaming for network %s',
|
||||||
dvs_id, net_id)
|
dvs_id, net_id)
|
||||||
|
@ -1767,10 +1767,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||||
self._update_vnic_assigned_addresses(context.session, port,
|
self._update_vnic_assigned_addresses(context.session, port,
|
||||||
vnic_id)
|
vnic_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = _('Unable to add port to spoofguard policy error '
|
msg = _('Unable to add port to spoofguard policy error '
|
||||||
'%s') % e
|
'%s') % e
|
||||||
raise n_exc.BadRequest(resource='spoofguard policy',
|
raise n_exc.BadRequest(resource='spoofguard policy',
|
||||||
msg=msg)
|
msg=msg)
|
||||||
|
|
||||||
def update_network(self, context, id, network):
|
def update_network(self, context, id, network):
|
||||||
net_attrs = network['network']
|
net_attrs = network['network']
|
||||||
|
@ -1969,10 +1969,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||||
# Check that the MAC address is the same as the port
|
# Check that the MAC address is the same as the port
|
||||||
for ap in attrs[addr_apidef.ADDRESS_PAIRS]:
|
for ap in attrs[addr_apidef.ADDRESS_PAIRS]:
|
||||||
if ('mac_address' in ap and
|
if ('mac_address' in ap and
|
||||||
ap['mac_address'] != db_port['mac_address']):
|
ap['mac_address'] != db_port['mac_address']):
|
||||||
msg = _('Address pairs should have same MAC as the '
|
msg = _('Address pairs should have same MAC as the '
|
||||||
'port')
|
'port')
|
||||||
raise n_exc.BadRequest(resource='address_pairs', msg=msg)
|
raise n_exc.BadRequest(resource='address_pairs', msg=msg)
|
||||||
|
|
||||||
def _is_mac_in_use(self, context, network_id, mac_address):
|
def _is_mac_in_use(self, context, network_id, mac_address):
|
||||||
# Override this method as the backed doesn't support using the same
|
# Override this method as the backed doesn't support using the same
|
||||||
|
|
|
@ -4776,9 +4776,9 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
||||||
|
|
||||||
if self.nsxlib.feature_supported(
|
if self.nsxlib.feature_supported(
|
||||||
nsxlib_consts.FEATURE_DYNAMIC_CRITERIA):
|
nsxlib_consts.FEATURE_DYNAMIC_CRITERIA):
|
||||||
tag_expression = (
|
tag_expression = (
|
||||||
self.nsxlib.ns_group.get_port_tag_expression(
|
self.nsxlib.ns_group.get_port_tag_expression(
|
||||||
security.PORT_SG_SCOPE, secgroup['id']))
|
security.PORT_SG_SCOPE, secgroup['id']))
|
||||||
else:
|
else:
|
||||||
tag_expression = None
|
tag_expression = None
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ class EdgeListenerManager(base_mgr.EdgeLoadbalancerBaseManager):
|
||||||
with locking.LockManager.get_lock(edge_id):
|
with locking.LockManager.get_lock(edge_id):
|
||||||
self.vcns.delete_app_profile(edge_id, app_profile_id)
|
self.vcns.delete_app_profile(edge_id, app_profile_id)
|
||||||
except (vcns_exc.ResourceNotFound, vcns_exc.RequestBad):
|
except (vcns_exc.ResourceNotFound, vcns_exc.RequestBad):
|
||||||
LOG.error('app profile not found on edge: %s', edge_id)
|
LOG.error('app profile not found on edge: %s', edge_id)
|
||||||
except vcns_exc.VcnsApiException:
|
except vcns_exc.VcnsApiException:
|
||||||
LOG.error('Failed to delete app profile on Edge: %s', edge_id)
|
LOG.error('Failed to delete app profile on Edge: %s', edge_id)
|
||||||
|
|
||||||
|
|
|
@ -343,6 +343,7 @@ def nsx_fix_name_mismatch(resource, event, trigger, **kwargs):
|
||||||
'Edge %s has no backup prefix on NSX', edge_id)
|
'Edge %s has no backup prefix on NSX', edge_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
registry.subscribe(nsx_list_backup_edges,
|
registry.subscribe(nsx_list_backup_edges,
|
||||||
constants.BACKUP_EDGES,
|
constants.BACKUP_EDGES,
|
||||||
shell.Operations.LIST.value)
|
shell.Operations.LIST.value)
|
||||||
|
|
|
@ -327,7 +327,7 @@ def change_edge_ha(ha, edge_id):
|
||||||
'enabled': ha}
|
'enabled': ha}
|
||||||
try:
|
try:
|
||||||
nsxv.enable_ha(edge_id, request)
|
nsxv.enable_ha(edge_id, request)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -353,7 +353,7 @@ def change_edge_syslog(properties):
|
||||||
edge_id = properties.get('edge-id')
|
edge_id = properties.get('edge-id')
|
||||||
try:
|
try:
|
||||||
nsxv.update_edge_syslog(edge_id, request)
|
nsxv.update_edge_syslog(edge_id, request)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -362,7 +362,7 @@ def change_edge_syslog(properties):
|
||||||
def delete_edge_syslog(edge_id):
|
def delete_edge_syslog(edge_id):
|
||||||
try:
|
try:
|
||||||
nsxv.delete_edge_syslog(edge_id)
|
nsxv.delete_edge_syslog(edge_id)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -404,7 +404,7 @@ def change_edge_loglevel(properties):
|
||||||
try:
|
try:
|
||||||
edge_utils.update_edge_loglevel(nsxv, edge_id, module, level)
|
edge_utils.update_edge_loglevel(nsxv, edge_id, module, level)
|
||||||
|
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -422,7 +422,7 @@ def change_edge_appliance_size(properties):
|
||||||
try:
|
try:
|
||||||
nsxv.change_edge_appliance_size(
|
nsxv.change_edge_appliance_size(
|
||||||
properties.get('edge-id'), size)
|
properties.get('edge-id'), size)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", properties.get('edge-id'))
|
LOG.error("Edge %s not found", properties.get('edge-id'))
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -462,7 +462,7 @@ def change_edge_appliance(edge_id):
|
||||||
request = {'appliances': appliances, 'applianceSize': size}
|
request = {'appliances': appliances, 'applianceSize': size}
|
||||||
try:
|
try:
|
||||||
nsxv.change_edge_appliance(edge_id, request)
|
nsxv.change_edge_appliance(edge_id, request)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
@ -503,7 +503,7 @@ def change_edge_appliance_reservations(properties):
|
||||||
request = {'appliances': appliances}
|
request = {'appliances': appliances}
|
||||||
try:
|
try:
|
||||||
nsxv.change_edge_appliance(edge_id, request)
|
nsxv.change_edge_appliance(edge_id, request)
|
||||||
except nsxv_exceptions.ResourceNotFound as e:
|
except nsxv_exceptions.ResourceNotFound:
|
||||||
LOG.error("Edge %s not found", edge_id)
|
LOG.error("Edge %s not found", edge_id)
|
||||||
except exceptions.NeutronException as e:
|
except exceptions.NeutronException as e:
|
||||||
LOG.error("%s", str(e))
|
LOG.error("%s", str(e))
|
||||||
|
|
|
@ -74,11 +74,11 @@ def _validate_resource_choice(resource, nsx_plugin):
|
||||||
LOG.error('Supported list of NSX-V resources: %s',
|
LOG.error('Supported list of NSX-V resources: %s',
|
||||||
resources.nsxv_resources_names)
|
resources.nsxv_resources_names)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif nsx_plugin == 'nsxv3'and resource not in resources.nsxv3_resources:
|
elif nsx_plugin == 'nsxv3' and resource not in resources.nsxv3_resources:
|
||||||
LOG.error('Supported list of NSX-V3 resources: %s',
|
LOG.error('Supported list of NSX-V3 resources: %s',
|
||||||
resources.nsxv3_resources_names)
|
resources.nsxv3_resources_names)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif nsx_plugin == 'nsxtvd'and resource not in resources.nsxtvd_resources:
|
elif nsx_plugin == 'nsxtvd' and resource not in resources.nsxtvd_resources:
|
||||||
LOG.error('Supported list of NSX-TVD resources: %s',
|
LOG.error('Supported list of NSX-TVD resources: %s',
|
||||||
resources.nsxtvd_resources_names)
|
resources.nsxtvd_resources_names)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
@ -67,6 +67,7 @@ class Operations(enum.Enum):
|
||||||
SHOW = 'show'
|
SHOW = 'show'
|
||||||
VALIDATE = 'validate'
|
VALIDATE = 'validate'
|
||||||
|
|
||||||
|
|
||||||
ops = [op.value for op in Operations]
|
ops = [op.value for op in Operations]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -743,19 +743,19 @@ class NetworkGatewayDbTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
|
||||||
|
|
||||||
def test_connect_invalid_network_returns_400(self):
|
def test_connect_invalid_network_returns_400(self):
|
||||||
with self._network_gateway() as gw:
|
with self._network_gateway() as gw:
|
||||||
self._gateway_action('connect',
|
self._gateway_action('connect',
|
||||||
gw[self.gw_resource]['id'],
|
gw[self.gw_resource]['id'],
|
||||||
'hohoho',
|
'hohoho',
|
||||||
'vlan', 555,
|
'vlan', 555,
|
||||||
expected_status=exc.HTTPBadRequest.code)
|
expected_status=exc.HTTPBadRequest.code)
|
||||||
|
|
||||||
def test_connect_unspecified_network_returns_400(self):
|
def test_connect_unspecified_network_returns_400(self):
|
||||||
with self._network_gateway() as gw:
|
with self._network_gateway() as gw:
|
||||||
self._gateway_action('connect',
|
self._gateway_action('connect',
|
||||||
gw[self.gw_resource]['id'],
|
gw[self.gw_resource]['id'],
|
||||||
None,
|
None,
|
||||||
'vlan', 555,
|
'vlan', 555,
|
||||||
expected_status=exc.HTTPBadRequest.code)
|
expected_status=exc.HTTPBadRequest.code)
|
||||||
|
|
||||||
def test_disconnect_network_ambiguous_returns_409(self):
|
def test_disconnect_network_ambiguous_returns_409(self):
|
||||||
with self._network_gateway() as gw:
|
with self._network_gateway() as gw:
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PortSecurityTestCaseNSXv2(psec.PortSecurityDBTestCase):
|
||||||
|
|
||||||
|
|
||||||
class TestPortSecurityNSXv2(PortSecurityTestCaseNSXv2, psec.TestPortSecurity):
|
class TestPortSecurityNSXv2(PortSecurityTestCaseNSXv2, psec.TestPortSecurity):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestPortSecurityNSXv3(psec.TestPortSecurity,
|
class TestPortSecurityNSXv3(psec.TestPortSecurity,
|
||||||
|
|
|
@ -354,9 +354,9 @@ class LsnManagerTestCase(base.BaseTestCase):
|
||||||
|
|
||||||
def _test_lsn_delete_by_network_with_exc(self, exc):
|
def _test_lsn_delete_by_network_with_exc(self, exc):
|
||||||
self.mock_lsn_api.lsn_for_network_get.side_effect = exc
|
self.mock_lsn_api.lsn_for_network_get.side_effect = exc
|
||||||
with mock.patch.object(lsn_man.LOG, 'warning') as l:
|
with mock.patch.object(lsn_man.LOG, 'warning') as log_mock:
|
||||||
self.manager.lsn_delete_by_network(mock.ANY, self.net_id)
|
self.manager.lsn_delete_by_network(mock.ANY, self.net_id)
|
||||||
self.assertEqual(1, l.call_count)
|
self.assertEqual(1, log_mock.call_count)
|
||||||
|
|
||||||
def test_lsn_delete_by_network_with_not_found(self):
|
def test_lsn_delete_by_network_with_not_found(self):
|
||||||
self._test_lsn_delete_by_network_with_exc(n_exc.NotFound)
|
self._test_lsn_delete_by_network_with_exc(n_exc.NotFound)
|
||||||
|
@ -430,10 +430,10 @@ class LsnManagerTestCase(base.BaseTestCase):
|
||||||
|
|
||||||
def _test_lsn_port_delete_with_exc(self, exc):
|
def _test_lsn_port_delete_with_exc(self, exc):
|
||||||
self.mock_lsn_api.lsn_port_delete.side_effect = exc
|
self.mock_lsn_api.lsn_port_delete.side_effect = exc
|
||||||
with mock.patch.object(lsn_man.LOG, 'warning') as l:
|
with mock.patch.object(lsn_man.LOG, 'warning') as log_mock:
|
||||||
self.manager.lsn_port_delete(mock.ANY, mock.ANY, mock.ANY)
|
self.manager.lsn_port_delete(mock.ANY, mock.ANY, mock.ANY)
|
||||||
self.assertEqual(1, self.mock_lsn_api.lsn_port_delete.call_count)
|
self.assertEqual(1, self.mock_lsn_api.lsn_port_delete.call_count)
|
||||||
self.assertEqual(1, l.call_count)
|
self.assertEqual(1, log_mock.call_count)
|
||||||
|
|
||||||
def test_lsn_port_delete_with_not_found(self):
|
def test_lsn_port_delete_with_not_found(self):
|
||||||
self._test_lsn_port_delete_with_exc(n_exc.NotFound)
|
self._test_lsn_port_delete_with_exc(n_exc.NotFound)
|
||||||
|
@ -658,9 +658,9 @@ class LsnManagerTestCase(base.BaseTestCase):
|
||||||
def test_lsn_port_dispose_api_error(self):
|
def test_lsn_port_dispose_api_error(self):
|
||||||
self.mock_lsn_api.lsn_port_delete.side_effect = (
|
self.mock_lsn_api.lsn_port_delete.side_effect = (
|
||||||
exception.NsxApiException)
|
exception.NsxApiException)
|
||||||
with mock.patch.object(lsn_man.LOG, 'warning') as l:
|
with mock.patch.object(lsn_man.LOG, 'warning') as log_mock:
|
||||||
self.manager.lsn_port_dispose(mock.ANY, self.net_id, self.mac)
|
self.manager.lsn_port_dispose(mock.ANY, self.net_id, self.mac)
|
||||||
self.assertEqual(1, l.call_count)
|
self.assertEqual(1, log_mock.call_count)
|
||||||
|
|
||||||
def test_lsn_port_host_conf(self):
|
def test_lsn_port_host_conf(self):
|
||||||
with mock.patch.object(self.manager,
|
with mock.patch.object(self.manager,
|
||||||
|
|
|
@ -40,7 +40,6 @@ NVP_INI_DEPR_PATH = vmware.get_fake_conf('nvp.ini.full.test')
|
||||||
class NSXClusterTest(base.BaseTestCase):
|
class NSXClusterTest(base.BaseTestCase):
|
||||||
|
|
||||||
cluster_opts = {'default_tz_uuid': uuidutils.generate_uuid(),
|
cluster_opts = {'default_tz_uuid': uuidutils.generate_uuid(),
|
||||||
'default_l2_gw_service_uuid': uuidutils.generate_uuid(),
|
|
||||||
'default_l2_gw_service_uuid': uuidutils.generate_uuid(),
|
'default_l2_gw_service_uuid': uuidutils.generate_uuid(),
|
||||||
'nsx_user': 'foo',
|
'nsx_user': 'foo',
|
||||||
'nsx_password': 'bar',
|
'nsx_password': 'bar',
|
||||||
|
|
|
@ -2004,31 +2004,31 @@ class TestSubnetsV2(NsxVPluginV2TestCase,
|
||||||
return self._create_bulk(fmt, number, 'subnet', base_data, **kwargs)
|
return self._create_bulk(fmt, number, 'subnet', base_data, **kwargs)
|
||||||
|
|
||||||
def test_create_subnet_nonzero_cidr(self):
|
def test_create_subnet_nonzero_cidr(self):
|
||||||
awkward_cidrs = [{'nonezero': '10.129.122.5/8',
|
awkward_cidrs = [{'nonezero': '10.129.122.5/8',
|
||||||
'corrected': '10.0.0.0/8'},
|
'corrected': '10.0.0.0/8'},
|
||||||
{'nonezero': '11.129.122.5/15',
|
{'nonezero': '11.129.122.5/15',
|
||||||
'corrected': '11.128.0.0/15'},
|
'corrected': '11.128.0.0/15'},
|
||||||
{'nonezero': '12.129.122.5/16',
|
{'nonezero': '12.129.122.5/16',
|
||||||
'corrected': '12.129.0.0/16'},
|
'corrected': '12.129.0.0/16'},
|
||||||
{'nonezero': '13.129.122.5/18',
|
{'nonezero': '13.129.122.5/18',
|
||||||
'corrected': '13.129.64.0/18'},
|
'corrected': '13.129.64.0/18'},
|
||||||
{'nonezero': '14.129.122.5/22',
|
{'nonezero': '14.129.122.5/22',
|
||||||
'corrected': '14.129.120.0/22'},
|
'corrected': '14.129.120.0/22'},
|
||||||
{'nonezero': '15.129.122.5/24',
|
{'nonezero': '15.129.122.5/24',
|
||||||
'corrected': '15.129.122.0/24'},
|
'corrected': '15.129.122.0/24'},
|
||||||
{'nonezero': '16.129.122.5/28',
|
{'nonezero': '16.129.122.5/28',
|
||||||
'corrected': '16.129.122.0/28'}, ]
|
'corrected': '16.129.122.0/28'}, ]
|
||||||
|
|
||||||
for cidr in awkward_cidrs:
|
for cidr in awkward_cidrs:
|
||||||
with self.subnet(enable_dhcp=False,
|
with self.subnet(enable_dhcp=False,
|
||||||
cidr=cidr['nonezero']) as subnet:
|
cidr=cidr['nonezero']) as subnet:
|
||||||
# the API should accept and correct these cidrs for users
|
# the API should accept and correct these cidrs for users
|
||||||
self.assertEqual(cidr['corrected'],
|
self.assertEqual(cidr['corrected'],
|
||||||
subnet['subnet']['cidr'])
|
subnet['subnet']['cidr'])
|
||||||
|
|
||||||
with self.subnet(enable_dhcp=False, cidr='17.129.122.5/32',
|
with self.subnet(enable_dhcp=False, cidr='17.129.122.5/32',
|
||||||
gateway_ip=None) as subnet:
|
gateway_ip=None) as subnet:
|
||||||
self.assertEqual('17.129.122.5/32', subnet['subnet']['cidr'])
|
self.assertEqual('17.129.122.5/32', subnet['subnet']['cidr'])
|
||||||
|
|
||||||
def test_create_subnet_ipv6_attributes(self):
|
def test_create_subnet_ipv6_attributes(self):
|
||||||
# Expected to fail for now as we don't support IPv6 for NSXv
|
# Expected to fail for now as we don't support IPv6 for NSXv
|
||||||
|
@ -2678,27 +2678,27 @@ class L3NatTestCaseBase(test_l3_plugin.L3NatTestCaseMixin):
|
||||||
enable_dhcp=False, ip_version=6)
|
enable_dhcp=False, ip_version=6)
|
||||||
) as s1, self.subnet(network=n, cidr='fd01::1/64',
|
) as s1, self.subnet(network=n, cidr='fd01::1/64',
|
||||||
ip_version=6, enable_dhcp=False) as s2:
|
ip_version=6, enable_dhcp=False) as s2:
|
||||||
body = self._router_interface_action('add',
|
body = self._router_interface_action('add',
|
||||||
r['router']['id'],
|
r['router']['id'],
|
||||||
s1['subnet']['id'],
|
s1['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
pid1 = body['port_id']
|
pid1 = body['port_id']
|
||||||
body = self._router_interface_action('add',
|
body = self._router_interface_action('add',
|
||||||
r['router']['id'],
|
r['router']['id'],
|
||||||
s2['subnet']['id'],
|
s2['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
pid2 = body['port_id']
|
pid2 = body['port_id']
|
||||||
self.assertEqual(pid1, pid2)
|
self.assertEqual(pid1, pid2)
|
||||||
port = self._show('ports', pid1)
|
port = self._show('ports', pid1)
|
||||||
self.assertEqual(2, len(port['port']['fixed_ips']))
|
self.assertEqual(2, len(port['port']['fixed_ips']))
|
||||||
port_subnet_ids = [fip['subnet_id'] for fip in
|
port_subnet_ids = [fip['subnet_id'] for fip in
|
||||||
port['port']['fixed_ips']]
|
port['port']['fixed_ips']]
|
||||||
self.assertIn(s1['subnet']['id'], port_subnet_ids)
|
self.assertIn(s1['subnet']['id'], port_subnet_ids)
|
||||||
self.assertIn(s2['subnet']['id'], port_subnet_ids)
|
self.assertIn(s2['subnet']['id'], port_subnet_ids)
|
||||||
self._router_interface_action('remove', r['router']['id'],
|
self._router_interface_action('remove', r['router']['id'],
|
||||||
s1['subnet']['id'], None)
|
s1['subnet']['id'], None)
|
||||||
self._router_interface_action('remove', r['router']['id'],
|
self._router_interface_action('remove', r['router']['id'],
|
||||||
s2['subnet']['id'], None)
|
s2['subnet']['id'], None)
|
||||||
|
|
||||||
def test_router_add_interface_ipv6_port_existing_network_returns_400(self):
|
def test_router_add_interface_ipv6_port_existing_network_returns_400(self):
|
||||||
"""Ensure unique IPv6 router ports per network id.
|
"""Ensure unique IPv6 router ports per network id.
|
||||||
|
@ -5304,36 +5304,36 @@ class TestSharedRouterTestCase(L3NatTest, L3NatTestCaseBase,
|
||||||
ext_subnet['subnet']['network_id'])
|
ext_subnet['subnet']['network_id'])
|
||||||
|
|
||||||
def test_routers_with_interface_on_same_edge(self):
|
def test_routers_with_interface_on_same_edge(self):
|
||||||
with self.router() as r1, self.router() as r2,\
|
with self.router() as r1, self.router() as r2,\
|
||||||
self.subnet(cidr='11.0.0.0/24') as s11,\
|
self.subnet(cidr='11.0.0.0/24') as s11,\
|
||||||
self.subnet(cidr='12.0.0.0/24') as s12:
|
self.subnet(cidr='12.0.0.0/24') as s12:
|
||||||
self._router_interface_action('add',
|
self._router_interface_action('add',
|
||||||
r1['router']['id'],
|
r1['router']['id'],
|
||||||
s11['subnet']['id'],
|
s11['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
self._router_interface_action('add',
|
self._router_interface_action('add',
|
||||||
r2['router']['id'],
|
r2['router']['id'],
|
||||||
s12['subnet']['id'],
|
s12['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
routers_expected = [r1['router']['id'], r2['router']['id']]
|
routers_expected = [r1['router']['id'], r2['router']['id']]
|
||||||
routers_1 = (self.plugin_instance.edge_manager.
|
routers_1 = (self.plugin_instance.edge_manager.
|
||||||
get_routers_on_same_edge(
|
get_routers_on_same_edge(
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
r1['router']['id']))
|
r1['router']['id']))
|
||||||
self.assertEqual(set(routers_expected), set(routers_1))
|
self.assertEqual(set(routers_expected), set(routers_1))
|
||||||
routers_2 = (self.plugin_instance.edge_manager.
|
routers_2 = (self.plugin_instance.edge_manager.
|
||||||
get_routers_on_same_edge(
|
get_routers_on_same_edge(
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
r2['router']['id']))
|
r2['router']['id']))
|
||||||
self.assertEqual(set(routers_expected), set(routers_2))
|
self.assertEqual(set(routers_expected), set(routers_2))
|
||||||
self._router_interface_action('remove',
|
self._router_interface_action('remove',
|
||||||
r1['router']['id'],
|
r1['router']['id'],
|
||||||
s11['subnet']['id'],
|
s11['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
self._router_interface_action('remove',
|
self._router_interface_action('remove',
|
||||||
r2['router']['id'],
|
r2['router']['id'],
|
||||||
s12['subnet']['id'],
|
s12['subnet']['id'],
|
||||||
None)
|
None)
|
||||||
|
|
||||||
def test_routers_with_overlap_interfaces(self):
|
def test_routers_with_overlap_interfaces(self):
|
||||||
with self.router() as r1, self.router() as r2,\
|
with self.router() as r1, self.router() as r2,\
|
||||||
|
|
|
@ -991,8 +991,8 @@ class FakeVcns(object):
|
||||||
_section = self._sections[section_id]
|
_section = self._sections[section_id]
|
||||||
if (_section['name'] != section_name and
|
if (_section['name'] != section_name and
|
||||||
section_name in self._sections['names']):
|
section_name in self._sections['names']):
|
||||||
# Theres a section with this name already
|
# Theres a section with this name already
|
||||||
headers, response = self._unknown_error()
|
headers, response = self._unknown_error()
|
||||||
else:
|
else:
|
||||||
# Different Etag every successful update
|
# Different Etag every successful update
|
||||||
_section['etag'] = ('Etag-1' if _section['etag'] == 'Etag-0'
|
_section['etag'] = ('Etag-1' if _section['etag'] == 'Etag-0'
|
||||||
|
|
|
@ -527,9 +527,9 @@ class TestNetworksV2(test_plugin.TestNetworksV2, NsxV3PluginTestCaseMixin):
|
||||||
'port_security_enabled': False}}
|
'port_security_enabled': False}}
|
||||||
with mock_ens, mock_tz, mock_tt,\
|
with mock_ens, mock_tz, mock_tt,\
|
||||||
mock.patch.object(self.plugin, '_validate_qos_policy_id'):
|
mock.patch.object(self.plugin, '_validate_qos_policy_id'):
|
||||||
self.assertRaises(n_exc.InvalidInput,
|
self.assertRaises(n_exc.InvalidInput,
|
||||||
self.plugin.create_network,
|
self.plugin.create_network,
|
||||||
context.get_admin_context(), data)
|
context.get_admin_context(), data)
|
||||||
|
|
||||||
def test_update_ens_network_with_qos(self):
|
def test_update_ens_network_with_qos(self):
|
||||||
cfg.CONF.set_override('ens_support', True, 'nsx_v3')
|
cfg.CONF.set_override('ens_support', True, 'nsx_v3')
|
||||||
|
@ -639,7 +639,7 @@ class TestNetworksV2(test_plugin.TestNetworksV2, NsxV3PluginTestCaseMixin):
|
||||||
arg_list=(pnet.NETWORK_TYPE,
|
arg_list=(pnet.NETWORK_TYPE,
|
||||||
pnet.PHYSICAL_NETWORK)) as net:
|
pnet.PHYSICAL_NETWORK)) as net:
|
||||||
for k, v in expected:
|
for k, v in expected:
|
||||||
self.assertEqual(net['network'][k], v)
|
self.assertEqual(net['network'][k], v)
|
||||||
|
|
||||||
def test_create_phys_vlan_generate(self):
|
def test_create_phys_vlan_generate(self):
|
||||||
cfg.CONF.set_override('network_vlan_ranges',
|
cfg.CONF.set_override('network_vlan_ranges',
|
||||||
|
@ -937,26 +937,25 @@ class TestPortsV2(test_plugin.TestPortsV2, NsxV3PluginTestCaseMixin,
|
||||||
|
|
||||||
def test_fail_create_allowed_address_pairs_over_limit(self):
|
def test_fail_create_allowed_address_pairs_over_limit(self):
|
||||||
with self.network() as network,\
|
with self.network() as network,\
|
||||||
self.subnet(network=network, enable_dhcp=True) as s1:
|
self.subnet(network=network, enable_dhcp=True) as s1:
|
||||||
data = {'port': {
|
data = {'port': {
|
||||||
'network_id': network['network']['id'],
|
'network_id': network['network']['id'],
|
||||||
'tenant_id': self._tenant_id,
|
'tenant_id': self._tenant_id,
|
||||||
'name': 'pair_port',
|
'name': 'pair_port',
|
||||||
'admin_state_up': True,
|
'admin_state_up': True,
|
||||||
'device_id': 'fake_device',
|
'device_id': 'fake_device',
|
||||||
'device_owner': 'fake_owner',
|
'device_owner': 'fake_owner',
|
||||||
'fixed_ips': [{'subnet_id': s1['subnet']['id']}]
|
'fixed_ips': [{'subnet_id': s1['subnet']['id']}]
|
||||||
}
|
}}
|
||||||
}
|
count = 1
|
||||||
count = 1
|
address_pairs = []
|
||||||
address_pairs = []
|
while count < 129:
|
||||||
while count < 129:
|
address_pairs.append({'ip_address': '10.0.0.%s' %
|
||||||
address_pairs.append({'ip_address': '10.0.0.%s' %
|
count})
|
||||||
count})
|
count += 1
|
||||||
count += 1
|
data['port']['allowed_address_pairs'] = address_pairs
|
||||||
data['port']['allowed_address_pairs'] = address_pairs
|
self.assertRaises(n_exc.InvalidInput,
|
||||||
self.assertRaises(n_exc.InvalidInput,
|
self.plugin.create_port, self.ctx, data)
|
||||||
self.plugin.create_port, self.ctx, data)
|
|
||||||
|
|
||||||
def test_fail_update_lb_port_with_fixed_ip(self):
|
def test_fail_update_lb_port_with_fixed_ip(self):
|
||||||
with self.network() as network:
|
with self.network() as network:
|
||||||
|
|
|
@ -297,11 +297,11 @@ class TestNSXvBgpPlugin(test_plugin.NsxVPluginV2TestCase,
|
||||||
self.skipTest('Not supported')
|
self.skipTest('Not supported')
|
||||||
|
|
||||||
def test_add_bgp_peer_with_bad_id(self):
|
def test_add_bgp_peer_with_bad_id(self):
|
||||||
with self.subnetpool_with_address_scope(
|
with self.subnetpool_with_address_scope(
|
||||||
4, prefixes=['8.0.0.0/8']) as sp:
|
4, prefixes=['8.0.0.0/8']) as sp:
|
||||||
with self.bgp_speaker(sp['ip_version'], 1234) as speaker:
|
with self.bgp_speaker(sp['ip_version'], 1234) as speaker:
|
||||||
self.assertRaises(ext_bgp.BgpPeerNotFound,
|
self.assertRaises(ext_bgp.BgpPeerNotFound,
|
||||||
self.bgp_plugin.add_bgp_peer,
|
self.bgp_plugin.add_bgp_peer,
|
||||||
self.context,
|
self.context,
|
||||||
speaker['id'],
|
speaker['id'],
|
||||||
{'bgp_peer_id': 'aaa'})
|
{'bgp_peer_id': 'aaa'})
|
||||||
|
|
|
@ -271,10 +271,10 @@ class TestQosNsxV3Notification(base.BaseQosTestCase,
|
||||||
return_value=_policy),\
|
return_value=_policy),\
|
||||||
mock.patch('neutron.objects.db.api.update_object',
|
mock.patch('neutron.objects.db.api.update_object',
|
||||||
return_value=rule_data):
|
return_value=rule_data):
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.DriverCallError,
|
exceptions.DriverCallError,
|
||||||
self.qos_plugin.update_policy_bandwidth_limit_rule,
|
self.qos_plugin.update_policy_bandwidth_limit_rule,
|
||||||
self.ctxt, rule.id, _policy.id, rule_data)
|
self.ctxt, rule.id, _policy.id, rule_data)
|
||||||
|
|
||||||
@mock.patch.object(policy_object.QosPolicy, '_reload_rules')
|
@mock.patch.object(policy_object.QosPolicy, '_reload_rules')
|
||||||
def test_dscp_rule_create_profile(self, *mocks):
|
def test_dscp_rule_create_profile(self, *mocks):
|
||||||
|
|
|
@ -226,21 +226,21 @@ class TestDriverValidation(base.BaseTestCase):
|
||||||
mock.patch.object(self.validator.vpn_plugin,
|
mock.patch.object(self.validator.vpn_plugin,
|
||||||
'get_ipsec_site_connections',
|
'get_ipsec_site_connections',
|
||||||
side_effect=mock_get_connections):
|
side_effect=mock_get_connections):
|
||||||
ipsec_sitecon = {'id': '1',
|
ipsec_sitecon = {'id': '1',
|
||||||
'vpnservice_id': '1',
|
'vpnservice_id': '1',
|
||||||
'mtu': 1500,
|
'mtu': 1500,
|
||||||
'peer_address': self.peer_address,
|
'peer_address': self.peer_address,
|
||||||
'peer_cidrs': [self.peer_cidr]}
|
'peer_cidrs': [self.peer_cidr]}
|
||||||
if conn_params:
|
if conn_params:
|
||||||
ipsec_sitecon.update(conn_params)
|
ipsec_sitecon.update(conn_params)
|
||||||
if success:
|
if success:
|
||||||
self.validator.validate_ipsec_site_connection(
|
self.validator.validate_ipsec_site_connection(
|
||||||
self.context, ipsec_sitecon)
|
self.context, ipsec_sitecon)
|
||||||
else:
|
else:
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
nsx_exc.NsxVpnValidationError,
|
nsx_exc.NsxVpnValidationError,
|
||||||
self.validator.validate_ipsec_site_connection,
|
self.validator.validate_ipsec_site_connection,
|
||||||
self.context, ipsec_sitecon)
|
self.context, ipsec_sitecon)
|
||||||
|
|
||||||
def test_dpd_validation(self):
|
def test_dpd_validation(self):
|
||||||
params = {'dpd': {'action': 'hold',
|
params = {'dpd': {'action': 'hold',
|
||||||
|
|
Loading…
Reference in New Issue